# r33125 - /trunk/addressbook/inc/class.addressbook\_wizard\_export\_contacts\_csv.inc.php

**URL:** <https://help.egroupware.org/t/r33125-trunk-addressbook-inc-class-addressbook-wizard-export-contacts-csv-inc-php/42418>\
**Category:** eGW-svn\
**Created:** [November 23, 2010, 4:06pm UTC](https://help.egroupware.org/t/r33125-trunk-addressbook-inc-class-addressbook-wizard-export-contacts-csv-inc-php/42418 "2010-11-23T16:06:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nathangray](https://help.egroupware.org/letter_avatar_proxy/v4/letter/n/77aa72/32.png) [@nathangray](https://help.egroupware.org/u/nathangray)\
**Post date:** [November 23, 2010, 4:06pm UTC](https://help.egroupware.org/t/r33125-trunk-addressbook-inc-class-addressbook-wizard-export-contacts-csv-inc-php/42418/1 "2010-11-23T16:06:11Z")

</div>

Author: nathangray  
New Revision: 33125

URL: [http://www.egroupware.org/viewvc/egroupware?rev=33125&view=rev](http://www.egroupware.org/viewvc/egroupware?rev=33125&view=rev)  
Log:  
Skip the step about multi-select columns if none of those columns are selected

Modified:  
trunk/addressbook/inc/class.addressbook\_wizard\_export\_contacts\_csv.inc.php

# Modified: trunk/addressbook/inc/class.addressbook\_wizard\_export\_contacts\_csv.inc.php URL: [http://www.egroupware.org/viewvc/egroupware/trunk/addressbook/inc/class.addressbook\_wizard\_export\_contacts\_csv.inc.php?rev=33125&r1=33124&r2=33125&view=diff](http://www.egroupware.org/viewvc/egroupware/trunk/addressbook/inc/class.addressbook_wizard_export_contacts_csv.inc.php?rev=33125&r1=33124&r2=33125&view=diff)

— trunk/addressbook/inc/class.addressbook\_wizard\_export\_contacts\_csv.inc.php (original)  
+++ trunk/addressbook/inc/class.addressbook\_wizard\_export\_contacts\_csv.inc.php Tue Nov 23 17:06:10 2010  
@@ -24,6 +24,24 @@  
$this-\>export\_fields[’#’.$name] = $data[‘label’];  
}  
unset($this-\>export\_fields[‘jpegphoto’]); // can’t cvs export that

- }

- 
- /\*\*

- 
  - Overridden to be able to skip the next step

- \*/

- function wizard\_step40(&$content, &$sel\_options, &$readonlys, &$preserv) {

- 
- 

```
  if ($content['step'] == 'wizard_step40' && array_search('pressed', $content['button']) == 'next') {

```

- 

```
  	$result = parent::wizard_step40($content, $sel_options, $readonlys, $preserv);

```

- 

```
  	$field_list = $this->get_field_list($content);

```

- 

```
  	if(count($field_list)) {

```

- 

```
  		return $result;

```

- 

```
  	} else {

```

- 

```
  		return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'],2);

```

- 

```
  	}

```

- 

```
  } else {

```

- 

```
  	return parent::wizard_step40($content, $sel_options, $readonlys, $preserv);

```

- 

```
  }

```

}

```
   /**

```

@@ -62,21 +80,8 @@  
$content[‘msg’] = $this-\>steps[‘wizard\_step50’];  
$content[‘step’] = ‘wizard\_step50’;  
unset ($preserv[‘button’]);

- 

```
  	$field_list = array();

```

- 

```
  	$field_list = $this->get_field_list($content);

```

- 

```
  	// Category gets special handling

```

- 

```
  	if(in_array('cat_id', array_keys($content['mapping']))) {

```

- 

```
  		$field_list['cat_id'] = $this->export_fields['cat_id'];

```

- 

```
  	}

```

- 
- 

```
  	// Add any multi-select custom fields

```

- 

```
  	$custom = config::get_customfields('addressbook');

```

- 

```
  	foreach($custom as $name => $c_field) {

```

- 

```
  		if($c_field['type'] = 'select' && $c_field['rows'] > 1 && in_array('#'.$name, array_keys($content['mapping']))) {

```

- 

```
  			$field_list['#'.$name] = $c_field['label'];

```

- 

```
  		}

```

- 

```
  	}

```

- 

```
  	$settings = $content['explode_multiselects'] ? $content['explode_multiselects'] : $content['plugin_options']['explode_multiselects'];

  	// Skip this step if no fields applicable

```

@@ -113,4 +118,25 @@  
return $this-\>step\_templates[$content[‘step’]];  
}  
}  
+

- /\*\*
- 
  - Get a list of multi-select fields

- \*/
- protected function get\_field\_list($content) {
- 

```
  $field_list = array();

```

- 
- 

```
  // Category gets special handling

```

- 

```
  if(in_array('cat_id', array_keys($content['mapping']))) {

```

- 

```
  	$field_list['cat_id'] = $this->export_fields['cat_id'];

```

- 

```
  }

```

- 
- 

```
  // Add any multi-select custom fields

```

- 

```
  $custom = config::get_customfields('addressbook');

```

- 

```
  foreach($custom as $name => $c_field) {

```

- 

```
  	if($c_field['type'] = 'select' && $c_field['rows'] > 1 && in_array('#'.$name, array_keys($content['mapping']))) {

```

- 

```
  		$field_list['#'.$name] = $c_field['label'];

```

- 

```
  	}

```

- 

```
  }

```

- 

```
  return $field_list;

```

- }  
}

* * *

Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!  
Tap into the largest installed PC base & get more eyes on your game by  
optimizing for Intel® Graphics Technology. Get started today with the  
Intel® Software Partner Program. Five $500 cash prizes are up for grabs.  
[http://p.sf.net/sfu/intelisp-dev2dev](http://p.sf.net/sfu/intelisp-dev2dev)

* * *

eGroupWare-cvs mailing list  
[eGroupWare-cvs@lists.sourceforge.net](mailto:eGroupWare-cvs@lists.sourceforge.net)  
[https://lists.sourceforge.net/lists/listinfo/egroupware-cvs](https://lists.sourceforge.net/lists/listinfo/egroupware-cvs)
