diff --git a/addressbook/index.php b/addressbook/index.php index b3ad130650..2c79c9ff43 100755 --- a/addressbook/index.php +++ b/addressbook/index.php @@ -82,7 +82,7 @@ - '.$phpgw->common->check_owner($myowner,"edit.php",lang("edit"),"ab_id=".$myid."&start=".$start."&sort=".$sort."&order=".$order).' + '.$phpgw->common->check_owner($myowner,"edit.php",lang("edit"),"ab_id=".$myid."&start=".$start."&sort=".$sort."&order=".$order."&query=".$query."&sort=".$sort).' diff --git a/addressbook/oldadd.php b/addressbook/oldadd.php deleted file mode 100755 index 6fdf2e3693..0000000000 --- a/addressbook/oldadd.php +++ /dev/null @@ -1,135 +0,0 @@ - * - * -------------------------------------------- * - * This program is free software; you can redistribute it and/or modify it * - * under the terms of the GNU General Public License as published by the * - * Free Software Foundation; either version 2 of the License, or (at your * - * option) any later version. * - \**************************************************************************/ - - /* $Id$ */ - - if ($submit || $AddVcard) { - $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True); - } - - $phpgw_info["flags"]["currentapp"] = "addressbook"; - $phpgw_info["flags"]["enable_addressbook_class"] = True; - include("../header.inc.php"); - - - if ($AddVcard){ - Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . - "/addressbook/vcardin.php")); - } - else if ($add_email) { - list($fields["firstname"],$fields["lastname"]) = explode(" ", $name); - $fields["email"] = $add_email; - form("","add.php","Add",$fields); - } else if (! $submit && ! $add_email) { - form("","add.php","Add","","",""); - } else { - if (! $bday_month && ! $bday_day && ! $bday_year) { - $bday = ""; - } else { - $bday = "$bday_month/$bday_day/$bday_year"; - } - - if ($access != "private" && $access != "public") { - $access = $phpgw->accounts->array_to_string($access,$n_groups); - } - - if ($url == "http://") { - $url = ""; - } - - if ($phpgw_info["apps"]["timetrack"]["enabled"]) { - $sql = "insert into addressbook (ab_owner,ab_access,ab_firstname,ab_lastname,ab_title,ab_email," - . "ab_hphone,ab_wphone,ab_fax,ab_pager,ab_mphone,ab_ophone,ab_street,ab_address2,ab_city," - . "ab_state,ab_zip,ab_bday," - . "ab_notes,ab_company_id,ab_url) values ('" . $phpgw_info["user"]["account_id"] . "','$access','" - . addslashes($firstname). "','" - . addslashes($lastname) . "','" - . addslashes($title) . "','" - . addslashes($email) . "','" - . addslashes($hphone) . "','" - . addslashes($wphone) . "','" - . addslashes($fax) . "','" - . addslashes($pager) . "','" - . addslashes($mphone) . "','" - . addslashes($ophone) . "','" - . addslashes($street) . "','" - . addslashes($address2) . "','" - . addslashes($city) . "','" - . addslashes($state) . "','" - . addslashes($zip) . "','" - . addslashes($bday) . "','" - . addslashes($notes) . "','" - . addslashes($company) . "','" - . addslashes($url) . "')"; - } else { - $sql = "insert into addressbook (ab_owner,ab_access,ab_firstname,ab_lastname,ab_title,ab_email," - . "ab_hphone,ab_wphone,ab_fax,ab_pager,ab_mphone,ab_ophone,ab_street,ab_address2,ab_city," - . "ab_state,ab_zip,ab_bday," - . "ab_notes,ab_company,ab_url) values ('" . $phpgw_info["user"]["account_id"] . "','$access','" - . addslashes($firstname). "','" - . addslashes($lastname) . "','" - . addslashes($title) . "','" - . addslashes($email) . "','" - . addslashes($hphone) . "','" - . addslashes($wphone) . "','" - . addslashes($fax) . "','" - . addslashes($pager) . "','" - . addslashes($mphone) . "','" - . addslashes($ophone) . "','" - . addslashes($street) . "','" - . addslashes($address2) . "','" - . addslashes($city) . "','" - . addslashes($state) . "','" - . addslashes($zip) . "','" - . addslashes($bday) . "','" - . addslashes($notes) . "','" - . addslashes($company) . "','" - . addslashes($url) . "')"; - } - $phpgw->db->query($sql); - - Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/addressbook/", - "cd=14")); - } - -?> - - - - - - -
- - - - - - - - -
- "> - - "> - - " . lang("Cancel"); ?> -
-
- - - - - -common->phpgw_footer(); -?> \ No newline at end of file diff --git a/addressbook/olddelete.php b/addressbook/olddelete.php deleted file mode 100755 index 0e3da1c0e6..0000000000 --- a/addressbook/olddelete.php +++ /dev/null @@ -1,53 +0,0 @@ - * - * -------------------------------------------- * - * This program is free software; you can redistribute it and/or modify it * - * under the terms of the GNU General Public License as published by the * - * Free Software Foundation; either version 2 of the License, or (at your * - * option) any later version. * - \**************************************************************************/ - - /* $Id$ */ - - if ($confirm) { - $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True); - } - - $phpgw_info["flags"]["currentapp"] = "addressbook"; - $phpgw_info["flags"]["enable_addressbook_class"] = True; - include("../header.inc.php"); - - if (! $ab_id) { - Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/addressbook/")); - } - - if ($confirm != "true") { - $phpgw->db->query("select ab_owner from addressbook where ab_id='$ab_id'"); - $phpgw->db->next_record(); - - if ($phpgw->db->f("ab_owner") != $phpgw_info["user"]["account_id"]) - Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/addressbook/")); - - ?> - -
-
">         - ">
- common->phpgw_footer(); - - } else { - - $phpgw->db->query("delete from addressbook where ab_owner='" . $phpgw_info["user"]["account_id"] - . "' and ab_id='$ab_id'"); - Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"]. "/addressbook/", - "cd=16&order=$order&sort=$sort&filter=$filter&start=$start&query=$query")); - } -?> - diff --git a/addressbook/oldedit.php b/addressbook/oldedit.php deleted file mode 100755 index 905fd4d05b..0000000000 --- a/addressbook/oldedit.php +++ /dev/null @@ -1,159 +0,0 @@ - * - * -------------------------------------------- * - * This program is free software; you can redistribute it and/or modify it * - * under the terms of the GNU General Public License as published by the * - * Free Software Foundation; either version 2 of the License, or (at your * - * option) any later version. * - \**************************************************************************/ - - /* $Id$ */ - - if ($submit || ! $ab_id) { - $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True); - } - - $phpgw_info["flags"]["currentapp"] = "addressbook"; - $phpgw_info["flags"]["enable_addressbook_class"] = True; - include("../header.inc.php"); - - if (! $ab_id) { - Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"]. "/addressbook/", - "cd=16&order=$order&sort=$sort&filter=$filter&start=$start&query=$query")); - $phpgw->common->phpgw_exit(); - } - - if (! $submit) { - $phpgw->db->query("SELECT * FROM addressbook WHERE ab_owner='" - . $phpgw_info["user"]["account_id"] . "' AND ab_id=$ab_id"); - $phpgw->db->next_record(); - - $fields = array('ab_id' => $phpgw->db->f("ab_id"), - 'owner' => $phpgw->db->f("ab_owner"), - 'access' => $phpgw->db->f("ab_access"), - 'firstname' => $phpgw->db->f("ab_firstname"), - 'lastname' => $phpgw->db->f("ab_lastname"), - 'title' => $phpgw->db->f("ab_title"), - 'email' => $phpgw->db->f("ab_email"), - 'hphone' => $phpgw->db->f("ab_hphone"), - 'wphone' => $phpgw->db->f("ab_wphone"), - 'fax' => $phpgw->db->f("ab_fax"), - 'pager' => $phpgw->db->f("ab_pager"), - 'mphone' => $phpgw->db->f("ab_mphone"), - 'ophone' => $phpgw->db->f("ab_ophone"), - 'street' => $phpgw->db->f("ab_street"), - 'address2' => $phpgw->db->f("ab_address2"), - 'city' => $phpgw->db->f("ab_city"), - 'state' => $phpgw->db->f("ab_state"), - 'zip' => $phpgw->db->f("ab_zip"), - 'bday' => $phpgw->db->f("ab_bday"), - 'company' => $phpgw->db->f("ab_company"), - 'company_id' => $phpgw->db->f("ab_company_id"), - 'notes' => $phpgw->db->f("ab_notes") -, - 'url' => $phpgw->db->f("ab_url") - ); - - form("","edit.php","Edit",$fields); - - } else { - if ($url == "http://") { - $url = ""; - } - - if (! $bday_month && ! $bday_day && ! $bday_year) { - $bday = ""; - } else { - $bday = "$bday_month/$bday_day/$bday_year"; - } - - if ($access != "private" && $access != "public") { - $access = $phpgw->accounts->array_to_string($access,$n_groups); - } - - if($phpgw_info["apps"]["timetrack"]["enabled"]) { - $sql = "UPDATE addressbook set ab_email='" . addslashes($email) - . "', ab_firstname='" . addslashes($firstname) - . "', ab_lastname='" . addslashes($lastname) - . "', ab_title='" . addslashes($title) - . "', ab_hphone='" . addslashes($hphone) - . "', ab_wphone='" . addslashes($wphone) - . "', ab_fax='" . addslashes($fax) - . "', ab_pager='" . addslashes($pager) - . "', ab_mphone='" . addslashes($mphone) - . "', ab_ophone='" . addslashes($ophone) - . "', ab_street='" . addslashes($street) - . "', ab_address2='" . addslashes($address2) - . "', ab_city='" . addslashes($city) - . "', ab_state='" . addslashes($state) - . "', ab_zip='" . addslashes($zip) - . "', ab_bday='" . addslashes($bday) - . "', ab_notes='" . addslashes($notes) - . "', ab_company_id='" . addslashes($company) - . "', ab_access='" . addslashes($access) - . "', ab_url='" . addslashes($url) - . "' WHERE ab_owner='" . $phpgw_info["user"]["account_id"] . "' AND ab_id=$ab_id"; - } else { - $sql = "UPDATE addressbook set ab_email='" . addslashes($email) - . "', ab_firstname='". addslashes($firstname) - . "', ab_lastname='" . addslashes($lastname) - . "', ab_title='" . addslashes($title) - . "', ab_hphone='" . addslashes($hphone) - . "', ab_wphone='" . addslashes($wphone) - . "', ab_fax='" . addslashes($fax) - . "', ab_pager='" . addslashes($pager) - . "', ab_mphone='" . addslashes($mphone) - . "', ab_ophone='" . addslashes($ophone) - . "', ab_street='" . addslashes($street) - . "', ab_address2='" . addslashes($address2) - . "', ab_city='" . addslashes($city) - . "', ab_state='" . addslashes($state) - . "', ab_zip='" . addslashes($zip) - . "', ab_bday='" . addslashes($bday) - . "', ab_notes='" . addslashes($notes) - . "', ab_company='" . addslashes($company) - . "', ab_access='" . addslashes($access) - . "', ab_url='" . addslashes($url) - . "' WHERE ab_owner='" . $phpgw_info["user"]["account_id"] . "' AND ab_id=$ab_id"; - } - - $phpgw->db->query($sql); - - Header("Location: " . $phpgw->link("view.php","&ab_id=$ab_id&order=$order&sort=$sort&filter=" - . "$filter&start=$start")); - $phpgw->common->phpgw_exit(); - } - -?> - - - - - - - - - - - - - - -
- "> - - " . lang("Cancel"); ?> - - " . lang("Delete"); ?> -
- - - - - -common->phpgw_footer(); -?> diff --git a/addressbook/oldindex.php b/addressbook/oldindex.php deleted file mode 100755 index e432d3d8cb..0000000000 --- a/addressbook/oldindex.php +++ /dev/null @@ -1,282 +0,0 @@ - * - * -------------------------------------------- * - * This program is free software; you can redistribute it and/or modify it * - * under the terms of the GNU General Public License as published by the * - * Free Software Foundation; either version 2 of the License, or (at your * - * option) any later version. * - \**************************************************************************/ - - /* $Id$ */ - - $phpgw_info["flags"] = array("currentapp" => "addressbook", "enable_addressbook_class" => True, - "enable_nextmatchs_class" => True); - include("../header.inc.php"); - - echo "
" . lang("Address book"); - //echo "
Time track = " . $phpgw_info["apps"]["timetrack"]["enabled"]; - - if (! $start) - $start = 0; - - $limit =$phpgw->nextmatchs->sql_limit($start); - - if ($order) - $ordermethod = "order by $order $sort"; - else - $ordermethod = "order by ab_lastname,ab_firstname,ab_email asc"; - - if (! $filter) { - $filter = "none"; - } - - if ($filter != "private") { - if ($filter != "none") { - $filtermethod = " ab_access like '%,$filter,%' "; - } else { - $filtermethod = " (ab_owner='" . $phpgw_info["user"]["account_id"] ."' OR ab_access='public' " - . $phpgw->accounts->sql_search("ab_access") . " ) "; - } - } else { - $filtermethod = " ab_owner='" . $phpgw_info["user"]["account_id"] . "' "; - } - - if ($query) { - if ($phpgw_info["apps"]["timetrack"]["enabled"]){ - $phpgw->db->query("SELECT count(*) " - . "from addressbook as a, customers as c where a.ab_company_id = c.company_id " - . "AND $filtermethod AND (a.ab_lastname like '" - . "%$query%' OR a.ab_firstname like '%$query%' OR a.ab_email like '%$query%' OR " - . "a.ab_street like '%$query%' OR a.ab_city like '%$query%' OR a.ab_state " - . "like '%$query%' OR a.ab_zip like '%$query%' OR a.ab_notes like " - . "'%$query%' OR c.company_name like '%$query%' OR a.ab_url like '%$query%')",__LINE__,__FILE__); -// . "'%$query%' OR c.company_name like '%$query%')" -// . " $ordermethod limit $limit"); - } else { - $phpgw->db->query("SELECT count(*) " - . "from addressbook " - . "WHERE $filtermethod AND (ab_lastname like '" - . "%$query%' OR ab_firstname like '%$query%' OR ab_email like '%$query%' OR " - . "ab_street like '%$query%' OR ab_city like '%$query%' OR ab_state " - . "like '%$query%' OR ab_zip like '%$query%' OR ab_notes like " - . "'%$query%' OR ab_company like '%$query%' OR ab_url like '%$query$%')",__LINE__,__FILE__); -// . "'%$query%' OR ab_company like '%$query%')" -// . " $ordermethod limit $limit"); - } - - $phpgw->db->next_record(); - - if ($phpgw->db->f(0) == 1) - echo "
" . lang("your search returned 1 match"); - else - echo "
" . lang("your search returned x matchs",$phpgw->db->f(0)); - } else { - $phpgw->db->query("select count(*) from addressbook where $filtermethod",__LINE__,__FILE__); - $phpgw->db->next_record(); - } - if ($phpgw_info["apps"]["timetrack"]["enabled"]) { - $company_sortorder = "c.company_name"; - } else { - $company_sortorder = "ab_company"; - } - - //$phpgw->db->next_record(); - - if ($phpgw->db->f(0) > $phpgw_info["user"]["preferences"]["common"]["maxmatchs"]) - echo "
" . lang("showing x - x of x",($start + 1), - ($start + $phpgw_info["user"]["preferences"]["common"]["maxmatchs"]),$phpgw->db->f(0)); - else - echo "
" . lang("showing x",$phpgw->db->f(0)); -?> - -nextmatchs->show("index.php",$start,$phpgw->db->f(0),"&order=$order&filter=$filter&sort=" - . "$sort&query=$query", "75%", $phpgw_info["theme"]["th_bg"]); -?> - - - "> - '; - echo ''; - echo $phpgw->nextmatchs->show_sort_order($sort,"ab_" . $column[0],$order,"index.php",lang($column[1])); - echo ''; - echo "\n"; - - // To be used when displaying the rows - $columns_to_display[$column[0]] = True; - } - } - ?> - - - - - - - -db->query("SELECT a.ab_id,a.ab_owner,a.ab_firstname,a.ab_lastname,a.ab_company_id," - . "a.ab_email,a.ab_wphone,c.company_name,a.ab_hphone,a.ab_fax,a.ab_mphone " - . "from addressbook as a, customers as c where a.ab_company_id = c.company_id " - . "AND $filtermethod AND (a.ab_lastname like '" - . "%$query%' OR a.ab_firstname like '%$query%' OR a.ab_email like '%$query%' OR " - . "a.ab_street like '%$query%' OR a.ab_city like '%$query%' OR a.ab_state " - . "like '%$query%' OR a.ab_zip like '%$query%' OR a.ab_notes like " - . "'%$query%' OR c.company_name like '%$query%') $ordermethod limit $limit",__LINE__,__FILE__); - } else { - $phpgw->db->query("SELECT * from addressbook WHERE $filtermethod AND (ab_lastname like '" - . "%$query%' OR ab_firstname like '%$query%' OR ab_email like '%$query%' OR " - . "ab_street like '%$query%' OR ab_city like '%$query%' OR ab_state " - . "like '%$query%' OR ab_zip like '%$query%' OR ab_notes like " - . "'%$query%' OR ab_company like '%$query%') $ordermethod limit $limit",__LINE__,__FILE__); - } - } else { - if ($phpgw_info["apps"]["timetrack"]["enabled"]){ - $phpgw->db->query("SELECT a.ab_id,a.ab_owner,a.ab_firstname,a.ab_lastname," - . "a.ab_email,a.ab_wphone,c.company_name " - . "from addressbook as a, customers as c where a.ab_company_id = c.company_id " - . "AND $filtermethod $ordermethod limit $limit",__LINE__,__FILE__); - } else { - $phpgw->db->query("SELECT * from addressbook WHERE $filtermethod $ordermethod limit $limit",__LINE__,__FILE__); - } - } // else $query - - while ($phpgw->db->next_record()) { - $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color); - echo ''; - - $ab_id = $phpgw->db->f("ab_id"); - - while ($column = each($columns_to_display)) { - if ($column[0] == "company") { - if ($phpgw_info["apps"]["timetrack"]["enabled"]) { - $field = $phpgw->db->f("company_name"); - } else { - $field = $phpgw->db->f("ab_company"); - } - } else { - $field = $phpgw->db->f("ab_" . $column[0]); - } - -/* - while ($column = each($columns_to_display)) { - if ($phpgw_info["apps"]["timetrack"]["enabled"]) { - if ($column[0] == "company") { - $field = $phpgw->db->f("company_name"); - } else { - $field = $phpgw->db->f("ab_company"); - } - } else { - $field = $phpgw->db->f("ab_" . $column[0]); - } */ - - $field = htmlentities($field); - - // Some fields require special formating. - if ($column[0] == "url") { - if (! ereg("^http://",$field)) { - $data = "http://" . $field; - } - echo ''; - } else if ($column[0] == "email") { - if ($phpgw_info["user"]["apps"]["email"]) { - echo ''; - } else { - echo ''; - } - } else { - echo ''; - } - - } - reset($columns_to_display); // If we don't reset it, our inside while won't loop - ?> - - - - - -
- - - - - - Vcard - - - - - -
' - . '' . $field. ' ' - . '' . $field . ' ' - . '' . $field. ' ' - . $field . '  - " size="2"> - "> - - - " size=2> - ">Vcard - - - " size="2"> - common->check_owner($phpgw->db->f("ab_owner"),"edit.php",lang("edit"),"ab_id=" . $phpgw->db->f("ab_id")); ?> - -
- -
"> - - - - - - - - - - - - - - - - - - - - -
-
- "> -
-
-
- -
-
  
