From: Steve Sutton Date: Tue, 29 Jul 2014 17:36:04 +0000 (-0400) Subject: Update contact for their table schema X-Git-Tag: v1.0.5^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=53aa1b4502587717f083b801cbce3bc81ed5f0b7;p=web%2FBigFore.git Update contact for their table schema They have different schema for contact table. some updates needed to search correctly. --- diff --git a/Toolkit/Contacts/config.ini b/Toolkit/Contacts/config.ini index 9f64955..94d4e6f 100644 --- a/Toolkit/Contacts/config.ini +++ b/Toolkit/Contacts/config.ini @@ -8,7 +8,7 @@ primarykey = "id" sequence = "contact_id_seq" [contact_types] -1 = "Web Contact" +;1 = "Web Contact" 2 = "E-News" ;3 = "Travel Planner" ;4 = "Visitor Guide" diff --git a/admin/Contact/contact_setup.inc b/admin/Contact/contact_setup.inc index c59784f..b3b704b 100755 --- a/admin/Contact/contact_setup.inc +++ b/admin/Contact/contact_setup.inc @@ -1,102 +1,101 @@ -* @copyright 2009 Steve Sutton -* @license Gaslight Media -* @version CVS: $Id: contact_setup.inc,v 1.7 2010/05/13 17:05:53 matrix Exp $ -* @link <> -*/ + * contact_setup.phtml + * + * Config setting for the admin contact application + * + * PHP versions 4 and 5 + * + * @category Toolkit + * @package Contacts + * @author Steve Sutton + * @copyright 2009 Steve Sutton + * @license Gaslight Media + * @version CVS: $Id: contact_setup.inc,v 1.7 2010/05/13 17:05:53 matrix Exp $ + * @link <> + */ extract($_REQUEST); // The Contact Type array is now is one location and is used by the // Toolkit_Contacts_Admin_EditContact class -$conf = new Config; -$contactRoot =& $conf->parseConfig( - BASE . 'Toolkit/Contacts/config.ini', - 'IniFile' +$conf = new Config; +$contactRoot = & $conf->parseConfig( + BASE . 'Toolkit/Contacts/config.ini', 'IniFile' ); if (!defined("ENTRIES_PER_PAGE")) { /** - * how many per page on list contacts - */ + * how many per page on list contacts + */ define("ENTRIES_PER_PAGE", 10); // Entries per Page in list_contact.phtml } /** -* define for customer table -*/ + * define for customer table + */ define("CUSTOMER_TABLE", "customer"); // name of customer table /** -* define for contact table -*/ + * define for contact table + */ define("CONTACT_TABLE", "contact"); // name of contact table $table = $contactRoot->getItem('section', 'conf') ->getItem('directive', 'table') ->getContent(); /** -* Table to user in db -*/ + * Table to user in db + */ define("TABLE", $table); // which table to use /** -* postgres date formate -*/ + * postgres date formate + */ define("DATEFORMAT", "US"); // date format (for edit_contact.phmtl) /** -* template for the newsletter -*/ + * template for the newsletter + */ define("NEWSLETTER_PROTOTYPE", "newsletter_template.html"); // date format (for edit_contact.phmtl) /** -* class_template needed for GLM_TEMPLATE::get_seo_url() -*/ -require_once BASE.'classes/class_template.inc'; + * class_template needed for GLM_TEMPLATE::get_seo_url() + */ +require_once BASE . 'classes/class_template.inc'; $DB = new GLM_DB(); if (!defined("HTML_EMAIL")) { /** - * HTML_EMAIL = ON or OFF - */ + * HTML_EMAIL = ON or OFF + */ define("HTML_EMAIL", "ON"); } if (!defined("PRODUCTION_MODE")) { /** - * PRODUCTION_MODE off/on mail sent - */ + * PRODUCTION_MODE off/on mail sent + */ define("PRODUCTION_MODE", "ON"); } if (!defined("NEWSLETTER")) { /** - * NEWSLETTER 1 or true will allow newsletters - */ + * NEWSLETTER 1 or true will allow newsletters + */ define("NEWSLETTER", 1); //bool- does the contact database mail out a newsletter? } if (!function_exists("template_read")) { /** - * Short description for function - * - * Long description (if any) ... - * - * @param unknown $template Parameter description (if any) ... - * - * @return string Return description (if any) ... - */ + * Short description for function + * + * Long description (if any) ... + * + * @param unknown $template Parameter description (if any) ... + * + * @return string Return description (if any) ... + */ function template_read($template) { $fp = fopen($template, "r"); @@ -108,21 +107,21 @@ if (!function_exists("template_read")) { return ""; } } + } // {{{ array_insert() - /** -* insert an array into another array after position. -* You can specify an associative array key or index key -* to dictact the positioning of the new array -* -* @param array &$array array to be used -* @param unknown $position position to add array -* @param unknown $insert_array array to be inserted -* -* @return void -*/ + * insert an array into another array after position. + * You can specify an associative array key or index key + * to dictact the positioning of the new array + * + * @param array &$array array to be used + * @param unknown $position position to add array + * @param unknown $insert_array array to be inserted + * + * @return void + */ function array_insert(&$array, $position, $insert_array) { if (!is_int($position)) { @@ -136,85 +135,89 @@ function array_insert(&$array, $position, $insert_array) } } $first_array = array_splice($array, 0, $position); - $array = array_merge($first_array, $insert_array, $array); + $array = array_merge($first_array, $insert_array, $array); } + // }}} // {{{ explode_template() if (!function_exists("explode_template")) { /** - * Short description for function - * - * Long description (if any) ... - * - * @param unknown $template Parameter description (if any) ... - * @param unknown $data Parameter description (if any) ... - * - * @return unknown Return description (if any) ... - */ + * Short description for function + * + * Long description (if any) ... + * + * @param unknown $template Parameter description (if any) ... + * @param unknown $data Parameter description (if any) ... + * + * @return unknown Return description (if any) ... + */ function explode_template($template, $data) { $template = template_read($template); $output = template_replacement($template, $data); $output = wordwrap($output, 72); return $output; - } + } // }}} // {{{ template_replacement($template, $fieldarr) if (!function_exists("template_replacement")) { /** - * Short description for function - * - * Long description (if any) ... - * - * @param unknown $template Parameter description (if any) ... - * @param array $fieldarr Parameter description (if any) ... - * - * @return unknown Return description (if any) ... - */ + * Short description for function + * + * Long description (if any) ... + * + * @param unknown $template Parameter description (if any) ... + * @param array $fieldarr Parameter description (if any) ... + * + * @return unknown Return description (if any) ... + */ function template_replacement($template, $fieldarr) { if (is_array($fieldarr)) { foreach ($fieldarr as $key => $value) { - $template = str_replace("", $value, $template); + $template = str_replace("", $value, + $template); } } return $template; } + } // }}} // {{{ add_image($image, $align) if (!function_exists("add_image")) { /** - * Short description for function - * - * Long description (if any) ... - * - * @param string $image Parameter description (if any) ... - * @param string $align Parameter description (if any) ... - * - * @return string Return description (if any) ... - */ + * Short description for function + * + * Long description (if any) ... + * + * @param string $image Parameter description (if any) ... + * @param string $align Parameter description (if any) ... + * + * @return string Return description (if any) ... + */ function add_image($image, $align) { if ($image != "") { - return '
'; + return '
'; } } + } // }}} // {{{ Navigation array $nav = array( - "Report Builder" => "index.phtml", - "Add Contact" => "edit_contact.php", - "List Contacts" => "list_contact.phtml", - "Contact Inquiry Fields" => "contact_inquiry.phtml", - "HTML Emails" => "emails.php", - "Saved Reports" => "list_query.phtml", + "Report Builder" => "index.phtml", + "Add Contact" => "edit_contact.php", + "List Contacts" => "list_contact.phtml", + "Discovery Fields" => "contact_inquiry.phtml", + "HTML Emails" => "emails.php", + "Saved Reports" => "list_query.phtml", ); // }}} $discover = array('' => "Don't Care"); @@ -223,94 +226,114 @@ $query = "select * from contact_inq order by pos;"; $cData = $DB->db_auto_get_data($query); if (is_array($cData)) { foreach ($cData as $key => $value) { - $int_array[$value['id']] = $value['header']; + $int_array[$value['id']] = $value['header']; $discover[$value['header']] = $value['header']; } } -$contactTypesSetup = - $contactRoot->getItem('section', 'contact_types') +$contactTypesSetup = $contactRoot->getItem('section', 'contact_types') ->toArray(); -$cType = $contactTypesSetup['contact_types']; +$cType = $contactTypesSetup['contact_types']; // {{{ search_where($name, $search_where) /** -* Short description for function -* -* Long description (if any) ... -* -* @param string $name Parameter description (if any) ... -* @param string $search_where Parameter description (if any) ... -* -* @return string Return description (if any) ... -*/ + * Short description for function + * + * Long description (if any) ... + * + * @param string $name Parameter description (if any) ... + * @param string $search_where Parameter description (if any) ... + * + * @return string Return description (if any) ... + */ function search_where($name, $search_where) { $out = ' - +