function rollback($conv_type, $role_back_date, $rollback_file, $rollback_voucher, $voucher_id_intern)
 {
     include PHPGW_SERVER_ROOT . "/property/inc/export/{$GLOBALS['phpgw_info']['user']['domain']}/{$conv_type}";
     $invoice = new export_conv();
     $buffer = $invoice->RullTilbake($role_back_date, $rollback_file, $rollback_voucher, $voucher_id_intern);
     return $buffer;
 }
 function export($conv_type, $cat_id = '')
 {
     if ($conv_type == 'none') {
         return False;
     }
     include PHPGW_APP_INC . '/export/' . $conv_type;
     $buffer = array();
     $contacts = new export_conv();
     // Read in user custom fields, if any
     $customfields = array();
     while (list($col, $descr) = @each($GLOBALS['phpgw_info']['user']['preferences']['addressbook'])) {
         if (substr($col, 0, 6) == 'extra_') {
             $field = str_replace('extra_', '', $col);
             $field = str_replace(' ', '_', $field);
             $customfields[$field] = ucfirst($field);
         }
     }
     $extrafields = array('ophone' => 'ophone', 'address2' => 'address2', 'address3' => 'address3');
     if ($contacts->type != 'vcard') {
         $contacts->qfields = $contacts->stock_contact_fields;
         # + $extrafields;# + $customfields;
     }
     if (!empty($cat_id)) {
         $buffer = $contacts->export_start_file($buffer, $cat_id);
     } else {
         $buffer = $contacts->export_start_file($buffer);
     }
     for ($i = 0; $i < count($contacts->ids); $i++) {
         $buffer = $contacts->export_start_record($buffer);
         while (list($name, $value) = each($contacts->currentrecord)) {
             $buffer = $contacts->export_new_attrib($buffer, $name, $value);
         }
         $buffer = $contacts->export_end_record($buffer);
     }
     // Here, buffer becomes a string suitable for printing
     $buffer = $contacts->export_end_file($buffer);
     $tsvfilename = $GLOBALS['phpgw_info']['server']['temp_dir'] . SEP . $tsvfilename;
     return $buffer;
 }
 function export($conv_type, $cat_id = '', $both_types = '', $sub_cats = '')
 {
     include PHPGW_APP_INC . '/export/' . $conv_type;
     $buffer = array();
     $contacts = new export_conv();
     // Note our use of ===.  Simply == would not work as expected
     if (strpos($conv_type, 'OpenOffice') === false) {
         // Read in user custom fields, if any
         $customfields = array();
         while (list($col, $descr) = @each($GLOBALS['phpgw_info']['user']['preferences']['addressbook'])) {
             if (substr($col, 0, 6) == 'extra_') {
                 $field = preg_replace('/extra_/', '', $col);
                 $field = preg_replace('/ /', '_', $field);
                 $customfields[$field] = ucfirst($field);
             }
         }
         if (!empty($cat_id)) {
             $buffer = $contacts->export_start_file($buffer, $cat_id);
         } else {
             $buffer = $contacts->export_start_file($buffer);
         }
         for ($i = 0; $i < count($contacts->ids); $i++) {
             $buffer = $contacts->export_start_record($buffer);
             while (list($name, $value) = each($contacts->currentrecord)) {
                 $buffer = $contacts->export_new_attrib($buffer, $name, $value);
             }
             $buffer = $contacts->export_end_record($buffer);
         }
         // Here, buffer becomes a string suitable for printing
         $buffer = $contacts->export_end_file($buffer);
         $tsvfilename = "{$GLOBALS['phpgw_info']['server']['temp_dir']}/{$tsvfilename}";
     } else {
         //echo "<pre>here1  $both_types $sub_cats</pre>";
         $tsvfilename = $contacts->do_it($both_types, $sub_cats);
         $buffer = $tsvfilename;
     }
     return $buffer;
 }