-
-
- -common->phpgw_footer(); -?> diff --git a/addressbook/oldview.php b/addressbook/oldview.php deleted file mode 100755 index fc9d84970f..0000000000 --- a/addressbook/oldview.php +++ /dev/null @@ -1,141 +0,0 @@ - * - * -------------------------------------------- * - * This program is free software; you can redistribute it and/or modify it * - * under the terms of the GNU General Public License as published by the * - * Free Software Foundation; either version 2 of the License, or (at your * - * option) any later version. * - \**************************************************************************/ - - /* $Id$ */ - - if ($submit || ! $ab_id) { - $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True); - } - - $phpgw_info["flags"]["currentapp"] = "addressbook"; - $phpgw_info["flags"]["enable_addressbook_class"] = True; - include("../header.inc.php"); - - function checkfor_specialformat($field,$data) - { - global $phpgw_info, $phpgw; - - if ($field == "email") { - if ($phpgw_info["user"]["apps"]["email"]) { - $s = '' . $data . ''; - } else { - $s = '' . $data . ''; - } - } else if ($field == "URL") { - if (! ereg("^http://",$data)) { - $data = "http://" . $data; - } - $s = '' . $data . ''; - } else if ($field == "birthday") { - $date = explode("/",$data); - $s = $phpgw->common->dateformatorder($date[2],$date[1],$date[0],True); - } else { - $s = $data . " "; - } - return $s; - } - - if (! $ab_id) { - Header("Location: " . $phpgw->link("index.php")); - } - - if ($filter != "private") { - $filtermethod = " or ab_access='public' " . $phpgw->accounts->sql_search("ab_access"); - } - - if ($phpgw_info["apps"]["timetrack"]["enabled"]) { - $phpgw->db->query("SELECT * FROM addressbook as a, customers as c WHERE a.ab_company_id = c.company_id " - . "AND ab_id=$ab_id AND (ab_owner='" - . $phpgw_info["user"]["account_id"] . "' $filtermethod)"); - } else { - $phpgw->db->query("SELECT * FROM addressbook WHERE ab_id=$ab_id AND (ab_owner='" - . $phpgw_info["user"]["account_id"] . "' $filtermethod)"); - } - $phpgw->db->next_record(); - - echo "

 " . lang("Address book - view") . "


