@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | var $templateDir = 'modules/'; |
51 | 51 | var $ss; |
52 | 52 | function TemplateHandler() { |
53 | - $this->cacheDir = sugar_cached(''); |
|
53 | + $this->cacheDir = sugar_cached(''); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | function loadSmarty(){ |
@@ -66,10 +66,10 @@ discard block |
||
66 | 66 | * |
67 | 67 | */ |
68 | 68 | static function clearAll() { |
69 | - global $beanList; |
|
70 | - foreach($beanList as $module_dir =>$object_name){ |
|
69 | + global $beanList; |
|
70 | + foreach($beanList as $module_dir =>$object_name){ |
|
71 | 71 | TemplateHandler::clearCache($module_dir); |
72 | - } |
|
72 | + } |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | foreach($panel as $row) { |
133 | 133 | foreach($row as $entry) { |
134 | 134 | if(empty($entry)) { |
135 | - continue; |
|
135 | + continue; |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | if(is_array($entry) && |
@@ -140,35 +140,35 @@ discard block |
||
140 | 140 | isset($entry['displayParams']) && |
141 | 141 | isset($entry['displayParams']['required']) && |
142 | 142 | $entry['displayParams']['required']) { |
143 | - $panelFields[$entry['name']] = $entry; |
|
143 | + $panelFields[$entry['name']] = $entry; |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | if(is_array($entry)) { |
147 | - $defs2[$entry['name']] = $entry; |
|
147 | + $defs2[$entry['name']] = $entry; |
|
148 | 148 | } else { |
149 | - $defs2[$entry] = array('name' => $entry); |
|
149 | + $defs2[$entry] = array('name' => $entry); |
|
150 | 150 | } |
151 | 151 | } //foreach |
152 | 152 | } //foreach |
153 | 153 | } //foreach |
154 | 154 | |
155 | 155 | foreach($panelFields as $field=>$value) { |
156 | - $nameList = array(); |
|
157 | - if(!is_array($value['displayParams']['required'])) { |
|
158 | - $nameList[] = $field; |
|
159 | - } else { |
|
160 | - foreach($value['displayParams']['required'] as $groupedField) { |
|
161 | - $nameList[] = $groupedField; |
|
162 | - } |
|
163 | - } |
|
164 | - |
|
165 | - foreach($nameList as $x) { |
|
166 | - if(isset($defs[$x]) && |
|
156 | + $nameList = array(); |
|
157 | + if(!is_array($value['displayParams']['required'])) { |
|
158 | + $nameList[] = $field; |
|
159 | + } else { |
|
160 | + foreach($value['displayParams']['required'] as $groupedField) { |
|
161 | + $nameList[] = $groupedField; |
|
162 | + } |
|
163 | + } |
|
164 | + |
|
165 | + foreach($nameList as $x) { |
|
166 | + if(isset($defs[$x]) && |
|
167 | 167 | isset($defs[$x]['type']) && |
168 | 168 | !isset($defs[$x]['required'])) { |
169 | 169 | $defs[$x]['required'] = true; |
170 | - } |
|
171 | - } |
|
170 | + } |
|
171 | + } |
|
172 | 172 | } //foreach |
173 | 173 | |
174 | 174 | //Create a base class with field_name_map property |
@@ -195,23 +195,23 @@ discard block |
||
195 | 195 | //5) not already been added to Array |
196 | 196 | foreach($sugarbean->field_name_map as $name=>$def) { |
197 | 197 | |
198 | - if($def['type']=='relate' && |
|
198 | + if($def['type']=='relate' && |
|
199 | 199 | isset($defs2[$name]) && |
200 | 200 | (!isset($defs2[$name]['validateDependency']) || $defs2[$name]['validateDependency'] === true) && |
201 | 201 | isset($def['id_name']) && |
202 | 202 | !in_array($name, $validatedFields)) { |
203 | 203 | |
204 | - if(isset($mod_strings[$def['vname']]) |
|
204 | + if(isset($mod_strings[$def['vname']]) |
|
205 | 205 | || isset($app_strings[$def['vname']]) |
206 | 206 | || translate($def['vname'],$sugarbean->module_dir) != $def['vname']) { |
207 | - $vname = $def['vname']; |
|
208 | - } |
|
209 | - else{ |
|
210 | - $vname = "undefined"; |
|
211 | - } |
|
212 | - $javascript->addToValidateBinaryDependency($name, 'alpha', $javascript->buildStringToTranslateInSmarty('ERR_SQS_NO_MATCH_FIELD').': '.$javascript->buildStringToTranslateInSmarty($vname), (!empty($def['required']) ? 'true' : 'false'), '', $def['id_name']); |
|
213 | - $validatedFields[] = $name; |
|
214 | - } |
|
207 | + $vname = $def['vname']; |
|
208 | + } |
|
209 | + else{ |
|
210 | + $vname = "undefined"; |
|
211 | + } |
|
212 | + $javascript->addToValidateBinaryDependency($name, 'alpha', $javascript->buildStringToTranslateInSmarty('ERR_SQS_NO_MATCH_FIELD').': '.$javascript->buildStringToTranslateInSmarty($vname), (!empty($def['required']) ? 'true' : 'false'), '', $def['id_name']); |
|
213 | + $validatedFields[] = $name; |
|
214 | + } |
|
215 | 215 | } //foreach |
216 | 216 | |
217 | 217 | $contents .= "{literal}\n"; |
@@ -275,11 +275,11 @@ discard block |
||
275 | 275 | } |
276 | 276 | $file = $this->cacheDir . $this->templateDir . $module . '/' . $view . '.tpl'; |
277 | 277 | if(file_exists($file)) { |
278 | - return $this->ss->fetch($file); |
|
278 | + return $this->ss->fetch($file); |
|
279 | 279 | } else { |
280 | - global $app_strings; |
|
281 | - $GLOBALS['log']->fatal($app_strings['ERR_NO_SUCH_FILE'] .": $file"); |
|
282 | - return $app_strings['ERR_NO_SUCH_FILE'] .": $file"; |
|
280 | + global $app_strings; |
|
281 | + $GLOBALS['log']->fatal($app_strings['ERR_NO_SUCH_FILE'] .": $file"); |
|
282 | + return $app_strings['ERR_NO_SUCH_FILE'] .": $file"; |
|
283 | 283 | } |
284 | 284 | } |
285 | 285 | |
@@ -329,13 +329,13 @@ discard block |
||
329 | 329 | } |
330 | 330 | $qsd->setFormName($view); |
331 | 331 | if(preg_match('/^SearchForm_.+/', $view)){ |
332 | - if(strpos($view, 'popup_query_form')){ |
|
333 | - $qsd->setFormName('popup_query_form'); |
|
334 | - $parsedView = 'advanced'; |
|
335 | - }else{ |
|
336 | - $qsd->setFormName('search_form'); |
|
337 | - $parsedView = preg_replace("/^SearchForm_/", "", $view); |
|
338 | - } |
|
332 | + if(strpos($view, 'popup_query_form')){ |
|
333 | + $qsd->setFormName('popup_query_form'); |
|
334 | + $parsedView = 'advanced'; |
|
335 | + }else{ |
|
336 | + $qsd->setFormName('search_form'); |
|
337 | + $parsedView = preg_replace("/^SearchForm_/", "", $view); |
|
338 | + } |
|
339 | 339 | //Loop through the Meta-Data fields to see which ones need quick search support |
340 | 340 | foreach($defs as $f) { |
341 | 341 | $field = $f; |
@@ -373,14 +373,14 @@ discard block |
||
373 | 373 | $sqs_objects[$name.'_'.$parsedView] = $qsd->getQSContact($field['name'], $field['id_name']); |
374 | 374 | } |
375 | 375 | } else { |
376 | - $sqs_objects[$name.'_'.$parsedView] = $qsd->getQSParent($field['module']); |
|
377 | - if(!isset($field['field_list']) && !isset($field['populate_list'])) { |
|
378 | - $sqs_objects[$name.'_'.$parsedView]['populate_list'] = array($field['name'], $field['id_name']); |
|
379 | - $sqs_objects[$name.'_'.$parsedView]['field_list'] = array('name', 'id'); |
|
380 | - } else { |
|
381 | - $sqs_objects[$name.'_'.$parsedView]['populate_list'] = $field['field_list']; |
|
382 | - $sqs_objects[$name.'_'.$parsedView]['field_list'] = $field['populate_list']; |
|
383 | - } |
|
376 | + $sqs_objects[$name.'_'.$parsedView] = $qsd->getQSParent($field['module']); |
|
377 | + if(!isset($field['field_list']) && !isset($field['populate_list'])) { |
|
378 | + $sqs_objects[$name.'_'.$parsedView]['populate_list'] = array($field['name'], $field['id_name']); |
|
379 | + $sqs_objects[$name.'_'.$parsedView]['field_list'] = array('name', 'id'); |
|
380 | + } else { |
|
381 | + $sqs_objects[$name.'_'.$parsedView]['populate_list'] = $field['field_list']; |
|
382 | + $sqs_objects[$name.'_'.$parsedView]['field_list'] = $field['populate_list']; |
|
383 | + } |
|
384 | 384 | } |
385 | 385 | } else if($field['type'] == 'parent') { |
386 | 386 | $sqs_objects[$name.'_'.$parsedView] = $qsd->getQSParent(); |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | } //foreach |
389 | 389 | |
390 | 390 | foreach ( $sqs_objects as $name => $field ) |
391 | - foreach ( $field['populate_list'] as $key => $fieldname ) |
|
391 | + foreach ( $field['populate_list'] as $key => $fieldname ) |
|
392 | 392 | $sqs_objects[$name]['populate_list'][$key] = $sqs_objects[$name]['populate_list'][$key] . '_'.$parsedView; |
393 | 393 | }else{ |
394 | 394 | //Loop through the Meta-Data fields to see which ones need quick search support |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | $field['id_name'] = $module.$field['id_name']; |
414 | 414 | } |
415 | 415 | } |
416 | - $name = $qsd->form_name . '_' . $field['name']; |
|
416 | + $name = $qsd->form_name . '_' . $field['name']; |
|
417 | 417 | |
418 | 418 | |
419 | 419 | if($field['type'] == 'relate' && isset($field['module']) && (preg_match('/_name$|_c$/si',$name) || !empty($field['quicksearch']))) { |
@@ -427,15 +427,15 @@ discard block |
||
427 | 427 | } else if($matches[0] == 'Users'){ |
428 | 428 | if($field['name'] == 'reports_to_name'){ |
429 | 429 | $sqs_objects[$name] = $qsd->getQSUser('reports_to_name','reports_to_id'); |
430 | - // Bug #52994 : QuickSearch for a 1-M User relationship changes assigned to user |
|
430 | + // Bug #52994 : QuickSearch for a 1-M User relationship changes assigned to user |
|
431 | 431 | }elseif($field['name'] == 'assigned_user_name'){ |
432 | - $sqs_objects[$name] = $qsd->getQSUser('assigned_user_name','assigned_user_id'); |
|
433 | - } |
|
434 | - else |
|
435 | - { |
|
436 | - $sqs_objects[$name] = $qsd->getQSUser($field['name'], $field['id_name']); |
|
432 | + $sqs_objects[$name] = $qsd->getQSUser('assigned_user_name','assigned_user_id'); |
|
433 | + } |
|
434 | + else |
|
435 | + { |
|
436 | + $sqs_objects[$name] = $qsd->getQSUser($field['name'], $field['id_name']); |
|
437 | 437 | |
438 | - } |
|
438 | + } |
|
439 | 439 | } else if($matches[0] == 'Campaigns') { |
440 | 440 | $sqs_objects[$name] = $qsd->loadQSObject('Campaigns', 'Campaign', $field['name'], $field['id_name'], $field['id_name']); |
441 | 441 | } else if($matches[0] == 'Accounts') { |
@@ -486,39 +486,39 @@ discard block |
||
486 | 486 | //merge populate_list && field_list with vardef |
487 | 487 | if (!empty($field['field_list']) && !empty($field['populate_list'])) { |
488 | 488 | for ($j=0; $j<count($field['field_list']); $j++) { |
489 | - //search for the same couple (field_list_item,populate_field_item) |
|
490 | - $field_list_item = $field['field_list'][$j]; |
|
491 | - $field_list_item_alternate = $qsd->form_name . '_' . $field['field_list'][$j]; |
|
492 | - $populate_list_item = $field['populate_list'][$j]; |
|
493 | - $found = false; |
|
494 | - for ($k=0; $k<count($sqs_objects[$name]['field_list']); $k++) { |
|
495 | - if (($field_list_item == $sqs_objects[$name]['populate_list'][$k] || $field_list_item_alternate == $sqs_objects[$name]['populate_list'][$k]) && //il faut inverser field_list et populate_list (cf lignes 465,466 ci-dessus) |
|
496 | - $populate_list_item == $sqs_objects[$name]['field_list'][$k]) { |
|
497 | - $found = true; |
|
498 | - break; |
|
499 | - } |
|
500 | - } |
|
501 | - if (!$found) { |
|
502 | - $sqs_objects[$name]['field_list'][] = $field['populate_list'][$j]; // as in lines 462 and 463 |
|
503 | - $sqs_objects[$name]['populate_list'][] = $field['field_list'][$j]; |
|
504 | - } |
|
505 | - } |
|
489 | + //search for the same couple (field_list_item,populate_field_item) |
|
490 | + $field_list_item = $field['field_list'][$j]; |
|
491 | + $field_list_item_alternate = $qsd->form_name . '_' . $field['field_list'][$j]; |
|
492 | + $populate_list_item = $field['populate_list'][$j]; |
|
493 | + $found = false; |
|
494 | + for ($k=0; $k<count($sqs_objects[$name]['field_list']); $k++) { |
|
495 | + if (($field_list_item == $sqs_objects[$name]['populate_list'][$k] || $field_list_item_alternate == $sqs_objects[$name]['populate_list'][$k]) && //il faut inverser field_list et populate_list (cf lignes 465,466 ci-dessus) |
|
496 | + $populate_list_item == $sqs_objects[$name]['field_list'][$k]) { |
|
497 | + $found = true; |
|
498 | + break; |
|
499 | + } |
|
500 | + } |
|
501 | + if (!$found) { |
|
502 | + $sqs_objects[$name]['field_list'][] = $field['populate_list'][$j]; // as in lines 462 and 463 |
|
503 | + $sqs_objects[$name]['populate_list'][] = $field['field_list'][$j]; |
|
504 | + } |
|
505 | + } |
|
506 | 506 | } |
507 | 507 | |
508 | 508 | } //foreach |
509 | 509 | } |
510 | 510 | |
511 | - //Implement QuickSearch for the field |
|
512 | - if(!empty($sqs_objects) && count($sqs_objects) > 0) { |
|
513 | - $quicksearch_js = '<script language="javascript">'; |
|
514 | - $quicksearch_js.= 'if(typeof sqs_objects == \'undefined\'){var sqs_objects = new Array;}'; |
|
515 | - $json = getJSONobj(); |
|
516 | - foreach($sqs_objects as $sqsfield=>$sqsfieldArray){ |
|
517 | - $quicksearch_js .= "sqs_objects['$sqsfield']={$json->encode($sqsfieldArray)};"; |
|
518 | - } |
|
519 | - return $quicksearch_js . '</script>'; |
|
520 | - } |
|
521 | - return ''; |
|
511 | + //Implement QuickSearch for the field |
|
512 | + if(!empty($sqs_objects) && count($sqs_objects) > 0) { |
|
513 | + $quicksearch_js = '<script language="javascript">'; |
|
514 | + $quicksearch_js.= 'if(typeof sqs_objects == \'undefined\'){var sqs_objects = new Array;}'; |
|
515 | + $json = getJSONobj(); |
|
516 | + foreach($sqs_objects as $sqsfield=>$sqsfieldArray){ |
|
517 | + $quicksearch_js .= "sqs_objects['$sqsfield']={$json->encode($sqsfieldArray)};"; |
|
518 | + } |
|
519 | + return $quicksearch_js . '</script>'; |
|
520 | + } |
|
521 | + return ''; |
|
522 | 522 | } |
523 | 523 | |
524 | 524 |
@@ -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 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | function smarty_function_sugar_number_format($params, &$smarty) { |
38 | 38 | global $locale; |
39 | 39 | |
40 | - if(!isset($params['var']) || $params['var'] === '') { |
|
40 | + if(!isset($params['var']) || $params['var'] === '') { |
|
41 | 41 | return ''; |
42 | 42 | } |
43 | 43 |