@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | { |
| 104 | 104 | $eval_ret = @eval('$rules = ' . $ruleset . ';'); |
| 105 | 105 | |
| 106 | - if ( $eval_ret === false |
|
| 106 | + if ($eval_ret === false |
|
| 107 | 107 | || !is_array($rules)) |
| 108 | 108 | { |
| 109 | 109 | throw new midcom_error('given ruleset could not be parsed'); |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | $stat = true; |
| 143 | 143 | //start with first group |
| 144 | 144 | $this->result_mc->begin_group(strtoupper($rules['type'])); |
| 145 | - reset ($rules['classes']); |
|
| 145 | + reset($rules['classes']); |
|
| 146 | 146 | //iterate over groups |
| 147 | 147 | foreach ($rules['classes'] as $group) |
| 148 | 148 | { |
@@ -174,8 +174,7 @@ discard block |
||
| 174 | 174 | $ret = array(); |
| 175 | 175 | foreach (array_keys($results) as $key) |
| 176 | 176 | { |
| 177 | - $ret[$this->result_mc->get_subkey($key, 'id')] = array |
|
| 178 | - ( |
|
| 177 | + $ret[$this->result_mc->get_subkey($key, 'id')] = array( |
|
| 179 | 178 | 'lastname' => $this->result_mc->get_subkey($key, 'lastname'), |
| 180 | 179 | 'firstname' => $this->result_mc->get_subkey($key, 'firstname'), |
| 181 | 180 | 'email' => $this->result_mc->get_subkey($key, 'email'), |
@@ -358,7 +357,7 @@ discard block |
||
| 358 | 357 | */ |
| 359 | 358 | private function add_misc_rule(array $rule, $class, $person_property) |
| 360 | 359 | { |
| 361 | - $persons = array ( 0 => -1); |
|
| 360 | + $persons = array(0 => -1); |
|
| 362 | 361 | $match = $rule['match']; |
| 363 | 362 | $constraint_match = "IN"; |
| 364 | 363 | if ($rule['match'] == '<>') |
@@ -391,8 +390,7 @@ discard block |
||
| 391 | 390 | |
| 392 | 391 | public static function build_property_map(midcom_services_i18n_l10n $l10n) |
| 393 | 392 | { |
| 394 | - $types = array |
|
| 395 | - ( |
|
| 393 | + $types = array( |
|
| 396 | 394 | 'person' => new org_openpsa_contacts_person_dba, |
| 397 | 395 | 'group' => new org_openpsa_contacts_group_dba, |
| 398 | 396 | 'membership' => new org_openpsa_contacts_member_dba |
@@ -400,15 +398,13 @@ discard block |
||
| 400 | 398 | $return = array(); |
| 401 | 399 | foreach ($types as $name => $object) |
| 402 | 400 | { |
| 403 | - $return[$name] = array |
|
| 404 | - ( |
|
| 401 | + $return[$name] = array( |
|
| 405 | 402 | 'properties' => self::list_object_properties($object, $l10n), |
| 406 | 403 | 'localized' => $l10n->get('class:' . $name), |
| 407 | 404 | 'parameters' => false |
| 408 | 405 | ); |
| 409 | 406 | } |
| 410 | - $return['generic_parameters'] = array |
|
| 411 | - ( |
|
| 407 | + $return['generic_parameters'] = array( |
|
| 412 | 408 | 'properties' => false, |
| 413 | 409 | 'localized' => $l10n->get('class:generic parameters'), |
| 414 | 410 | 'parameters' => true |
@@ -428,8 +424,7 @@ discard block |
||
| 428 | 424 | public static function list_object_properties(midcom_core_dbaobject $object, midcom_services_i18n_l10n $l10n) |
| 429 | 425 | { |
| 430 | 426 | // These are internal to midgard and/or not valid QB constraints |
| 431 | - $skip_properties = array |
|
| 432 | - ( |
|
| 427 | + $skip_properties = array( |
|
| 433 | 428 | // These will be deprecated soon |
| 434 | 429 | 'orgOpenpsaAccesstype', |
| 435 | 430 | 'orgOpenpsaWgtype', |
@@ -460,14 +455,14 @@ discard block |
||
| 460 | 455 | |
| 461 | 456 | foreach ($helper->get_object_vars($object) as $property => $value) |
| 462 | 457 | { |
| 463 | - if ( preg_match('/^_/', $property) |
|
| 458 | + if (preg_match('/^_/', $property) |
|
| 464 | 459 | || in_array($property, $skip_properties) |
| 465 | 460 | || property_exists($object, $property)) |
| 466 | 461 | { |
| 467 | 462 | // Skip private or otherwise invalid properties |
| 468 | 463 | continue; |
| 469 | 464 | } |
| 470 | - if ( is_object($value) |
|
| 465 | + if (is_object($value) |
|
| 471 | 466 | && !is_a($value, 'midgard_datetime')) |
| 472 | 467 | { |
| 473 | 468 | while (list ($property2, $value2) = each($value)) |
@@ -308,8 +308,7 @@ discard block |
||
| 308 | 308 | try |
| 309 | 309 | { |
| 310 | 310 | $parent = midcom::get()->dbfactory->get_object_by_guid($guid); |
| 311 | - } |
|
| 312 | - catch (midcom_error $e) |
|
| 311 | + } catch (midcom_error $e) |
|
| 313 | 312 | { |
| 314 | 313 | $e->log(); |
| 315 | 314 | continue; |
@@ -365,8 +364,7 @@ discard block |
||
| 365 | 364 | { |
| 366 | 365 | $constraint_match = "NOT IN"; |
| 367 | 366 | $match = '='; |
| 368 | - } |
|
| 369 | - else if ($rule['match'] == 'NOT LIKE') |
|
| 367 | + } else if ($rule['match'] == 'NOT LIKE') |
|
| 370 | 368 | { |
| 371 | 369 | $constraint_match = "NOT IN"; |
| 372 | 370 | $match = 'LIKE'; |
@@ -475,8 +473,7 @@ discard block |
||
| 475 | 473 | $prop_merged = "{$property}.{$property2}"; |
| 476 | 474 | $ret[$prop_merged] = $l10n->get("property:{$prop_merged}"); |
| 477 | 475 | } |
| 478 | - } |
|
| 479 | - else |
|
| 476 | + } else |
|
| 480 | 477 | { |
| 481 | 478 | $ret[$property] = $l10n->get("property:{$property}"); |
| 482 | 479 | } |