"; - - $i = 0; - while ($column = each($abc)) { - if ($phpgw->db->f("ab_" . $column[0])) { - $columns_to_display[$i]["field_name"] = $column[1]; - $columns_to_display[$i]["field_value"] = $phpgw->db->f("ab_" . $column[0]); - $i++; - } - } - - if ($phpgw->db->f("ab_notes")) { - $columns_to_display[$i]["field_name"] = "Notes"; - $columns_to_display[$i]["field_value"] = $phpgw->db->f("ab_notes"); - } - - echo ''; - for ($i=0;$i<200;) { // The $i<200 is only used for a brake - if (! $columns_to_display[$i]["field_name"]) break; - - $columns_html .= "" - . ""; - - $i++; - - if (! $columns_to_display[$i]["field_name"]) break; - - $columns_html .= "" - . ""; - - $i++; - $columns_html .= ""; - } - $access = $phpgw->db->f("ab_access"); - $owner = $phpgw->db->f("ab_owner"); - $ab_id = $phpgw->db->f("ab_id"); - - echo $columns_html . ''; - echo "
" . lang($columns_to_display[$i]["field_name"]) . ":" . checkfor_specialformat($columns_to_display[$i]["field_name"],$columns_to_display[$i]["field_value"]) - . "
" . lang($columns_to_display[$i]["field_name"]) . ":" . checkfor_specialformat($columns_to_display[$i]["field_name"],$columns_to_display[$i]["field_value"]) - . "
 
" . lang("Record owner") . "" - . $phpgw->common->grab_owner_name($owner) . "" - . lang("Record Access") . ""; - - if ($access != "private" && $access != "public") { - echo lang("Group access") . " - " . $phpgw->accounts->convert_string_to_names_access($access); - } else { - echo $access; - } - - echo "
"; -?> - - - - - - - -
- common->check_owner($owner,"edit.php","Edit","ab_id=$ab_id"); - ?> - -
" method="post" name="Vcardform"> - -
-
-
" method="post" name="Doneform"> - -
-
- -common->phpgw_footer(); -?>