@@ -143,10 +143,10 @@ discard block |
||
143 | 143 | 'url' => 'nvarchar', |
144 | 144 | 'encrypt' => 'nvarchar', |
145 | 145 | 'file' => 'nvarchar', |
146 | - 'decimal_tpl' => 'decimal(%d, %d)', |
|
146 | + 'decimal_tpl' => 'decimal(%d, %d)', |
|
147 | 147 | ); |
148 | 148 | |
149 | - /** |
|
149 | + /** |
|
150 | 150 | * @see DBManager::connect() |
151 | 151 | */ |
152 | 152 | public function connect(array $configOptions = null, $dieOnError = false) |
@@ -203,10 +203,10 @@ discard block |
||
203 | 203 | return true; |
204 | 204 | } |
205 | 205 | |
206 | - /** |
|
206 | + /** |
|
207 | 207 | * @see DBManager::query() |
208 | - */ |
|
209 | - public function query($sql, $dieOnError = false, $msg = '', $suppress = false, $keepResult = false) |
|
208 | + */ |
|
209 | + public function query($sql, $dieOnError = false, $msg = '', $suppress = false, $keepResult = false) |
|
210 | 210 | { |
211 | 211 | if(is_array($sql)) { |
212 | 212 | return $this->queryArray($sql, $dieOnError, $msg, $suppress); |
@@ -232,15 +232,15 @@ discard block |
||
232 | 232 | return $result; |
233 | 233 | } |
234 | 234 | |
235 | - /** |
|
235 | + /** |
|
236 | 236 | * @see DBManager::getFieldsArray() |
237 | 237 | */ |
238 | - public function getFieldsArray($result, $make_lower_case = false) |
|
239 | - { |
|
238 | + public function getFieldsArray($result, $make_lower_case = false) |
|
239 | + { |
|
240 | 240 | $field_array = array(); |
241 | 241 | |
242 | 242 | if ( !$result ) { |
243 | - return false; |
|
243 | + return false; |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | foreach ( sqlsrv_field_metadata($result) as $fieldMetadata ) { |
@@ -252,16 +252,16 @@ discard block |
||
252 | 252 | } |
253 | 253 | |
254 | 254 | return $field_array; |
255 | - } |
|
255 | + } |
|
256 | 256 | |
257 | - /** |
|
258 | - * @see DBManager::fetchRow() |
|
259 | - */ |
|
260 | - public function fetchRow($result) |
|
261 | - { |
|
262 | - if (empty($result)) return false; |
|
257 | + /** |
|
258 | + * @see DBManager::fetchRow() |
|
259 | + */ |
|
260 | + public function fetchRow($result) |
|
261 | + { |
|
262 | + if (empty($result)) return false; |
|
263 | 263 | |
264 | - $row = sqlsrv_fetch_array($result,SQLSRV_FETCH_ASSOC); |
|
264 | + $row = sqlsrv_fetch_array($result,SQLSRV_FETCH_ASSOC); |
|
265 | 265 | if (empty($row)) { |
266 | 266 | return false; |
267 | 267 | } |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | } |
278 | 278 | |
279 | 279 | return $row; |
280 | - } |
|
280 | + } |
|
281 | 281 | |
282 | 282 | /** |
283 | 283 | * @see DBManager::convert() |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | return parent::convert($string, $type, $additional_parameters); |
292 | 292 | } |
293 | 293 | |
294 | - /** |
|
294 | + /** |
|
295 | 295 | * Compares two vardefs. Overriding 39098 due to bug: 39098 . IN 6.0 we changed the id columns to dbType = 'id' |
296 | 296 | * for example emails_beans. In 554 the field email_id was nvarchar but in 6.0 since it id dbType = 'id' we would want to alter |
297 | 297 | * it to varchar. This code will prevent it. |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | */ |
318 | 318 | public function disconnect() |
319 | 319 | { |
320 | - $GLOBALS['log']->debug('Calling Mssql::disconnect()'); |
|
320 | + $GLOBALS['log']->debug('Calling Mssql::disconnect()'); |
|
321 | 321 | if(!empty($this->database)){ |
322 | 322 | $this->freeResult(); |
323 | 323 | sqlsrv_close($this->database); |
@@ -335,10 +335,10 @@ discard block |
||
335 | 335 | } |
336 | 336 | |
337 | 337 | |
338 | - /** |
|
339 | - * Detect if no clustered index has been created for a table; if none created then just pick the first index and make it that |
|
340 | - * |
|
341 | - * @see MssqlHelper::indexSQL() |
|
338 | + /** |
|
339 | + * Detect if no clustered index has been created for a table; if none created then just pick the first index and make it that |
|
340 | + * |
|
341 | + * @see MssqlHelper::indexSQL() |
|
342 | 342 | */ |
343 | 343 | public function getConstraintSql($indices, $table) |
344 | 344 | { |
@@ -378,12 +378,12 @@ discard block |
||
378 | 378 | $columns[$column_name]['len']=strtolower($row['PRECISION']); |
379 | 379 | $columns[$column_name]['len'].=','.strtolower($row['SCALE']); |
380 | 380 | } |
381 | - elseif ( in_array($row['TYPE_NAME'],array('nchar','nvarchar')) ) { |
|
382 | - $columns[$column_name]['len']=strtolower($row['PRECISION']); |
|
383 | - if ( $row['TYPE_NAME'] == 'nvarchar' && $row['PRECISION'] == '0' ) { |
|
384 | - $columns[$column_name]['len']='max'; |
|
385 | - } |
|
386 | - } |
|
381 | + elseif ( in_array($row['TYPE_NAME'],array('nchar','nvarchar')) ) { |
|
382 | + $columns[$column_name]['len']=strtolower($row['PRECISION']); |
|
383 | + if ( $row['TYPE_NAME'] == 'nvarchar' && $row['PRECISION'] == '0' ) { |
|
384 | + $columns[$column_name]['len']='max'; |
|
385 | + } |
|
386 | + } |
|
387 | 387 | elseif ( !in_array($row['TYPE_NAME'],array('datetime','text')) ) { |
388 | 388 | $columns[$column_name]['len']=strtolower($row['LENGTH']); |
389 | 389 | } |
@@ -488,21 +488,21 @@ discard block |
||
488 | 488 | return "TRUNCATE TABLE $name"; |
489 | 489 | } |
490 | 490 | |
491 | - /** |
|
492 | - * (non-PHPdoc) |
|
493 | - * @see DBManager::lastDbError() |
|
494 | - */ |
|
491 | + /** |
|
492 | + * (non-PHPdoc) |
|
493 | + * @see DBManager::lastDbError() |
|
494 | + */ |
|
495 | 495 | public function lastDbError() |
496 | 496 | { |
497 | 497 | $errors = sqlsrv_errors(SQLSRV_ERR_ERRORS); |
498 | 498 | if(empty($errors)) return false; |
499 | 499 | global $app_strings; |
500 | 500 | if (empty($app_strings) |
501 | - or !isset($app_strings['ERR_MSSQL_DB_CONTEXT']) |
|
502 | - or !isset($app_strings['ERR_MSSQL_WARNING']) ) { |
|
501 | + or !isset($app_strings['ERR_MSSQL_DB_CONTEXT']) |
|
502 | + or !isset($app_strings['ERR_MSSQL_WARNING']) ) { |
|
503 | 503 | //ignore the message from sql-server if $app_strings array is empty. This will happen |
504 | 504 | //only if connection if made before languge is set. |
505 | - return false; |
|
505 | + return false; |
|
506 | 506 | } |
507 | 507 | $messages = array(); |
508 | 508 | foreach($errors as $error) { |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | } |
516 | 516 | $sqlpos = strpos($sqlmsg, $app_strings['ERR_MSSQL_DB_CONTEXT']); |
517 | 517 | $sqlpos2 = strpos($sqlmsg, $app_strings['ERR_MSSQL_WARNING']); |
518 | - if ( $sqlpos !== false || $sqlpos2 !== false) { |
|
518 | + if ( $sqlpos !== false || $sqlpos2 !== false) { |
|
519 | 519 | continue; |
520 | 520 | } |
521 | 521 | $messages[] = $sqlmsg; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | break; |
82 | 82 | case "mssql": |
83 | - if ( function_exists('sqlsrv_connect') |
|
83 | + if ( function_exists('sqlsrv_connect') |
|
84 | 84 | && (empty($config['db_mssql_force_driver']) || $config['db_mssql_force_driver'] == 'sqlsrv' )) { |
85 | 85 | $my_db_manager = 'SqlsrvManager'; |
86 | 86 | } elseif (self::isFreeTDS() |
@@ -122,20 +122,20 @@ discard block |
||
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
125 | - * Returns a reference to the DB object for instance $instanceName, or the default |
|
125 | + * Returns a reference to the DB object for instance $instanceName, or the default |
|
126 | 126 | * instance if one is not specified |
127 | 127 | * |
128 | 128 | * @param string $instanceName optional, name of the instance |
129 | 129 | * @return object DBManager instance |
130 | 130 | */ |
131 | - public static function getInstance($instanceName = '') |
|
131 | + public static function getInstance($instanceName = '') |
|
132 | 132 | { |
133 | 133 | global $sugar_config; |
134 | 134 | static $count = 0, $old_count = 0; |
135 | 135 | |
136 | 136 | //fall back to the default instance name |
137 | 137 | if(empty($sugar_config['db'][$instanceName])){ |
138 | - $instanceName = ''; |
|
138 | + $instanceName = ''; |
|
139 | 139 | } |
140 | 140 | if(!isset(self::$instances[$instanceName])){ |
141 | 141 | $config = $sugar_config['dbconfig']; |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | /** |
249 | 249 | * Check if we have freeTDS driver installed |
250 | 250 | * Invoked when connected to mssql. checks if we have freetds version of mssql library. |
251 | - * the response is put into a global variable. |
|
251 | + * the response is put into a global variable. |
|
252 | 252 | * @return bool |
253 | 253 | */ |
254 | 254 | public static function isFreeTDS() |
@@ -256,14 +256,14 @@ discard block |
||
256 | 256 | static $is_freetds = null; |
257 | 257 | |
258 | 258 | if($is_freetds === null) { |
259 | - ob_start(); |
|
260 | - phpinfo(INFO_MODULES); |
|
261 | - $info=ob_get_contents(); |
|
262 | - ob_end_clean(); |
|
259 | + ob_start(); |
|
260 | + phpinfo(INFO_MODULES); |
|
261 | + $info=ob_get_contents(); |
|
262 | + ob_end_clean(); |
|
263 | 263 | |
264 | - $is_freetds = (strpos($info,'FreeTDS') !== false); |
|
264 | + $is_freetds = (strpos($info,'FreeTDS') !== false); |
|
265 | 265 | } |
266 | 266 | |
267 | 267 | return $is_freetds; |
268 | - } |
|
268 | + } |
|
269 | 269 | } |
270 | 270 | \ No newline at end of file |
@@ -44,45 +44,45 @@ |
||
44 | 44 | */ |
45 | 45 | class ConnectorFactory{ |
46 | 46 | |
47 | - static $source_map = array(); |
|
47 | + static $source_map = array(); |
|
48 | 48 | |
49 | - public static function getInstance($source_name){ |
|
50 | - if(empty(self::$source_map[$source_name])) { |
|
51 | - require_once('include/connectors/sources/SourceFactory.php'); |
|
52 | - require_once('include/connectors/component.php'); |
|
53 | - $source = SourceFactory::getSource($source_name); |
|
54 | - $component = new component(); |
|
55 | - $component->setSource($source); |
|
56 | - $component->init(); |
|
57 | - self::$source_map[$source_name] = $component; |
|
58 | - } |
|
59 | - return self::$source_map[$source_name]; |
|
60 | - } |
|
49 | + public static function getInstance($source_name){ |
|
50 | + if(empty(self::$source_map[$source_name])) { |
|
51 | + require_once('include/connectors/sources/SourceFactory.php'); |
|
52 | + require_once('include/connectors/component.php'); |
|
53 | + $source = SourceFactory::getSource($source_name); |
|
54 | + $component = new component(); |
|
55 | + $component->setSource($source); |
|
56 | + $component->init(); |
|
57 | + self::$source_map[$source_name] = $component; |
|
58 | + } |
|
59 | + return self::$source_map[$source_name]; |
|
60 | + } |
|
61 | 61 | |
62 | - /** |
|
63 | - * Split the class name by _ and go through the class name |
|
64 | - * which represents the inheritance structure to load up all required parents. |
|
65 | - * @param string $class the root class we want to load. |
|
66 | - */ |
|
67 | - public static function load($class, $type){ |
|
68 | - self::loadClass($class, $type); |
|
69 | - } |
|
62 | + /** |
|
63 | + * Split the class name by _ and go through the class name |
|
64 | + * which represents the inheritance structure to load up all required parents. |
|
65 | + * @param string $class the root class we want to load. |
|
66 | + */ |
|
67 | + public static function load($class, $type){ |
|
68 | + self::loadClass($class, $type); |
|
69 | + } |
|
70 | 70 | |
71 | - /** |
|
72 | - * include a source class file. |
|
73 | - * @param string $class a class file to include. |
|
74 | - */ |
|
75 | - public static function loadClass($class, $type){ |
|
76 | - $dir = str_replace('_','/',$class); |
|
77 | - $parts = explode("/", $dir); |
|
78 | - $file = $parts[count($parts)-1] . '.php'; |
|
79 | - if(file_exists("custom/modules/Connectors/connectors/{$type}/{$dir}/$file")){ |
|
80 | - require_once("custom/modules/Connectors/connectors/{$type}/{$dir}/$file"); |
|
81 | - } else if(file_exists("modules/Connectors/connectors/{$type}/{$dir}/$file")) { |
|
82 | - require_once("modules/Connectors/connectors/{$type}/{$dir}/$file"); |
|
83 | - } else if(file_exists("connectors/{$type}/{$dir}/$file")) { |
|
84 | - require_once("connectors/{$type}/{$dir}/$file"); |
|
85 | - } |
|
86 | - } |
|
71 | + /** |
|
72 | + * include a source class file. |
|
73 | + * @param string $class a class file to include. |
|
74 | + */ |
|
75 | + public static function loadClass($class, $type){ |
|
76 | + $dir = str_replace('_','/',$class); |
|
77 | + $parts = explode("/", $dir); |
|
78 | + $file = $parts[count($parts)-1] . '.php'; |
|
79 | + if(file_exists("custom/modules/Connectors/connectors/{$type}/{$dir}/$file")){ |
|
80 | + require_once("custom/modules/Connectors/connectors/{$type}/{$dir}/$file"); |
|
81 | + } else if(file_exists("modules/Connectors/connectors/{$type}/{$dir}/$file")) { |
|
82 | + require_once("modules/Connectors/connectors/{$type}/{$dir}/$file"); |
|
83 | + } else if(file_exists("connectors/{$type}/{$dir}/$file")) { |
|
84 | + require_once("connectors/{$type}/{$dir}/$file"); |
|
85 | + } |
|
86 | + } |
|
87 | 87 | } |
88 | 88 | ?> |
89 | 89 | \ No newline at end of file |
@@ -44,43 +44,43 @@ |
||
44 | 44 | */ |
45 | 45 | class ControllerFactory |
46 | 46 | { |
47 | - /** |
|
48 | - * Obtain an instance of the correct controller. |
|
49 | - * |
|
50 | - * @return an instance of SugarController |
|
51 | - */ |
|
52 | - static function getController($module){ |
|
53 | - $class = ucfirst($module).'Controller'; |
|
54 | - $customClass = 'Custom' . $class; |
|
55 | - if(file_exists('custom/modules/'.$module.'/controller.php')){ |
|
56 | - $customClass = 'Custom' . $class; |
|
57 | - require_once('custom/modules/'.$module.'/controller.php'); |
|
58 | - if(class_exists($customClass)){ |
|
59 | - $controller = new $customClass(); |
|
60 | - }else if(class_exists($class)){ |
|
61 | - $controller = new $class(); |
|
62 | - } |
|
63 | - }elseif(file_exists('modules/'.$module.'/controller.php')){ |
|
64 | - require_once('modules/'.$module.'/controller.php'); |
|
65 | - if(class_exists($customClass)){ |
|
66 | - $controller = new $customClass(); |
|
67 | - }else if(class_exists($class)){ |
|
68 | - $controller = new $class(); |
|
69 | - } |
|
70 | - }else{ |
|
71 | - if(file_exists('custom/include/MVC/Controller/SugarController.php')){ |
|
72 | - require_once('custom/include/MVC/Controller/SugarController.php'); |
|
73 | - } |
|
74 | - if(class_exists('CustomSugarController')){ |
|
75 | - $controller = new CustomSugarController(); |
|
76 | - }else{ |
|
77 | - $controller = new SugarController(); |
|
78 | - } |
|
79 | - } |
|
80 | - //setup the controller |
|
81 | - $controller->setup($module); |
|
82 | - return $controller; |
|
83 | - } |
|
47 | + /** |
|
48 | + * Obtain an instance of the correct controller. |
|
49 | + * |
|
50 | + * @return an instance of SugarController |
|
51 | + */ |
|
52 | + static function getController($module){ |
|
53 | + $class = ucfirst($module).'Controller'; |
|
54 | + $customClass = 'Custom' . $class; |
|
55 | + if(file_exists('custom/modules/'.$module.'/controller.php')){ |
|
56 | + $customClass = 'Custom' . $class; |
|
57 | + require_once('custom/modules/'.$module.'/controller.php'); |
|
58 | + if(class_exists($customClass)){ |
|
59 | + $controller = new $customClass(); |
|
60 | + }else if(class_exists($class)){ |
|
61 | + $controller = new $class(); |
|
62 | + } |
|
63 | + }elseif(file_exists('modules/'.$module.'/controller.php')){ |
|
64 | + require_once('modules/'.$module.'/controller.php'); |
|
65 | + if(class_exists($customClass)){ |
|
66 | + $controller = new $customClass(); |
|
67 | + }else if(class_exists($class)){ |
|
68 | + $controller = new $class(); |
|
69 | + } |
|
70 | + }else{ |
|
71 | + if(file_exists('custom/include/MVC/Controller/SugarController.php')){ |
|
72 | + require_once('custom/include/MVC/Controller/SugarController.php'); |
|
73 | + } |
|
74 | + if(class_exists('CustomSugarController')){ |
|
75 | + $controller = new CustomSugarController(); |
|
76 | + }else{ |
|
77 | + $controller = new SugarController(); |
|
78 | + } |
|
79 | + } |
|
80 | + //setup the controller |
|
81 | + $controller->setup($module); |
|
82 | + return $controller; |
|
83 | + } |
|
84 | 84 | |
85 | 85 | } |
86 | 86 | ?> |
87 | 87 | \ No newline at end of file |
@@ -43,7 +43,7 @@ |
||
43 | 43 | * To change the template for this generated file go to |
44 | 44 | * Window - Preferences - PHPeclipse - PHP - Code Templates |
45 | 45 | */ |
46 | - //format '<action_name>' => '<view_name>' |
|
46 | + //format '<action_name>' => '<view_name>' |
|
47 | 47 | $action_view_map['multieditview']= 'multiedit'; |
48 | 48 | $action_view_map['detailview']= 'detail'; |
49 | 49 | $action_view_map['editview']= 'edit'; |
@@ -46,29 +46,29 @@ |
||
46 | 46 | * Contributor(s): ______________________________________.. |
47 | 47 | ********************************************************************************/ |
48 | 48 | $file_access_control_map = array( |
49 | - 'modules' => array( |
|
50 | - 'administration' => array( |
|
51 | - 'actions' => array( |
|
52 | - 'backups', |
|
53 | - 'updater', |
|
54 | - ), |
|
55 | - 'links' => array( |
|
56 | - 'update', |
|
57 | - 'backup_management', |
|
58 | - 'upgrade_wizard', |
|
59 | - 'moduleBuilder', |
|
60 | - ), |
|
61 | - ), |
|
62 | - 'upgradewizard' => array( |
|
63 | - 'actions' => array( |
|
64 | - 'index', |
|
65 | - ), |
|
66 | - ), |
|
67 | - 'modulebuilder' => array( |
|
68 | - 'actions' => array( |
|
69 | - 'index' => array('params' => array('type' => array('mb'))), |
|
70 | - ), |
|
71 | - ), |
|
72 | - ) |
|
49 | + 'modules' => array( |
|
50 | + 'administration' => array( |
|
51 | + 'actions' => array( |
|
52 | + 'backups', |
|
53 | + 'updater', |
|
54 | + ), |
|
55 | + 'links' => array( |
|
56 | + 'update', |
|
57 | + 'backup_management', |
|
58 | + 'upgrade_wizard', |
|
59 | + 'moduleBuilder', |
|
60 | + ), |
|
61 | + ), |
|
62 | + 'upgradewizard' => array( |
|
63 | + 'actions' => array( |
|
64 | + 'index', |
|
65 | + ), |
|
66 | + ), |
|
67 | + 'modulebuilder' => array( |
|
68 | + 'actions' => array( |
|
69 | + 'index' => array('params' => array('type' => array('mb'))), |
|
70 | + ), |
|
71 | + ), |
|
72 | + ) |
|
73 | 73 | ); |
74 | 74 | ?> |
75 | 75 | \ No newline at end of file |
@@ -42,13 +42,13 @@ discard block |
||
42 | 42 | |
43 | 43 | $yui_path = array( |
44 | 44 | "2.9.0" => "include/javascript/yui", |
45 | - "2_9_0" => "include/javascript/yui", |
|
46 | - "3.3.0" => "include/javascript/yui3", |
|
47 | - "3_3_0" => "include/javascript/yui3" |
|
45 | + "2_9_0" => "include/javascript/yui", |
|
46 | + "3.3.0" => "include/javascript/yui3", |
|
47 | + "3_3_0" => "include/javascript/yui3" |
|
48 | 48 | ); |
49 | 49 | $types = array( |
50 | 50 | "js" => "application/javascript", |
51 | - "css" => "text/css", |
|
51 | + "css" => "text/css", |
|
52 | 52 | ); |
53 | 53 | $out = ""; |
54 | 54 | |
@@ -57,36 +57,36 @@ discard block |
||
57 | 57 | |
58 | 58 | foreach ($_REQUEST as $param => $val) |
59 | 59 | { |
60 | - //No backtracking in the path |
|
61 | - if (strpos($param, "..") !== false) |
|
60 | + //No backtracking in the path |
|
61 | + if (strpos($param, "..") !== false) |
|
62 | 62 | continue; |
63 | 63 | |
64 | - $version = explode("/", $param); |
|
65 | - $version = $version[0]; |
|
64 | + $version = explode("/", $param); |
|
65 | + $version = $version[0]; |
|
66 | 66 | if (empty($yui_path[$version])) continue; |
67 | 67 | |
68 | 68 | $path = $yui_path[$version] . substr($param, strlen($version)); |
69 | 69 | |
70 | - $extension = substr($path, strrpos($path, "_") + 1); |
|
70 | + $extension = substr($path, strrpos($path, "_") + 1); |
|
71 | 71 | |
72 | - //Only allowed file extensions |
|
73 | - if (empty($types[$extension])) |
|
74 | - continue; |
|
72 | + //Only allowed file extensions |
|
73 | + if (empty($types[$extension])) |
|
74 | + continue; |
|
75 | 75 | |
76 | - if (empty($contentType)) |
|
76 | + if (empty($contentType)) |
|
77 | 77 | { |
78 | 78 | $contentType = $types[$extension]; |
79 | 79 | } |
80 | - //Put together the final filepath |
|
81 | - $path = substr($path, 0, strrpos($path, "_")) . "." . $extension; |
|
82 | - $contents = ''; |
|
83 | - if (is_file($path)) { |
|
84 | - $out .= "/*" . $path . "*/\n"; |
|
85 | - $contents = file_get_contents($path); |
|
86 | - $out .= $contents . "\n"; |
|
87 | - } |
|
88 | - $path = empty($contents) ? $path : $contents; |
|
89 | - $allpath .= md5($path); |
|
80 | + //Put together the final filepath |
|
81 | + $path = substr($path, 0, strrpos($path, "_")) . "." . $extension; |
|
82 | + $contents = ''; |
|
83 | + if (is_file($path)) { |
|
84 | + $out .= "/*" . $path . "*/\n"; |
|
85 | + $contents = file_get_contents($path); |
|
86 | + $out .= $contents . "\n"; |
|
87 | + } |
|
88 | + $path = empty($contents) ? $path : $contents; |
|
89 | + $allpath .= md5($path); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | $etag = '"'.md5($allpath).'"'; |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public function setRefreshIcon() |
141 | 141 | { |
142 | - $additionalTitle = ''; |
|
142 | + $additionalTitle = ''; |
|
143 | 143 | if($this->isRefreshable) |
144 | 144 | |
145 | 145 | $additionalTitle .= '<a href="#" onclick="SUGAR.mySugar.retrieveDashlet(\'' |
@@ -165,9 +165,9 @@ discard block |
||
165 | 165 | public function displayScript() |
166 | 166 | { |
167 | 167 | |
168 | - require_once('include/SugarCharts/SugarChartFactory.php'); |
|
169 | - $sugarChart = SugarChartFactory::getInstance(); |
|
170 | - return $sugarChart->getDashletScript($this->id); |
|
168 | + require_once('include/SugarCharts/SugarChartFactory.php'); |
|
169 | + $sugarChart = SugarChartFactory::getInstance(); |
|
170 | + return $sugarChart->getDashletScript($this->id); |
|
171 | 171 | |
172 | 172 | } |
173 | 173 | |
@@ -272,11 +272,11 @@ discard block |
||
272 | 272 | $this->getConfigureSmartyInstance()->assign('showClearButton', $this->isConfigPanelClearShown); |
273 | 273 | |
274 | 274 | if($this->isAutoRefreshable()) { |
275 | - $this->getConfigureSmartyInstance()->assign('isRefreshable', true); |
|
276 | - $this->getConfigureSmartyInstance()->assign('autoRefresh', $GLOBALS['app_strings']['LBL_DASHLET_CONFIGURE_AUTOREFRESH']); |
|
277 | - $this->getConfigureSmartyInstance()->assign('autoRefreshOptions', $this->getAutoRefreshOptions()); |
|
278 | - $this->getConfigureSmartyInstance()->assign('autoRefreshSelect', $this->autoRefresh); |
|
279 | - } |
|
275 | + $this->getConfigureSmartyInstance()->assign('isRefreshable', true); |
|
276 | + $this->getConfigureSmartyInstance()->assign('autoRefresh', $GLOBALS['app_strings']['LBL_DASHLET_CONFIGURE_AUTOREFRESH']); |
|
277 | + $this->getConfigureSmartyInstance()->assign('autoRefreshOptions', $this->getAutoRefreshOptions()); |
|
278 | + $this->getConfigureSmartyInstance()->assign('autoRefreshSelect', $this->autoRefresh); |
|
279 | + } |
|
280 | 280 | |
281 | 281 | return parent::displayOptions() . $this->getConfigureSmartyInstance()->fetch($this->_configureTpl); |
282 | 282 | } |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | $dashletOffset = 0; |
340 | 340 | $module = $_REQUEST['module']; |
341 | 341 | if(isset($_REQUEST[$module.'2_'.strtoupper($this->getSeedBean()->object_name).'_offset'])) { |
342 | - $dashletOffset = $_REQUEST[$module.'2_'.strtoupper($this->getSeedBean()->object_name).'_offset']; |
|
342 | + $dashletOffset = $_REQUEST[$module.'2_'.strtoupper($this->getSeedBean()->object_name).'_offset']; |
|
343 | 343 | } |
344 | 344 | } |
345 | 345 |
@@ -43,79 +43,79 @@ |
||
43 | 43 | * Created: Sep 12, 2011 |
44 | 44 | */ |
45 | 45 | class DashletRssFeedTitle { |
46 | - public $defaultEncoding = "UTF-8"; |
|
47 | - public $readBytes = 8192; |
|
48 | - public $url; |
|
49 | - public $cut = 70; |
|
50 | - public $contents = ""; |
|
51 | - public $title = ""; |
|
52 | - public $endWith = "..."; |
|
53 | - public $xmlEncoding = false; |
|
54 | - public $fileOpen = false; |
|
46 | + public $defaultEncoding = "UTF-8"; |
|
47 | + public $readBytes = 8192; |
|
48 | + public $url; |
|
49 | + public $cut = 70; |
|
50 | + public $contents = ""; |
|
51 | + public $title = ""; |
|
52 | + public $endWith = "..."; |
|
53 | + public $xmlEncoding = false; |
|
54 | + public $fileOpen = false; |
|
55 | 55 | |
56 | - public function __construct($url) { |
|
57 | - $this->url = $url; |
|
58 | - } |
|
56 | + public function __construct($url) { |
|
57 | + $this->url = $url; |
|
58 | + } |
|
59 | 59 | |
60 | - public function generateTitle() { |
|
61 | - if ($this->readFeed()) { |
|
62 | - $this->getTitle(); |
|
63 | - if (!empty($this->title)) { |
|
64 | - $this->convertEncoding(); |
|
65 | - $this->cutLength(); |
|
66 | - } |
|
67 | - } |
|
68 | - return $this->title; |
|
69 | - } |
|
60 | + public function generateTitle() { |
|
61 | + if ($this->readFeed()) { |
|
62 | + $this->getTitle(); |
|
63 | + if (!empty($this->title)) { |
|
64 | + $this->convertEncoding(); |
|
65 | + $this->cutLength(); |
|
66 | + } |
|
67 | + } |
|
68 | + return $this->title; |
|
69 | + } |
|
70 | 70 | |
71 | - /** |
|
72 | - * @todo use curl with waiting timeout instead of fopen |
|
73 | - */ |
|
74 | - public function readFeed() { |
|
75 | - if ($this->url) { |
|
71 | + /** |
|
72 | + * @todo use curl with waiting timeout instead of fopen |
|
73 | + */ |
|
74 | + public function readFeed() { |
|
75 | + if ($this->url) { |
|
76 | 76 | if (!in_array(strtolower(parse_url($this->url, PHP_URL_SCHEME)), array("http", "https"), true)) { |
77 | 77 | return false; |
78 | 78 | } |
79 | - $fileOpen = @fopen($this->url, 'r'); |
|
80 | - if ($fileOpen) { |
|
81 | - $this->fileOpen = true; |
|
82 | - $this->contents = fread($fileOpen, $this->readBytes); |
|
83 | - fclose($fileOpen); |
|
84 | - return true; |
|
85 | - } |
|
86 | - } |
|
87 | - return false; |
|
88 | - } |
|
79 | + $fileOpen = @fopen($this->url, 'r'); |
|
80 | + if ($fileOpen) { |
|
81 | + $this->fileOpen = true; |
|
82 | + $this->contents = fread($fileOpen, $this->readBytes); |
|
83 | + fclose($fileOpen); |
|
84 | + return true; |
|
85 | + } |
|
86 | + } |
|
87 | + return false; |
|
88 | + } |
|
89 | 89 | |
90 | - /** |
|
91 | - * |
|
92 | - */ |
|
93 | - public function getTitle() { |
|
94 | - $matches = array (); |
|
95 | - preg_match("/<title>.*?<\/title>/i", $this->contents, $matches); |
|
96 | - if (isset($matches[0])) { |
|
97 | - $this->title = str_replace(array('<![CDATA[', '<title>', '</title>', ']]>'), '', $matches[0]); |
|
98 | - } |
|
99 | - } |
|
90 | + /** |
|
91 | + * |
|
92 | + */ |
|
93 | + public function getTitle() { |
|
94 | + $matches = array (); |
|
95 | + preg_match("/<title>.*?<\/title>/i", $this->contents, $matches); |
|
96 | + if (isset($matches[0])) { |
|
97 | + $this->title = str_replace(array('<![CDATA[', '<title>', '</title>', ']]>'), '', $matches[0]); |
|
98 | + } |
|
99 | + } |
|
100 | 100 | |
101 | - public function cutLength() { |
|
102 | - if (mb_strlen(trim($this->title), $this->defaultEncoding) > $this->cut) { |
|
103 | - $this->title = mb_substr($this->title, 0, $this->cut, $this->defaultEncoding) . $this->endWith; |
|
104 | - } |
|
105 | - } |
|
101 | + public function cutLength() { |
|
102 | + if (mb_strlen(trim($this->title), $this->defaultEncoding) > $this->cut) { |
|
103 | + $this->title = mb_substr($this->title, 0, $this->cut, $this->defaultEncoding) . $this->endWith; |
|
104 | + } |
|
105 | + } |
|
106 | 106 | |
107 | - private function _identifyXmlEncoding() { |
|
108 | - $matches = array (); |
|
109 | - preg_match('/encoding\=*\".*?\"/', $this->contents, $matches); |
|
110 | - if (isset($matches[0])) { |
|
111 | - $this->xmlEncoding = trim(str_replace('encoding="', '"', $matches[0]), '"'); |
|
112 | - } |
|
113 | - } |
|
107 | + private function _identifyXmlEncoding() { |
|
108 | + $matches = array (); |
|
109 | + preg_match('/encoding\=*\".*?\"/', $this->contents, $matches); |
|
110 | + if (isset($matches[0])) { |
|
111 | + $this->xmlEncoding = trim(str_replace('encoding="', '"', $matches[0]), '"'); |
|
112 | + } |
|
113 | + } |
|
114 | 114 | |
115 | - public function convertEncoding() { |
|
116 | - $this->_identifyXmlEncoding(); |
|
117 | - if ($this->xmlEncoding && $this->xmlEncoding != $this->defaultEncoding) { |
|
118 | - $this->title = iconv($this->xmlEncoding, $this->defaultEncoding, $this->title); |
|
119 | - } |
|
120 | - } |
|
115 | + public function convertEncoding() { |
|
116 | + $this->_identifyXmlEncoding(); |
|
117 | + if ($this->xmlEncoding && $this->xmlEncoding != $this->defaultEncoding) { |
|
118 | + $this->title = iconv($this->xmlEncoding, $this->defaultEncoding, $this->title); |
|
119 | + } |
|
120 | + } |
|
121 | 121 | } |