|
From: Verdon V. <ve...@us...> - 2008-07-07 13:30:39
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/class In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15927/class Modified Files: RDX_Feature.php RDX_Forms.php RDX_Location.php RDX_Member.php Rolodex.php Log Message: 1.0 cleanup Index: RDX_Feature.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Feature.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RDX_Feature.php 24 Jun 2008 11:23:27 -0000 1.4 --- RDX_Feature.php 7 Jul 2008 13:30:15 -0000 1.5 *************** *** 130,174 **** - function view() - { - if (!$this->id) { - PHPWS_Core::errorPage(404); - } - - Layout::addPageTitle($this->getTitle()); - $template['TITLE'] = $this->getTitle(true); - $template['DESCRIPTION'] = PHPWS_Text::parseTag($this->getDescription(true)); - $template['IMAGE'] = $this->getFile(); - - if (Current_User::allow('rolodex', 'settings')) { - $vars['feature'] = $this->id; - $vars['aop'] = 'edit_feature'; - MiniAdmin::add('rolodex', array(PHPWS_Text::secureLink(dgettext('rolodex', 'Edit feature'), 'rolodex', $vars))); - } - - if (Current_User::allow('rolodex', 'settings')) { - $vars2['aop'] = 'menu'; - $vars2['tab'] = 'features'; - MiniAdmin::add('rolodex', array(PHPWS_Text::secureLink(dgettext('rolodex', 'List all features'), 'rolodex', $vars2))); - } - - $template['FEATURE_LINKS'] = $this->featureLinks(); - - $members = $this->getAllMembers(true); - if (PHPWS_Error::logIfError($members)) { - $this->rolodex->content = dgettext('rolodex', 'An error occurred when accessing this feature\'s members.'); - return; - } - if ($members) { - foreach ($members as $member) { - $template['current-members'][] = $member->viewTpl(); - } - } - - return PHPWS_Template::process($template, 'rolodex', 'view_feature.tpl'); - - } - - function delete() { --- 130,133 ---- *************** *** 187,245 **** - function getAllMembers($limit=false) - { - PHPWS_Core::initModClass('rolodex', 'RDX_Member.php'); - - $db = new PHPWS_DB('rolodex_member'); - $db->addColumn('rolodex_feature_items.*'); - $db->addColumn('rolodex_member.*'); - $db->addColumn('demographics.*'); - $db->addWhere('rolodex_member.user_id', 'rolodex_feature_items.member_id'); - $db->addWhere('rolodex_feature_items.feature_id', $this->id); - $db->addWhere('rolodex_member.user_id', 'demographics.user_id'); - - /* approved yes/no */ - if (isset($approved)) { - $addWhere('active', $approved); - } - - /* expired yes/no */ - if (PHPWS_Settings::get('rolodex', 'enable_expiry')) { - if ($expired) { - $addWhere('date_expires', mktime(), '<='); - } else { - $addWhere('date_expires', mktime(), '>='); - } - } - - /* make sure only unrestricted users see inactive members */ - if (!Current_User::isUnrestricted('rolodex')) { - $db->addWhere('active', 1); - } - - /* set the default sort order and title column sort */ - if (PHPWS_Settings::get('rolodex', 'sortby')) { - $sortby = 'demographics.last_name'; - // $db->joinResult('user_id', 'demographics', 'user_id', 'last_name', 'title'); - } else { - $sortby = 'demographics.business_name'; - // $db->joinResult('user_id', 'demographics', 'user_id', 'business_name', 'title'); - } - - /* deal with privacy levels */ - if (!$_SESSION['User']->id) { - $db->addWhere('rolodex_member.privacy', 0); - } elseif (!Current_User::allow('rolodex', 'view_privates')) { - $db->addWhere('rolodex_member.privacy', 1, '<='); - } - - /* the default sort order */ - $db->addOrder($sortby, 'asc', true); - - $result = $db->getObjects('Rolodex_Member'); - return $result; - } - - function rowTag() { --- 146,149 ---- Index: RDX_Forms.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Forms.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** RDX_Forms.php 6 Jul 2008 13:05:17 -0000 1.16 --- RDX_Forms.php 7 Jul 2008 13:30:15 -0000 1.17 *************** *** 352,356 **** // $ptags['CLEAR_FILTERS'] = '<input type="radio" name="clearFilters" value="1" checked="checked" />' . dgettext('rolodex', 'Clear filters or'); // $ptags['CLEAR_FILTERS'] .= ' <input type="radio" name="clearFilters" value="0" />' . dgettext('rolodex', 'Search within results'); ! $ptags['CLEAR_FILTERS'] = dgettext('rolodex', 'Clears filters and searches all records.'); $pager->addPageTags($ptags); --- 352,360 ---- // $ptags['CLEAR_FILTERS'] = '<input type="radio" name="clearFilters" value="1" checked="checked" />' . dgettext('rolodex', 'Clear filters or'); // $ptags['CLEAR_FILTERS'] .= ' <input type="radio" name="clearFilters" value="0" />' . dgettext('rolodex', 'Search within results'); ! if (isset($ptags['ITEM_TITLE'])) { ! $ptags['CLEAR_FILTERS'] = sprintf(dgettext('rolodex', 'Search within %s.'), $ptags['ITEM_TITLE']); ! } else { ! $ptags['CLEAR_FILTERS'] = dgettext('rolodex', 'Clears filters and searches all records.'); ! } $pager->addPageTags($ptags); *************** *** 634,676 **** $form->setLabel('use_captcha', dgettext('rolodex', 'Use graphical confirmation on contact form (CAPTCHA)')); ! $form->addRadio('list_address', array(0, 1, 2)); ! $form->setLabel('list_address', array(dgettext('rolodex', 'None'), dgettext('rolodex', 'Business'), dgettext('rolodex', 'Home'))); $form->setMatch('list_address', PHPWS_Settings::get('rolodex', 'list_address')); - $form->addRadio('browse_address', array(0, 1, 2)); - $form->setLabel('browse_address', array(dgettext('rolodex', 'None'), dgettext('rolodex', 'Business'), dgettext('rolodex', 'Home'))); - $form->setMatch('browse_address', PHPWS_Settings::get('rolodex', 'browse_address')); - $form->addCheckbox('list_phone', 1); $form->setMatch('list_phone', PHPWS_Settings::get('rolodex', 'list_phone')); ! $form->setLabel('list_phone', dgettext('rolodex', 'List')); ! ! $form->addCheckbox('browse_phone', 1); ! $form->setMatch('browse_phone', PHPWS_Settings::get('rolodex', 'browse_phone')); ! $form->setLabel('browse_phone', dgettext('rolodex', 'Browse')); $form->addCheckbox('list_categories', 1); $form->setMatch('list_categories', PHPWS_Settings::get('rolodex', 'list_categories')); ! $form->setLabel('list_categories', dgettext('rolodex', 'List')); ! ! $form->addCheckbox('browse_categories', 1); ! $form->setMatch('browse_categories', PHPWS_Settings::get('rolodex', 'browse_categories')); ! $form->setLabel('browse_categories', dgettext('rolodex', 'Browse')); $form->addCheckbox('list_locations', 1); $form->setMatch('list_locations', PHPWS_Settings::get('rolodex', 'list_locations')); ! $form->setLabel('list_locations', dgettext('rolodex', 'List')); ! ! $form->addCheckbox('browse_locations', 1); ! $form->setMatch('browse_locations', PHPWS_Settings::get('rolodex', 'browse_locations')); ! $form->setLabel('browse_locations', dgettext('rolodex', 'Browse')); $form->addCheckbox('list_features', 1); $form->setMatch('list_features', PHPWS_Settings::get('rolodex', 'list_features')); ! $form->setLabel('list_features', dgettext('rolodex', 'List')); ! ! $form->addCheckbox('browse_features', 1); ! $form->setMatch('browse_features', PHPWS_Settings::get('rolodex', 'browse_features')); ! $form->setLabel('browse_features', dgettext('rolodex', 'Browse')); $form->addTextField('max_img_width', PHPWS_Settings::get('rolodex', 'max_img_width')); --- 638,660 ---- $form->setLabel('use_captcha', dgettext('rolodex', 'Use graphical confirmation on contact form (CAPTCHA)')); ! $form->addRadio('list_address', array(0, 1, 2, 3)); ! $form->setLabel('list_address', array(dgettext('rolodex', 'None'), dgettext('rolodex', 'Business'), dgettext('rolodex', 'Home'), dgettext('rolodex', 'Both'))); $form->setMatch('list_address', PHPWS_Settings::get('rolodex', 'list_address')); $form->addCheckbox('list_phone', 1); $form->setMatch('list_phone', PHPWS_Settings::get('rolodex', 'list_phone')); ! $form->setLabel('list_phone', dgettext('rolodex', 'Display phone numbers')); $form->addCheckbox('list_categories', 1); $form->setMatch('list_categories', PHPWS_Settings::get('rolodex', 'list_categories')); ! $form->setLabel('list_categories', dgettext('rolodex', 'Display categories')); $form->addCheckbox('list_locations', 1); $form->setMatch('list_locations', PHPWS_Settings::get('rolodex', 'list_locations')); ! $form->setLabel('list_locations', dgettext('rolodex', 'Display locations')); $form->addCheckbox('list_features', 1); $form->setMatch('list_features', PHPWS_Settings::get('rolodex', 'list_features')); ! $form->setLabel('list_features', dgettext('rolodex', 'Display features')); $form->addTextField('max_img_width', PHPWS_Settings::get('rolodex', 'max_img_width')); *************** *** 783,792 **** $tpl['PRIVACY_USE_SEARCH_TITLE'] = dgettext('rolodex', 'Register records in search module'); $tpl['LIST_SETTINGS_TIP'] = dgettext('rolodex', 'The following settings respect the privacy settings above and do not over-ride them.'); ! $tpl['LIST_ADDRESS_TITLE'] = dgettext('rolodex', 'Address to display on list views'); ! $tpl['BROWSE_ADDRESS_TITLE'] = dgettext('rolodex', 'Address to display on browse views'); ! $tpl['LIST_PHONE_TITLE'] = dgettext('rolodex', 'Display phone numbers'); ! $tpl['LIST_CATEGORIES_TITLE'] = dgettext('rolodex', 'Display categories'); ! $tpl['LIST_LOCATIONS_TITLE'] = dgettext('rolodex', 'Display locations'); ! $tpl['LIST_FEATURES_TITLE'] = dgettext('rolodex', 'Display features'); $tpl['COMMENTS_GROUP_LABEL'] = dgettext('rolodex', 'Comments Settings'); $tpl['PRIVACY_GROUP_LABEL'] = dgettext('rolodex', 'Privacy Settings'); --- 767,771 ---- $tpl['PRIVACY_USE_SEARCH_TITLE'] = dgettext('rolodex', 'Register records in search module'); $tpl['LIST_SETTINGS_TIP'] = dgettext('rolodex', 'The following settings respect the privacy settings above and do not over-ride them.'); ! $tpl['LIST_ADDRESS_TITLE'] = dgettext('rolodex', 'Address to display on browse list views'); $tpl['COMMENTS_GROUP_LABEL'] = dgettext('rolodex', 'Comments Settings'); $tpl['PRIVACY_GROUP_LABEL'] = dgettext('rolodex', 'Privacy Settings'); *************** *** 795,799 **** $tpl['FIELDS_GROUP_LABEL'] = dgettext('rolodex', 'Custom Fields'); $tpl['FIELDS_NOTE'] = dgettext('rolodex', 'You may use up to 8 custom fields. To add a field to your member profile template, enter a title for it here. Fields 1-4 follow whatever other security/privacy settings are in place. Fields 5-8 are only visible to Rolodex admins. Leave these fields empty if you do not wish to add custom fields to your profiles.'); ! $tpl['FIELDS_LIST_LABEL'] = dgettext('rolodex', 'Select checkbox to also include field in browse view'); $this->rolodex->title = dgettext('rolodex', 'Settings'); --- 774,778 ---- $tpl['FIELDS_GROUP_LABEL'] = dgettext('rolodex', 'Custom Fields'); $tpl['FIELDS_NOTE'] = dgettext('rolodex', 'You may use up to 8 custom fields. To add a field to your member profile template, enter a title for it here. Fields 1-4 follow whatever other security/privacy settings are in place. Fields 5-8 are only visible to Rolodex admins. Leave these fields empty if you do not wish to add custom fields to your profiles.'); ! $tpl['FIELDS_LIST_LABEL'] = dgettext('rolodex', 'Select checkbox to also include field in list view'); $this->rolodex->title = dgettext('rolodex', 'Settings'); *************** *** 1303,1306 **** --- 1282,1286 ---- + /* not in use */ function categories() { Index: RDX_Location.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Location.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RDX_Location.php 24 Jun 2008 11:23:27 -0000 1.4 --- RDX_Location.php 7 Jul 2008 13:30:15 -0000 1.5 *************** *** 129,173 **** - function view() - { - if (!$this->id) { - PHPWS_Core::errorPage(404); - } - - Layout::addPageTitle($this->getTitle()); - $template['TITLE'] = $this->getTitle(true); - $template['DESCRIPTION'] = PHPWS_Text::parseTag($this->getDescription(true)); - $template['IMAGE'] = $this->getFile(); - - if (Current_User::allow('rolodex', 'settings')) { - $vars['location'] = $this->id; - $vars['aop'] = 'edit_location'; - MiniAdmin::add('rolodex', array(PHPWS_Text::secureLink(dgettext('rolodex', 'Edit location'), 'rolodex', $vars))); - } - - if (Current_User::allow('rolodex', 'settings')) { - $vars2['aop'] = 'menu'; - $vars2['tab'] = 'locations'; - MiniAdmin::add('rolodex', array(PHPWS_Text::secureLink(dgettext('rolodex', 'List all locations'), 'rolodex', $vars2))); - } - - $template['LOCATION_LINKS'] = $this->locationLinks(); - - $members = $this->getAllMembers(true); - if (PHPWS_Error::logIfError($members)) { - $this->rolodex->content = dgettext('rolodex', 'An error occurred when accessing this location\'s members.'); - return; - } - if ($members) { - foreach ($members as $member) { - $template['current-members'][] = $member->viewTpl(); - } - } - - return PHPWS_Template::process($template, 'rolodex', 'view_location.tpl'); - - } - - function delete() { --- 129,132 ---- *************** *** 186,244 **** - function getAllMembers($limit=false, $approved=null, $expired=false) - { - PHPWS_Core::initModClass('rolodex', 'RDX_Member.php'); - - $db = new PHPWS_DB('rolodex_member'); - $db->addColumn('rolodex_location_items.*'); - $db->addColumn('rolodex_member.*'); - $db->addColumn('demographics.*'); - $db->addWhere('rolodex_member.user_id', 'rolodex_location_items.member_id'); - $db->addWhere('rolodex_location_items.location_id', $this->id); - $db->addWhere('rolodex_member.user_id', 'demographics.user_id'); - - /* approved yes/no */ - if (isset($approved)) { - $addWhere('active', $approved); - } - - /* expired yes/no */ - if (PHPWS_Settings::get('rolodex', 'enable_expiry')) { - if ($expired) { - $addWhere('date_expires', mktime(), '<='); - } else { - $addWhere('date_expires', mktime(), '>='); - } - } - - /* make sure only unrestricted users see inactive members */ - if (!Current_User::isUnrestricted('rolodex')) { - $db->addWhere('active', 1); - } - - /* set the default sort order and title column sort */ - if (PHPWS_Settings::get('rolodex', 'sortby')) { - $sortby = 'demographics.last_name'; - // $db->joinResult('user_id', 'demographics', 'user_id', 'last_name', 'title'); - } else { - $sortby = 'demographics.business_name'; - // $db->joinResult('user_id', 'demographics', 'user_id', 'business_name', 'title'); - } - - /* deal with privacy levels */ - if (!$_SESSION['User']->id) { - $db->addWhere('rolodex_member.privacy', 0); - } elseif (!Current_User::allow('rolodex', 'view_privates')) { - $db->addWhere('rolodex_member.privacy', 1, '<='); - } - - /* the default sort order */ - $db->addOrder($sortby, 'asc', true); - - $result = $db->getObjects('Rolodex_Member'); - return $result; - } - - function rowTag() { --- 145,148 ---- Index: Rolodex.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/Rolodex.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Rolodex.php 6 Jul 2008 13:05:17 -0000 1.14 --- Rolodex.php 7 Jul 2008 13:30:15 -0000 1.15 *************** *** 477,500 **** break; - /* old views - case 'view_location': - $this->loadLocation(); - $this->title = $this->location->getTitle(); - $this->content = $this->location->view(); - break; - - case 'view_feature': - $this->loadFeature(); - $this->title = $this->feature->getTitle(); - $this->content = $this->feature->view(); - break; - - case 'view_category': - $this->loadCategory(); - $this->title = $this->category->getTitle(); - $this->content = $this->categoryView(); - break; - */ - case 'view_location': if (!PHPWS_Settings::get('rolodex', 'allow_anon') && !Current_User::getId()) { --- 477,480 ---- *************** *** 769,773 **** PHPWS_Settings::set('rolodex', 'list_address', $_POST['list_address']); - PHPWS_Settings::set('rolodex', 'browse_address', $_POST['browse_address']); isset($_POST['list_phone']) ? --- 749,752 ---- *************** *** 775,806 **** PHPWS_Settings::set('rolodex', 'list_phone', 0); - isset($_POST['browse_phone']) ? - PHPWS_Settings::set('rolodex', 'browse_phone', 1) : - PHPWS_Settings::set('rolodex', 'browse_phone', 0); - isset($_POST['list_categories']) ? PHPWS_Settings::set('rolodex', 'list_categories', 1) : PHPWS_Settings::set('rolodex', 'list_categories', 0); - isset($_POST['browse_categories']) ? - PHPWS_Settings::set('rolodex', 'browse_categories', 1) : - PHPWS_Settings::set('rolodex', 'browse_categories', 0); - isset($_POST['list_locations']) ? PHPWS_Settings::set('rolodex', 'list_locations', 1) : PHPWS_Settings::set('rolodex', 'list_locations', 0); - isset($_POST['browse_locations']) ? - PHPWS_Settings::set('rolodex', 'browse_locations', 1) : - PHPWS_Settings::set('rolodex', 'browse_locations', 0); - isset($_POST['list_features']) ? PHPWS_Settings::set('rolodex', 'list_features', 1) : PHPWS_Settings::set('rolodex', 'list_features', 0); - isset($_POST['browse_features']) ? - PHPWS_Settings::set('rolodex', 'browse_features', 1) : - PHPWS_Settings::set('rolodex', 'browse_features', 0); - isset($_POST['enable_expiry']) ? --- 754,769 ---- *************** *** 1488,1575 **** - function categoryView() - { - if (!$this->category->id) { - PHPWS_Core::errorPage(404); - } - - Layout::addPageTitle($this->category->getTitle()); - $template['TITLE'] = $this->category->getTitle(true); - $template['DESCRIPTION'] = PHPWS_Text::parseTag($this->category->getDescription(true)); - $template['IMAGE'] = $this->category->getIcon(); - - $template['CATEGORY_LINKS'] = implode(' | ', Rolodex::navLinks()); - - $members = $this->getCatMembers(true); - if (PHPWS_Error::logIfError($members)) { - $this->rolodex->content = dgettext('rolodex', 'An error occurred when accessing this location\'s members.'); - return; - } - if ($members) { - foreach ($members as $member) { - $template['current-members'][] = $member->viewTpl(); - } - } - - return PHPWS_Template::process($template, 'rolodex', 'view_category.tpl'); - - } - - - function getCatMembers($limit=false, $approved=null, $expired=false) - { - PHPWS_Core::initModClass('rolodex', 'RDX_Member.php'); - - $db = new PHPWS_DB('rolodex_member'); - $db->addColumn('category_items.*'); - $db->addColumn('rolodex_member.*'); - $db->addColumn('demographics.*'); - $db->addWhere('rolodex_member.key_id', 'category_items.key_id'); - $db->addWhere('category_items.cat_id', $this->category->id); - $db->addWhere('rolodex_member.user_id', 'demographics.user_id'); - - /* approved yes/no */ - if (isset($approved)) { - $addWhere('active', $approved); - } - - /* expired yes/no */ - if (PHPWS_Settings::get('rolodex', 'enable_expiry')) { - if ($expired) { - $addWhere('date_expires', mktime(), '<='); - } else { - $addWhere('date_expires', mktime(), '>='); - } - } - - /* make sure only unrestricted users see inactive members */ - if (!Current_User::isUnrestricted('rolodex')) { - $db->addWhere('active', 1); - } - - /* set the default sort order and title column sort */ - if (PHPWS_Settings::get('rolodex', 'sortby')) { - $sortby = 'demographics.last_name'; - // $db->joinResult('user_id', 'demographics', 'user_id', 'last_name', 'title'); - } else { - $sortby = 'demographics.business_name'; - // $db->joinResult('user_id', 'demographics', 'user_id', 'business_name', 'title'); - } - - /* deal with privacy levels */ - if (!$_SESSION['User']->id) { - $db->addWhere('rolodex_member.privacy', 0); - } elseif (!Current_User::allow('rolodex', 'view_privates')) { - $db->addWhere('rolodex_member.privacy', 1, '<='); - } - - /* the default sort order */ - $db->addOrder($sortby, 'asc', true); - - $result = $db->getObjects('Rolodex_Member'); - return $result; - } - - function navLinks() { --- 1451,1454 ---- *************** *** 1602,1605 **** --- 1481,1488 ---- } + if (Current_User::allow('rolodex', 'settings') && !$_REQUEST['aop']){ + $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Settings'), "rolodex", array('aop'=>'menu', 'tab'=>'settings')); + } + return $links; } Index: RDX_Member.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Member.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** RDX_Member.php 6 Jul 2008 13:05:17 -0000 1.13 --- RDX_Member.php 7 Jul 2008 13:30:15 -0000 1.14 *************** *** 1355,1359 **** } ! $tpl['TITLE'] = $this->viewLink(); $tpl['DATE_UPDATED'] = $this->getDate_updated(true, '%a %b %e %Y'); $tpl['DESCRIPTION'] = $this->getListDescription(180); --- 1355,1359 ---- } ! $tpl['TITLE'] = $this->viewLink(true); $tpl['DATE_UPDATED'] = $this->getDate_updated(true, '%a %b %e %Y'); $tpl['DESCRIPTION'] = $this->getListDescription(180); *************** *** 1365,1397 **** $tpl['WEBSITE_LINK'] = $this->getWebsite(true, true); } ! if (PHPWS_Settings::get('rolodex', 'browse_address') == 1) { if ($this->isDataVisible('privacy_business')) { ! $tpl['ADDRESS_1'] = $this->getBusiness_address_1(true); ! $tpl['ADDRESS_2'] = $this->getBusiness_address_2(true); ! $tpl['CITY'] = $this->getBusiness_city(true); ! $tpl['STATE'] = $this->getBusiness_state(true); ! $tpl['COUNTRY'] = $this->getBusiness_country(true); ! $tpl['ZIP_CODE'] = $this->getBusiness_zip_code(true); if ($this->getBusiness_address_1() || $this->getBusiness_address_2() || $this->getBusiness_city() || $this->getBusiness_state() || $this->getBusiness_country() || $this->getBusiness_zip_code()) { ! $tpl['LABEL'] = dgettext('rolodex', 'Business address'); } ! $tpl['GOOGLE_MAP'] = $this->getGoogleMap('business'); } ! } elseif (PHPWS_Settings::get('rolodex', 'browse_address') == 2) { if ($this->isDataVisible('privacy_home')) { ! $tpl['ADDRESS_1'] = $this->getMailing_address_1(true); ! $tpl['ADDRESS_2'] = $this->getMailing_address_2(true); ! $tpl['CITY'] = $this->getMailing_city(true); ! $tpl['STATE'] = $this->getMailing_state(true); ! $tpl['COUNTRY'] = $this->getMailing_country(true); ! $tpl['ZIP_CODE'] = $this->getMailing_zip_code(true); if ($this->getMailing_address_1() || $this->getMailing_address_2() || $this->getMailing_city() || $this->getMailing_state() || $this->getMailing_country() || $this->getMailing_zip_code()) { ! $tpl['LABEL'] = dgettext('rolodex', 'Home address'); } ! $tpl['GOOGLE_MAP'] = $this->getGoogleMap('mailing'); } } ! if (PHPWS_Settings::get('rolodex', 'browse_phone')) { if ($this->isDataVisible('privacy_bus_phone')) { if ($this->getDay_phone()) { --- 1365,1398 ---- $tpl['WEBSITE_LINK'] = $this->getWebsite(true, true); } ! if (PHPWS_Settings::get('rolodex', 'list_address') == 1 || PHPWS_Settings::get('rolodex', 'list_address') == 3) { if ($this->isDataVisible('privacy_business')) { ! $tpl['B_ADDRESS_1'] = $this->getBusiness_address_1(true); ! $tpl['B_ADDRESS_2'] = $this->getBusiness_address_2(true); ! $tpl['B_CITY'] = $this->getBusiness_city(true); ! $tpl['B_STATE'] = $this->getBusiness_state(true); ! $tpl['B_COUNTRY'] = $this->getBusiness_country(true); ! $tpl['B_ZIP_CODE'] = $this->getBusiness_zip_code(true); if ($this->getBusiness_address_1() || $this->getBusiness_address_2() || $this->getBusiness_city() || $this->getBusiness_state() || $this->getBusiness_country() || $this->getBusiness_zip_code()) { ! $tpl['B_LABEL'] = dgettext('rolodex', 'Business address'); } ! $tpl['B_GOOGLE_MAP'] = $this->getGoogleMap('business'); } ! } ! if (PHPWS_Settings::get('rolodex', 'list_address') == 2 || PHPWS_Settings::get('rolodex', 'list_address') == 3) { if ($this->isDataVisible('privacy_home')) { ! $tpl['H_ADDRESS_1'] = $this->getMailing_address_1(true); ! $tpl['H_ADDRESS_2'] = $this->getMailing_address_2(true); ! $tpl['H_CITY'] = $this->getMailing_city(true); ! $tpl['H_STATE'] = $this->getMailing_state(true); ! $tpl['H_COUNTRY'] = $this->getMailing_country(true); ! $tpl['H_ZIP_CODE'] = $this->getMailing_zip_code(true); if ($this->getMailing_address_1() || $this->getMailing_address_2() || $this->getMailing_city() || $this->getMailing_state() || $this->getMailing_country() || $this->getMailing_zip_code()) { ! $tpl['H_LABEL'] = dgettext('rolodex', 'Home address'); } ! $tpl['H_GOOGLE_MAP'] = $this->getGoogleMap('mailing'); } } ! if (PHPWS_Settings::get('rolodex', 'list_phone')) { if ($this->isDataVisible('privacy_bus_phone')) { if ($this->getDay_phone()) { *************** *** 1420,1424 **** } ! if (PHPWS_Settings::get('rolodex', 'browse_categories')) { if ($this->get_categories(true)) { $tpl['CATEGORY_LINKS'] = implode(', ', $this->get_categories(true)); --- 1421,1425 ---- } ! if (PHPWS_Settings::get('rolodex', 'list_categories')) { if ($this->get_categories(true)) { $tpl['CATEGORY_LINKS'] = implode(', ', $this->get_categories(true)); *************** *** 1427,1431 **** } ! if (PHPWS_Settings::get('rolodex', 'browse_locations')) { if ($this->get_locations(true)) { $tpl['LOCATION_LINKS'] = implode(', ', $this->get_locations(true)); --- 1428,1432 ---- } ! if (PHPWS_Settings::get('rolodex', 'list_locations')) { if ($this->get_locations(true)) { $tpl['LOCATION_LINKS'] = implode(', ', $this->get_locations(true)); *************** *** 1434,1438 **** } ! if (PHPWS_Settings::get('rolodex', 'browse_features')) { if ($this->get_features(true)) { $tpl['FEATURE_LINKS'] = implode(', ', $this->get_features(true)); --- 1435,1439 ---- } ! if (PHPWS_Settings::get('rolodex', 'list_features')) { if ($this->get_features(true)) { $tpl['FEATURE_LINKS'] = implode(', ', $this->get_features(true)); *************** *** 1548,1645 **** - function viewTpl() - { - $tpl['MEMBER_TITLE'] = $this->viewLink(true); - $tpl['MEMBER_DESCRIPTION'] = $this->getListDescription(300); - $tpl['MEMBER_LINKS'] = $this->editLink(); - $tpl['THUMBNAIL'] = $this->getThumbnail(true, true); - - if (PHPWS_Settings::get('rolodex', 'list_address') == 1) { - if ($this->isDataVisible('privacy_business')) { - $tpl['ADDRESS_1'] = $this->getBusiness_address_1(true); - $tpl['ADDRESS_2'] = $this->getBusiness_address_2(true); - $tpl['CITY'] = $this->getBusiness_city(true); - $tpl['STATE'] = $this->getBusiness_state(true); - $tpl['COUNTRY'] = $this->getBusiness_country(true); - $tpl['ZIP_CODE'] = $this->getBusiness_zip_code(true); - if ($this->getBusiness_address_1() || $this->getBusiness_address_2() || $this->getBusiness_city() || $this->getBusiness_state() || $this->getBusiness_country() || $this->getBusiness_zip_code()) { - $tpl['LABEL'] = dgettext('rolodex', 'Business address'); - } - $tpl['GOOGLE_MAP'] = $this->getGoogleMap('business'); - } - } elseif (PHPWS_Settings::get('rolodex', 'list_address') == 2) { - if ($this->isDataVisible('privacy_home')) { - $tpl['ADDRESS_1'] = $this->getMailing_address_1(true); - $tpl['ADDRESS_2'] = $this->getMailing_address_2(true); - $tpl['CITY'] = $this->getMailing_city(true); - $tpl['STATE'] = $this->getMailing_state(true); - $tpl['COUNTRY'] = $this->getMailing_country(true); - $tpl['ZIP_CODE'] = $this->getMailing_zip_code(true); - if ($this->getMailing_address_1() || $this->getMailing_address_2() || $this->getMailing_city() || $this->getMailing_state() || $this->getMailing_country() || $this->getMailing_zip_code()) { - $tpl['LABEL'] = dgettext('rolodex', 'Home address'); - } - $tpl['GOOGLE_MAP'] = $this->getGoogleMap('mailing'); - } - } - - if (PHPWS_Settings::get('rolodex', 'list_phone')) { - if ($this->isDataVisible('privacy_bus_phone')) { - if ($this->getDay_phone()) { - $tpl['LIST_DAY_PHONE_LABEL'] = dgettext('rolodex', 'Business phone'); - $tpl['LIST_DAY_PHONE'] = $this->getDay_phone(true); - } - if ($this->getDay_phone_ext()) { - $tpl['LIST_DAY_PHONE_EXT'] = $this->getDay_phone_ext(true); - $tpl['LIST_DAY_PHONE_EXT_LABEL'] = dgettext('rolodex', 'Ext'); - } - if ($this->getFax_number()) { - $tpl['LIST_FAX_NUMBER'] = $this->getFax_number(true); - $tpl['LIST_FAX_NUMBER_LABEL'] = dgettext('rolodex', 'Fax'); - } - if ($this->getTollfree_phone()) { - $tpl['LIST_TOLLFREE_PHONE'] = $this->getTollfree_phone(true); - $tpl['LIST_TOLLFREE_PHONE_LABEL'] = dgettext('rolodex', 'Tollfree'); - } - } - if ($this->isDataVisible('privacy_home_phone')) { - if ($this->getEvening_phone()) { - $tpl['LIST_EVENING_PHONE_LABEL'] = dgettext('rolodex', 'Home phone'); - $tpl['LIST_EVENING_PHONE'] = $this->getEvening_phone(true); - } - } - } - - if (PHPWS_Settings::get('rolodex', 'list_categories')) { - if ($this->get_categories(true)) { - $tpl['CATEGORY_LINKS'] = implode(', ', $this->get_categories(true)); - $tpl['CATEGORY_LINKS_LABEL'] = dgettext('rolodex', 'Category(s)'); - } - } - - if (PHPWS_Settings::get('rolodex', 'list_locations')) { - if ($this->get_locations(true)) { - $tpl['LOCATION_LINKS'] = implode(', ', $this->get_locations(true)); - $tpl['LOCATION_LINKS_LABEL'] = dgettext('rolodex', 'Location(s)'); - } - } - - if (PHPWS_Settings::get('rolodex', 'list_features')) { - if ($this->get_features(true)) { - $tpl['FEATURE_LINKS'] = implode(', ', $this->get_features(true)); - $tpl['FEATURE_LINKS_LABEL'] = dgettext('rolodex', 'Feature(s)'); - } - } - - if ($this->isDataVisible('privacy_contact')) { - $tpl['CONTACT_EMAIL_LINK'] = $this->getDisplay_email(true, true); - } - if ($this->isDataVisible('privacy_web')) { - $tpl['WEBSITE_LINK'] = $this->getWebsite(true, true); - } - - return $tpl; - } - - function getGoogleMap($location='mailing') { --- 1549,1552 ---- |