@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | private function load_next() |
61 | 61 | { |
62 | - $i =& $this->_request_data['loop_i']; |
|
62 | + $i = & $this->_request_data['loop_i']; |
|
63 | 63 | while ($i < 100) { |
64 | 64 | debug_add("Loop iteration {$i}"); |
65 | 65 | $qb = new midgard_query_builder('midgard_parameter'); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | continue; |
88 | 88 | } |
89 | 89 | // Make sure we actually have enough rights to do this |
90 | - if ( !$object1->can_do('midgard:update') |
|
90 | + if (!$object1->can_do('midgard:update') |
|
91 | 91 | || !$object1->can_do('midgard:delete') |
92 | 92 | || !$object2->can_do('midgard:update') |
93 | 93 | || !$object2->can_do('midgard:delete')) { |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | continue; |
97 | 97 | } |
98 | 98 | // Extra sanity check (in case of semi-successful not-duplicate mark) |
99 | - if ( $object1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $object2->guid) |
|
99 | + if ($object1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $object2->guid) |
|
100 | 100 | || $object2->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $object1->guid)) { |
101 | 101 | debug_add("It seems these two (#{$object1->id} and #{$object2->id}) have also marked as not duplicates, some cleanup might be a good thing", MIDCOM_LOG_WARN); |
102 | 102 | $i++; |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | if ($keep == 'both') { |
129 | 129 | $option1->require_do('midgard:update'); |
130 | 130 | $option2->require_do('midgard:update'); |
131 | - if ( $option1->set_parameter('org.openpsa.contacts.duplicates:not_duplicate', $option2->guid, time()) |
|
131 | + if ($option1->set_parameter('org.openpsa.contacts.duplicates:not_duplicate', $option2->guid, time()) |
|
132 | 132 | && $option2->set_parameter('org.openpsa.contacts.duplicates:not_duplicate', $option1->guid, time())) { |
133 | 133 | // Clear the possible duplicate parameters |
134 | 134 | $option1->delete_parameter('org.openpsa.contacts.duplicates:possible_duplicate', $option2->guid); |
@@ -146,11 +146,11 @@ discard block |
||
146 | 146 | } |
147 | 147 | } else { |
148 | 148 | if ($keep == $option1->guid) { |
149 | - $object1 =& $option1; |
|
150 | - $object2 =& $option2; |
|
149 | + $object1 = & $option1; |
|
150 | + $object2 = & $option2; |
|
151 | 151 | } elseif ($keep == $option2->guid) { |
152 | - $object1 =& $option2; |
|
153 | - $object2 =& $option1; |
|
152 | + $object1 = & $option2; |
|
153 | + $object2 = & $option1; |
|
154 | 154 | } else { |
155 | 155 | throw new midcom_error('Something weird happened (basically we got bogus data)'); |
156 | 156 | } |
@@ -82,7 +82,8 @@ discard block |
||
82 | 82 | try { |
83 | 83 | $object1 = $this->load($param->parentguid); |
84 | 84 | $object2 = $this->load($param->name); |
85 | - } catch (midcom_error $e) { |
|
85 | + } |
|
86 | + catch (midcom_error $e) { |
|
86 | 87 | $i++; |
87 | 88 | continue; |
88 | 89 | } |
@@ -160,7 +161,8 @@ discard block |
||
160 | 161 | try { |
161 | 162 | $merger = new org_openpsa_contacts_duplicates_merge($this->mode, $this->_config); |
162 | 163 | $merger->merge_delete($object1, $object2); |
163 | - } catch (midcom_error $e) { |
|
164 | + } |
|
165 | + catch (midcom_error $e) { |
|
164 | 166 | // TODO: Localize |
165 | 167 | midcom::get()->uimessages->add($this->_l10n->get('org.openpsa.contacts'), 'Merge failed, errstr: ' . $e->getMessage(), 'error'); |
166 | 168 | } |