r33125 - /trunk/addressbook/inc/class.addressbook_wizard_export_contacts_csv.inc.php

Author: nathangray
New Revision: 33125

URL: 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

— 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


eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs