Add cat selection to export

This commit is contained in:
Miles Lott 2001-03-28 01:54:00 +00:00
parent d8c21b2961
commit c17201687a
8 changed files with 52 additions and 42 deletions

View File

@ -47,10 +47,12 @@
sort($myfilearray);
for ($i=0;$i<count($myfilearray);$i++) {
$fname = ereg_replace('_',' ',$myfilearray[$i]);
$conv .= '<OPTION VALUE="'.$myfilearray[$i].'">'.$fname.'</OPTION>';
$conv .= ' <OPTION VALUE="'.$myfilearray[$i].'">'.$fname.'</OPTION>'."\n";
}
$t->set_var("lang_cancel",lang("Cancel"));
$t->set_var("lang_cat",lang("Select Category"));
$t->set_var("cat_id",cat_option($cat_id,'ncat_id',True));
$t->set_var("cancel_url",$phpgw->link("/addressbook/index.php"));
$t->set_var("navbar_bg",$phpgw_info["theme"]["navbar_bg"]);
$t->set_var("navbar_text",$phpgw_info["theme"]["navbar_text"]);
@ -88,7 +90,7 @@
$this->qfields = $this->stock_contact_fields;# + $extrafields;# + $customfields;
}
$buffer = $this->export_start_file($buffer);
$buffer = $this->export_start_file($buffer,$ncat_id);
for ($i=0;$i<count($this->ids);$i++) {
$buffer = $this->export_start_record($buffer);

View File

@ -85,14 +85,16 @@
var $vcard = '';
// Read full list of user's contacts only to get id's for each
function export_start_file($buffer) {
function export_start_file($buffer,$ncat_id='') {
$this->id=-1;
if ($ncat_id) { $filter = "tid=n,cat_id=".$ncat_id; }
else { $filter = "tid=n"; }
// Setup the contact and vcard objects, and the export fields var
$this->contacts = CreateObject('phpgwapi.contacts');
$this->vcard = CreateObject("phpgwapi.vcard");
$this->export = $this->vcard->export;
$tmp = $this->contacts->read();
$tmp = $this->contacts->read('','',array('id'=>'id'),'',$filter);
for ($i=0;$i<count($tmp);$i++) {
$this->ids[$i] = $tmp[$i]['id'];
}

View File

@ -51,10 +51,13 @@
var $contacts = '';
// Read full list of user's contacts only to get id's for each
function export_start_file($buffer) {
function export_start_file($buffer,$ncat_id='') {
$this->id=-1;
if ($ncat_id) { $filter = "tid=n,cat_id=".$ncat_id; }
else { $filter = "tid=n"; }
$this->contacts = CreateObject('phpgwapi.contacts');
$tmp = $this->contacts->read();
$tmp = $this->contacts->read('','',array('id'=>'id'),'',$filter);
for ($i=0;$i<count($tmp);$i++) {
$this->ids[$i] = $tmp[$i]['id'];
}

View File

@ -68,10 +68,13 @@
// This will store the contacts object
var $contacts = '';
function export_start_file($buffer) {
function export_start_file($buffer,$ncat_id='') {
$this->id=-1;
if ($ncat_id) { $filter = "tid=n,cat_id=".$ncat_id; }
else { $filter = "tid=n"; }
$this->contacts = CreateObject('phpgwapi.contacts');
$tmp = $this->contacts->read();
$tmp = $this->contacts->read('','',array('id'=>'id'),'',$filter);
for ($i=0;$i<count($tmp);$i++) {
$this->ids[$i] = $tmp[$i]['id'];
}

View File

@ -63,10 +63,13 @@
var $contacts = '';
// Read full list of user's contacts only to get id's for each
function export_start_file($buffer) {
function export_start_file($buffer,$ncat_id='') {
$this->id=-1;
if ($ncat_id) { $filter = "tid=n,cat_id=".$ncat_id; }
else { $filter = "tid=n"; }
$this->contacts = CreateObject('phpgwapi.contacts');
$tmp = $this->contacts->read();
$tmp = $this->contacts->read('','',array('id'=>'id'),'',$filter);
for ($i=0;$i<count($tmp);$i++) {
$this->ids[$i] = $tmp[$i]['id'];
}

View File

@ -85,10 +85,13 @@
var $contacts = '';
// Read full list of user's contacts only to get id's for each
function export_start_file($buffer) {
function export_start_file($buffer,$ncat_id='') {
$this->id=-1;
if ($ncat_id) { $filter = "tid=n,cat_id=".$ncat_id; }
else { $filter = "tid=n"; }
$this->contacts = CreateObject('phpgwapi.contacts');
$tmp = $this->contacts->read();
$tmp = $this->contacts->read('','',array('id'=>'id'),'',$filter);
for ($i=0;$i<count($tmp);$i++) {
$this->ids[$i] = $tmp[$i]['id'];
}

View File

@ -84,10 +84,13 @@
var $contacts = '';
// Read full list of user's contacts only to get id's for each
function export_start_file($buffer) {
function export_start_file($buffer,$ncat_id='') {
$this->id=-1;
if ($ncat_id) { $filter = "tid=n,cat_id=".$ncat_id; }
else { $filter = "tid=n"; }
$this->contacts = CreateObject('phpgwapi.contacts');
$tmp = $this->contacts->read();
$tmp = $this->contacts->read('','',array('id'=>'id'),'',$filter);
for ($i=0;$i<count($tmp);$i++) {
$this->ids[$i] = $tmp[$i]['id'];
}

View File

@ -8,36 +8,27 @@
</TR>
<TR>
<TD>
<TABLE WIDTH=85%>
<TR>
<TD><FORM ENCTYPE="multipart/form-data" action="{action_url}" method="post">
<FORM ENCTYPE="multipart/form-data" action="{action_url}" method="POST">
<OL>
<LI>Select the type of conversion (Debug will display output in browser.):<BR>
<LI>Select the type of conversion:
<SELECT NAME="conv_type">
<OPTION VALUE="none">&lt;none&gt;</OPTION>
{conv}
</SELECT><P></LI>
<LI>{filename}:
<INPUT NAME="tsvfilename" VALUE="conversion.txt"></LI>
{conv} </SELECT><P></LI>
<LI>{filename}:<INPUT NAME="tsvfilename" VALUE="export.txt"></LI>
<LI>{lang_cat}:{cat_id}</LI>
<LI><INPUT NAME="download" TYPE="checkbox" checked>Download export file (Uncheck to debug output in browser)</LI>
<LI><INPUT NAME="convert" TYPE="submit" VALUE="{download}"></LI>
</OL>
</FORM></TD>
</TR>
</TABLE>
</FORM>
</TD>
</TR>
<TR>
<TD>
<FORM action="{cancel_url}" method="post">
<INPUT type="submit" name="Cancel" value="{lang_cancel}">
</FORM>
</TD>
</TR>
<tr>
<td width="8%">
<div align="left">
<form action="{cancel_url}" method="post">
<input type="submit" name="Cancel" value="{lang_cancel}">
</form>
</div>
</td>
<td width="64%">&nbsp;</td>
<td width="32">&nbsp;</td>
</tr>
</TABLE>
</CENTER>
<!-- END import -->