@@ -45,15 +45,15 @@ discard block |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
48 | - * Import a single record |
|
49 | - * |
|
50 | - * You don't need to worry about mappings or translations, they've been done already. |
|
51 | - * You do need to handle the conditions and the actions taken. |
|
52 | - * |
|
53 | - * Updates the count of actions taken |
|
54 | - * |
|
55 | - * @return boolean success |
|
56 | - */ |
|
48 | + * Import a single record |
|
49 | + * |
|
50 | + * You don't need to worry about mappings or translations, they've been done already. |
|
51 | + * You do need to handle the conditions and the actions taken. |
|
52 | + * |
|
53 | + * Updates the count of actions taken |
|
54 | + * |
|
55 | + * @return boolean success |
|
56 | + */ |
|
57 | 57 | protected function import_record(importexport_iface_egw_record &$record, &$import_csv) |
58 | 58 | { |
59 | 59 | // Check for an un-matched accessory of, try again on just name |
@@ -250,14 +250,14 @@ discard block |
||
250 | 250 | } |
251 | 251 | |
252 | 252 | /** |
253 | - * Returns warnings that were encountered during importing |
|
254 | - * Maximum of one warning message per record, but you can append if you need to |
|
255 | - * |
|
256 | - * @return Array ( |
|
257 | - * record_# => warning message |
|
258 | - * ) |
|
259 | - */ |
|
260 | - public function get_warnings() { |
|
253 | + * Returns warnings that were encountered during importing |
|
254 | + * Maximum of one warning message per record, but you can append if you need to |
|
255 | + * |
|
256 | + * @return Array ( |
|
257 | + * record_# => warning message |
|
258 | + * ) |
|
259 | + */ |
|
260 | + public function get_warnings() { |
|
261 | 261 | return $this->warnings; |
262 | 262 | } |
263 | 263 | } |
@@ -26,20 +26,20 @@ |
||
26 | 26 | $this->id_field = 'res_id'; |
27 | 27 | |
28 | 28 | $this->field2history = array( |
29 | - 'res_id' => 'res_id', |
|
30 | - 'name' => 'name', |
|
31 | - 'short_description' => 'short_description', |
|
32 | - 'cat_id' => 'cat_id', |
|
33 | - 'quantity' => 'quantity', |
|
34 | - 'useable' => 'useable', |
|
35 | - 'location' => 'location', |
|
36 | - 'storage_info' => 'storage_info', |
|
37 | - 'bookable' => 'bookable', |
|
38 | - 'buyable' => 'buyable', |
|
39 | - 'prize' => 'prize', |
|
40 | - 'long_description' => 'long_description', |
|
41 | - 'inventory_number' => 'inventory_number', |
|
42 | - 'accessory_of' => 'accessory_of' |
|
29 | + 'res_id' => 'res_id', |
|
30 | + 'name' => 'name', |
|
31 | + 'short_description' => 'short_description', |
|
32 | + 'cat_id' => 'cat_id', |
|
33 | + 'quantity' => 'quantity', |
|
34 | + 'useable' => 'useable', |
|
35 | + 'location' => 'location', |
|
36 | + 'storage_info' => 'storage_info', |
|
37 | + 'bookable' => 'bookable', |
|
38 | + 'buyable' => 'buyable', |
|
39 | + 'prize' => 'prize', |
|
40 | + 'long_description' => 'long_description', |
|
41 | + 'inventory_number' => 'inventory_number', |
|
42 | + 'accessory_of' => 'accessory_of' |
|
43 | 43 | ); |
44 | 44 | parent::__construct($this->appname); |
45 | 45 | } |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | private $bocontacts; |
46 | 46 | |
47 | 47 | /** |
48 | - * For figuring out if a contact has changed |
|
49 | - */ |
|
48 | + * For figuring out if a contact has changed |
|
49 | + */ |
|
50 | 50 | protected $tracking; |
51 | 51 | |
52 | 52 | /** |
@@ -76,9 +76,9 @@ discard block |
||
76 | 76 | protected $errors = array(); |
77 | 77 | |
78 | 78 | /** |
79 | - * List of actions, and how many times that action was taken |
|
80 | - */ |
|
81 | - protected $results = array(); |
|
79 | + * List of actions, and how many times that action was taken |
|
80 | + */ |
|
81 | + protected $results = array(); |
|
82 | 82 | |
83 | 83 | /** |
84 | 84 | * imports entries according to given definition object. |
@@ -93,14 +93,14 @@ discard block |
||
93 | 93 | $this->is_admin = isset( $GLOBALS['egw_info']['user']['apps']['admin'] ) && $GLOBALS['egw_info']['user']['apps']['admin']; |
94 | 94 | $this->user = $GLOBALS['egw_info']['user']['account_id']; |
95 | 95 | |
96 | - // set contact owner |
|
97 | - $contact_owner = isset( $_definition->plugin_options['contact_owner'] ) ? |
|
98 | - $_definition->plugin_options['contact_owner'] : $this->user; |
|
99 | - // Import into importer's personal addressbook |
|
100 | - if($contact_owner == 'personal') |
|
101 | - { |
|
102 | - $contact_owner = $this->user; |
|
103 | - } |
|
96 | + // set contact owner |
|
97 | + $contact_owner = isset( $_definition->plugin_options['contact_owner'] ) ? |
|
98 | + $_definition->plugin_options['contact_owner'] : $this->user; |
|
99 | + // Import into importer's personal addressbook |
|
100 | + if($contact_owner == 'personal') |
|
101 | + { |
|
102 | + $contact_owner = $this->user; |
|
103 | + } |
|
104 | 104 | |
105 | 105 | // dry run? |
106 | 106 | $this->dry_run = isset( $_definition->plugin_options['dry_run'] ) ? $_definition->plugin_options['dry_run'] : false; |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $this->errors = array(); |
124 | 124 | |
125 | 125 | // Fix for Apple Addressbook |
126 | - $vCard = preg_replace('/item\d\.(ADR|TEL|EMAIL|URL)/', '\1', stream_get_contents($_stream)); |
|
126 | + $vCard = preg_replace('/item\d\.(ADR|TEL|EMAIL|URL)/', '\1', stream_get_contents($_stream)); |
|
127 | 127 | |
128 | 128 | $contacts = new Api\CalDAV\IcalIterator($vCard, '', $charset, array($this, '_vcard'),array( |
129 | 129 | // Owner (addressbook) |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | foreach($this->preview_records as $record) |
278 | 278 | { |
279 | 279 | // Convert to human-friendly |
280 | - importexport_export_csv::convert($record,$record_class::$types,$_definition->application); |
|
280 | + importexport_export_csv::convert($record,$record_class::$types,$_definition->application); |
|
281 | 281 | $record = $record->get_record_array(); |
282 | 282 | $row = array(); |
283 | 283 | foreach(array_keys($labels) as $field) |
@@ -350,38 +350,38 @@ discard block |
||
350 | 350 | } |
351 | 351 | |
352 | 352 | /** |
353 | - * Returns warnings that were encountered during importing |
|
354 | - * Maximum of one warning message per record, but you can append if you need to |
|
355 | - * |
|
356 | - * @return Array ( |
|
357 | - * record_# => warning message |
|
358 | - * ) |
|
359 | - */ |
|
360 | - public function get_warnings() { |
|
353 | + * Returns warnings that were encountered during importing |
|
354 | + * Maximum of one warning message per record, but you can append if you need to |
|
355 | + * |
|
356 | + * @return Array ( |
|
357 | + * record_# => warning message |
|
358 | + * ) |
|
359 | + */ |
|
360 | + public function get_warnings() { |
|
361 | 361 | return $this->warnings; |
362 | 362 | } |
363 | 363 | |
364 | 364 | /** |
365 | - * Returns errors that were encountered during importing |
|
366 | - * Maximum of one error message per record, but you can append if you need to |
|
367 | - * |
|
368 | - * @return Array ( |
|
369 | - * record_# => error message |
|
370 | - * ) |
|
371 | - */ |
|
372 | - public function get_errors() { |
|
365 | + * Returns errors that were encountered during importing |
|
366 | + * Maximum of one error message per record, but you can append if you need to |
|
367 | + * |
|
368 | + * @return Array ( |
|
369 | + * record_# => error message |
|
370 | + * ) |
|
371 | + */ |
|
372 | + public function get_errors() { |
|
373 | 373 | return $this->errors; |
374 | 374 | } |
375 | 375 | |
376 | 376 | /** |
377 | - * Returns a list of actions taken, and the number of records for that action. |
|
378 | - * Actions are things like 'insert', 'update', 'delete', and may be different for each plugin. |
|
379 | - * |
|
380 | - * @return Array ( |
|
381 | - * action => record count |
|
382 | - * ) |
|
383 | - */ |
|
384 | - public function get_results() { |
|
385 | - return $this->results; |
|
386 | - } |
|
377 | + * Returns a list of actions taken, and the number of records for that action. |
|
378 | + * Actions are things like 'insert', 'update', 'delete', and may be different for each plugin. |
|
379 | + * |
|
380 | + * @return Array ( |
|
381 | + * action => record count |
|
382 | + * ) |
|
383 | + */ |
|
384 | + public function get_results() { |
|
385 | + return $this->results; |
|
386 | + } |
|
387 | 387 | } |
@@ -365,10 +365,10 @@ discard block |
||
365 | 365 | } |
366 | 366 | |
367 | 367 | /** |
368 | - * Convert some internal data to something with more meaning |
|
369 | - * |
|
370 | - * Dates, times, user IDs, category IDs |
|
371 | - */ |
|
368 | + * Convert some internal data to something with more meaning |
|
369 | + * |
|
370 | + * Dates, times, user IDs, category IDs |
|
371 | + */ |
|
372 | 372 | public static function convert(addressbook_egw_record &$record, $options) { |
373 | 373 | |
374 | 374 | if ($record->tel_prefer) { |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | * Adjust automatically generated filter fields |
437 | 437 | */ |
438 | 438 | public function get_filter_fields(Array &$filters) |
439 | - { |
|
439 | + { |
|
440 | 440 | unset($filters['last_event']); |
441 | 441 | unset($filters['next_event']); |
442 | 442 | foreach($filters as $field_name => &$settings) |
@@ -90,20 +90,20 @@ discard block |
||
90 | 90 | */ |
91 | 91 | var $clientProperties; |
92 | 92 | /** |
93 | - * Set Logging |
|
94 | - * |
|
95 | - * @var string |
|
96 | - * off = false; |
|
97 | - */ |
|
93 | + * Set Logging |
|
94 | + * |
|
95 | + * @var string |
|
96 | + * off = false; |
|
97 | + */ |
|
98 | 98 | var $log = false; |
99 | 99 | var $logfile="/tmp/log-vcard"; |
100 | 100 | /** |
101 | - * Constructor |
|
102 | - * |
|
103 | - * @param string $contact_app the current application |
|
104 | - * @param string $_contentType the content type (version) |
|
105 | - * @param array $_clientProperties client properties |
|
106 | - */ |
|
101 | + * Constructor |
|
102 | + * |
|
103 | + * @param string $contact_app the current application |
|
104 | + * @param string $_contentType the content type (version) |
|
105 | + * @param array $_clientProperties client properties |
|
106 | + */ |
|
107 | 107 | function __construct($contact_app='addressbook', $_contentType='text/x-vcard', &$_clientProperties = array()) |
108 | 108 | { |
109 | 109 | parent::__construct($contact_app); |
@@ -126,15 +126,15 @@ discard block |
||
126 | 126 | $this->supportedFields = $this->databaseFields; |
127 | 127 | } |
128 | 128 | /** |
129 | - * import a vard into addressbook |
|
130 | - * |
|
131 | - * @param string $_vcard the vcard |
|
132 | - * @param int/string $_abID =null the internal addressbook id or !$_abID for a new enty |
|
133 | - * @param boolean $merge =false merge data with existing entry |
|
134 | - * @param string $charset The encoding charset for $text. Defaults to |
|
135 | - * utf-8 for new format, iso-8859-1 for old format. |
|
136 | - * @return int contact id |
|
137 | - */ |
|
129 | + * import a vard into addressbook |
|
130 | + * |
|
131 | + * @param string $_vcard the vcard |
|
132 | + * @param int/string $_abID =null the internal addressbook id or !$_abID for a new enty |
|
133 | + * @param boolean $merge =false merge data with existing entry |
|
134 | + * @param string $charset The encoding charset for $text. Defaults to |
|
135 | + * utf-8 for new format, iso-8859-1 for old format. |
|
136 | + * @return int contact id |
|
137 | + */ |
|
138 | 138 | function addVCard($_vcard, $_abID=null, $merge=false, $charset=null) |
139 | 139 | { |
140 | 140 | if (!($contact = $this->vcardtoegw($_vcard, $charset))) return false; |
@@ -174,17 +174,17 @@ discard block |
||
174 | 174 | $contact['id'] = $_abID; |
175 | 175 | } |
176 | 176 | else |
177 | - { |
|
178 | - if (is_array($contact['cat_id'])) |
|
177 | + { |
|
178 | + if (is_array($contact['cat_id'])) |
|
179 | 179 | { |
180 | 180 | $contact['cat_id'] = implode(',',$this->find_or_add_categories($contact['cat_id'], -1)); |
181 | 181 | } |
182 | - } |
|
183 | - if (isset($contact['owner']) && $contact['owner'] != $this->user) |
|
184 | - { |
|
185 | - $contact['private'] = 0; // foreign contacts are never private! |
|
186 | - } |
|
187 | - if ($this->log) |
|
182 | + } |
|
183 | + if (isset($contact['owner']) && $contact['owner'] != $this->user) |
|
184 | + { |
|
185 | + $contact['private'] = 0; // foreign contacts are never private! |
|
186 | + } |
|
187 | + if ($this->log) |
|
188 | 188 | { |
189 | 189 | error_log(__FILE__.'['.__LINE__.'] '.__METHOD__."()\n" . |
190 | 190 | array2string($contact)."\n",3,$this->logfile); |
@@ -193,13 +193,13 @@ discard block |
||
193 | 193 | } |
194 | 194 | |
195 | 195 | /** |
196 | - * return a vcard |
|
197 | - * |
|
198 | - * @param int/string $_id the id of the contact |
|
199 | - * @param string $_charset ='UTF-8' encoding of the vcard, default UTF-8 |
|
200 | - * @param boolean $extra_charset_attribute =true GroupDAV/CalDAV dont need the charset attribute and some clients have problems with it |
|
201 | - * @return string containing the vcard |
|
202 | - */ |
|
196 | + * return a vcard |
|
197 | + * |
|
198 | + * @param int/string $_id the id of the contact |
|
199 | + * @param string $_charset ='UTF-8' encoding of the vcard, default UTF-8 |
|
200 | + * @param boolean $extra_charset_attribute =true GroupDAV/CalDAV dont need the charset attribute and some clients have problems with it |
|
201 | + * @return string containing the vcard |
|
202 | + */ |
|
203 | 203 | function getVCard($_id,$_charset='UTF-8',$extra_charset_attribute=true) |
204 | 204 | { |
205 | 205 | $vCard = new Horde_Icalendar_Vcard($this->version); |
@@ -533,14 +533,14 @@ discard block |
||
533 | 533 | } |
534 | 534 | |
535 | 535 | /** |
536 | - * Parses a string containing vCard data. |
|
537 | - * |
|
538 | - * @param string $_vcard The data to parse. |
|
539 | - * @param string $charset The encoding charset for $text. Defaults to |
|
540 | - * utf-8 for new format, iso-8859-1 for old format. |
|
541 | - * |
|
542 | - * @return array|boolean The contact data or false on errors. |
|
543 | - */ |
|
536 | + * Parses a string containing vCard data. |
|
537 | + * |
|
538 | + * @param string $_vcard The data to parse. |
|
539 | + * @param string $charset The encoding charset for $text. Defaults to |
|
540 | + * utf-8 for new format, iso-8859-1 for old format. |
|
541 | + * |
|
542 | + * @return array|boolean The contact data or false on errors. |
|
543 | + */ |
|
544 | 544 | function vcardtoegw($_vcard, $charset=null) |
545 | 545 | { |
546 | 546 | // the horde class does the charset conversion. DO NOT CONVERT HERE. |
@@ -799,7 +799,7 @@ discard block |
||
799 | 799 | } |
800 | 800 | break; |
801 | 801 | case 'TEL;OTHER;VOICE': |
802 | - if (!in_array('TEL;OTHER', $rowNames) |
|
802 | + if (!in_array('TEL;OTHER', $rowNames) |
|
803 | 803 | && !isset($finalRowNames['TEL;OTHER'])) |
804 | 804 | { |
805 | 805 | $finalRowNames['TEL;OTHER'] = $vcardKey; |
@@ -1885,12 +1885,12 @@ discard block |
||
1885 | 1885 | } |
1886 | 1886 | |
1887 | 1887 | /** |
1888 | - * Edit a contact |
|
1889 | - * |
|
1890 | - * @param array $content=null submitted content |
|
1891 | - * @param int $_GET['contact_id'] contact_id mainly for popup use |
|
1892 | - * @param bool $_GET['makecp'] true if you want to copy the contact given by $_GET['contact_id'] |
|
1893 | - */ |
|
1888 | + * Edit a contact |
|
1889 | + * |
|
1890 | + * @param array $content=null submitted content |
|
1891 | + * @param int $_GET['contact_id'] contact_id mainly for popup use |
|
1892 | + * @param bool $_GET['makecp'] true if you want to copy the contact given by $_GET['contact_id'] |
|
1893 | + */ |
|
1894 | 1894 | function edit($content=null) |
1895 | 1895 | { |
1896 | 1896 | if (is_array($content)) |
@@ -3069,8 +3069,8 @@ discard block |
||
3069 | 3069 | } |
3070 | 3070 | |
3071 | 3071 | /** |
3072 | - * Set up history log widget |
|
3073 | - */ |
|
3072 | + * Set up history log widget |
|
3073 | + */ |
|
3074 | 3074 | protected function setup_history(&$content, &$sel_options) |
3075 | 3075 | { |
3076 | 3076 | if ($this->contact_repository == 'ldap' || !$content['id'] || |
@@ -168,7 +168,7 @@ |
||
168 | 168 | // some apache mod_auth_* modules use REMOTE_USER instead of PHP_AUTH_USER, thanks to Sylvain Beucler |
169 | 169 | if ($GLOBALS['egw_info']['server']['auth_type'] == 'http' && !isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['REMOTE_USER'])) |
170 | 170 | { |
171 | - $_SERVER['PHP_AUTH_USER'] = $_SERVER['REMOTE_USER']; |
|
171 | + $_SERVER['PHP_AUTH_USER'] = $_SERVER['REMOTE_USER']; |
|
172 | 172 | } |
173 | 173 | if($GLOBALS['egw_info']['server']['auth_type'] == 'http' && isset($_SERVER['PHP_AUTH_USER'])) |
174 | 174 | { |
@@ -19,8 +19,8 @@ |
||
19 | 19 | // or an uncoditional redirect to this file or copy groupdav.htaccess to your docroot as .htaccess |
20 | 20 | if ($_SERVER['REQUEST_METHOD'] == 'PROPFIND' || $_SERVER['REQUEST_METHOD'] == 'OPTIONS') |
21 | 21 | { |
22 | - header('Location: groupdav.php/'); |
|
23 | - exit; |
|
22 | + header('Location: groupdav.php/'); |
|
23 | + exit; |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | // forward for not existing or empty header to setup |
@@ -25,11 +25,11 @@ |
||
25 | 25 | // Used in conversions |
26 | 26 | static $types = array( |
27 | 27 | 'select' => array('info_type', 'info_status', 'info_priority', 'pl_id'), |
28 | - 'select-cat' => array('info_cat'), |
|
29 | - 'select-account' => array('info_owner','info_responsible','info_modifier'), |
|
30 | - 'date-time' => array('info_startdate', 'info_enddate','info_datecompleted', 'info_datemodified','info_created'), |
|
28 | + 'select-cat' => array('info_cat'), |
|
29 | + 'select-account' => array('info_owner','info_responsible','info_modifier'), |
|
30 | + 'date-time' => array('info_startdate', 'info_enddate','info_datecompleted', 'info_datemodified','info_created'), |
|
31 | 31 | 'links' => array('info_link_id'), |
32 | - ); |
|
32 | + ); |
|
33 | 33 | |
34 | 34 | /** |
35 | 35 | * constructor |