|
From: Verdon V. <ve...@us...> - 2008-06-16 15:59:47
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/class In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24656/class Modified Files: RDX_Feature.php RDX_Location.php RDX_Member.php RDX_Mypage.php Log Message: tweaks to support features locations etc Index: RDX_Feature.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Feature.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RDX_Feature.php 12 Jun 2008 21:18:52 -0000 1.1 --- RDX_Feature.php 16 Jun 2008 15:59:19 -0000 1.2 *************** *** 141,145 **** $template['IMAGE'] = $this->getFile(); ! if (Current_User::allow('rolodex', 'edit_feature')) { $vars['feature'] = $this->id; $vars['aop'] = 'edit_feature'; --- 141,145 ---- $template['IMAGE'] = $this->getFile(); ! if (Current_User::allow('rolodex', 'settings')) { $vars['feature'] = $this->id; $vars['aop'] = 'edit_feature'; *************** *** 147,151 **** } ! if (Current_User::allow('rolodex', 'edit_feature')) { $vars2['aop'] = 'menu'; $vars2['tab'] = 'features'; --- 147,151 ---- } ! if (Current_User::allow('rolodex', 'settings')) { $vars2['aop'] = 'menu'; $vars2['tab'] = 'features'; *************** *** 246,255 **** $vars['feature'] = $this->id; ! if (Current_User::allow('rolodex', 'edit_feature')){ $vars['aop'] = 'edit_feature'; $links[] = PHPWS_Text::secureLink(dgettext('rolodex', 'Edit'), 'rolodex', $vars); } ! if (Current_User::allow('rolodex', 'delete_feature')){ $vars['aop'] = 'delete_feature'; $js['ADDRESS'] = PHPWS_Text::linkAddress('rolodex', $vars, true); --- 246,255 ---- $vars['feature'] = $this->id; ! if (Current_User::allow('rolodex', 'settings')){ $vars['aop'] = 'edit_feature'; $links[] = PHPWS_Text::secureLink(dgettext('rolodex', 'Edit'), 'rolodex', $vars); } ! if (Current_User::allow('rolodex', 'settings')){ $vars['aop'] = 'delete_feature'; $js['ADDRESS'] = PHPWS_Text::linkAddress('rolodex', $vars, true); Index: RDX_Location.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Location.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RDX_Location.php 12 Jun 2008 21:18:52 -0000 1.1 --- RDX_Location.php 16 Jun 2008 15:59:19 -0000 1.2 *************** *** 140,144 **** $template['IMAGE'] = $this->getFile(); ! if (Current_User::allow('rolodex', 'edit_location')) { $vars['location'] = $this->id; $vars['aop'] = 'edit_location'; --- 140,144 ---- $template['IMAGE'] = $this->getFile(); ! if (Current_User::allow('rolodex', 'settings')) { $vars['location'] = $this->id; $vars['aop'] = 'edit_location'; *************** *** 146,150 **** } ! if (Current_User::allow('rolodex', 'edit_location')) { $vars2['aop'] = 'menu'; $vars2['tab'] = 'locations'; --- 146,150 ---- } ! if (Current_User::allow('rolodex', 'settings')) { $vars2['aop'] = 'menu'; $vars2['tab'] = 'locations'; *************** *** 245,254 **** $vars['location'] = $this->id; ! if (Current_User::allow('rolodex', 'edit_location')){ $vars['aop'] = 'edit_location'; $links[] = PHPWS_Text::secureLink(dgettext('rolodex', 'Edit'), 'rolodex', $vars); } ! if (Current_User::allow('rolodex', 'delete_location')){ $vars['aop'] = 'delete_location'; $js['ADDRESS'] = PHPWS_Text::linkAddress('rolodex', $vars, true); --- 245,254 ---- $vars['location'] = $this->id; ! if (Current_User::allow('rolodex', 'settings')){ $vars['aop'] = 'edit_location'; $links[] = PHPWS_Text::secureLink(dgettext('rolodex', 'Edit'), 'rolodex', $vars); } ! if (Current_User::allow('rolodex', 'settings')){ $vars['aop'] = 'delete_location'; $js['ADDRESS'] = PHPWS_Text::linkAddress('rolodex', $vars, true); Index: RDX_Mypage.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Mypage.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RDX_Mypage.php 10 Jun 2008 17:15:12 -0000 1.4 --- RDX_Mypage.php 16 Jun 2008 15:59:19 -0000 1.5 *************** *** 54,57 **** --- 54,60 ---- $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Browse members'), 'rolodex', $vars2); $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Categories'), "rolodex", array('uop'=>'categories')); + $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Locations'), "rolodex", array('uop'=>'locations')); + $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Features'), "rolodex", array('uop'=>'features')); + $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Advanced'), "rolodex", array('uop'=>'advanced')); $tpl['CONTENT'] = implode(' | ', $links); $tpl['CONTENT'] .= Rolodex_Mypage::searchForm(); Index: RDX_Member.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Member.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** RDX_Member.php 12 Jun 2008 21:18:52 -0000 1.7 --- RDX_Member.php 16 Jun 2008 15:59:19 -0000 1.8 *************** *** 87,91 **** /* to hold the categories */ ! // var $_categories = null; --- 87,91 ---- /* to hold the categories */ ! // var $_categories = null; // I don't think I need this anymore *************** *** 102,109 **** ! function get_categories($print=false) { if ($print) { ! $result = Categories::getSimpleLinks($this->key_id, true); } else { $db = new PHPWS_DB('category_items'); --- 102,124 ---- ! function get_categories($print=false, $nolink=false) { if ($print) { ! if ($nolink) { ! $cat_result = Categories::catList($this->key_id); ! if (empty($cat_result)) { ! $link[] = null; ! } else { ! foreach ($cat_result as $cat){ ! if (!$cat->id) { ! continue; ! } ! $link[] = $cat->getTitle(); ! } ! } ! $result = $link; ! } else { ! $result = Categories::getSimpleLinks($this->key_id, true); ! } } else { $db = new PHPWS_DB('category_items'); *************** *** 116,120 **** ! function get_locations($print=false) { $db = new PHPWS_DB('rolodex_location_items'); --- 131,135 ---- ! function get_locations($print=false, $nolink=false) { $db = new PHPWS_DB('rolodex_location_items'); *************** *** 126,130 **** foreach ($result as $id){ $location = new Rolodex_Location($id); ! $link[] = $location->viewLink(); } $result = $link; --- 141,149 ---- foreach ($result as $id){ $location = new Rolodex_Location($id); ! if ($nolink) { ! $link[] = $location->getTitle(true); ! } else { ! $link[] = $location->viewLink(); ! } } $result = $link; *************** *** 134,138 **** ! function get_features($print=false) { $db = new PHPWS_DB('rolodex_feature_items'); --- 153,157 ---- ! function get_features($print=false, $nolink=false) { $db = new PHPWS_DB('rolodex_feature_items'); *************** *** 144,148 **** foreach ($result as $id){ $feature = new Rolodex_Feature($id); ! $link[] = $feature->viewLink(); } $result = $link; --- 163,171 ---- foreach ($result as $id){ $feature = new Rolodex_Feature($id); ! if ($nolink) { ! $link[] = $feature->getTitle(true); ! } else { ! $link[] = $feature->viewLink(); ! } } $result = $link; *************** *** 1381,1385 **** --- 1404,1417 ---- $key = new Key($this->key_id); $key->delete(); + + $db = new PHPWS_DB('rolodex_location_items'); + $db->addWhere('member_id', $this->user_id); + PHPWS_Error::logIfError($db->delete()); + $db = new PHPWS_DB('rolodex_feature_items'); + $db->addWhere('member_id', $this->user_id); + PHPWS_Error::logIfError($db->delete()); + $this->deleteImage(); + return $this->delete(); } *************** *** 1645,1650 **** $content .= '"' . dgettext('rolodex', 'Department') . '",'; $content .= '"' . dgettext('rolodex', 'Position title') . '",'; ! // if ($_SESSION['OBJ_fatcat']) ! // $content .= '"' . dgettext('rolodex', 'Category') . '",'; $content .= '"' . dgettext('rolodex', 'E-Mail') . '",'; $content .= '"' . dgettext('rolodex', 'Website') . '",'; --- 1677,1683 ---- $content .= '"' . dgettext('rolodex', 'Department') . '",'; $content .= '"' . dgettext('rolodex', 'Position title') . '",'; ! $content .= '"' . dgettext('rolodex', 'Category(s)') . '",'; ! $content .= '"' . dgettext('rolodex', 'Location(s)') . '",'; ! $content .= '"' . dgettext('rolodex', 'Feature(s)') . '",'; $content .= '"' . dgettext('rolodex', 'E-Mail') . '",'; $content .= '"' . dgettext('rolodex', 'Website') . '",'; *************** *** 1704,1724 **** $content .= '"' . $this->getDepartment . '",'; $content .= '"' . $this->getPosition_title . '",'; ! /* ! if ($_SESSION['OBJ_fatcat']) { ! if (!($row = $_SESSION['OBJ_fatcat']->getModuleElements('phpwsbusinesses', $this->getId()))) ! $content .= '",'; ! else { ! $cats = NULL; ! foreach ($row as $element) { ! $catid = $_SESSION['OBJ_fatcat']->getElementCatId($element['element_id'],'phpwsbusinesses'); ! $cat = new PHPWS_Fatcat_Category($catid); ! if (isset($cats)) ! $cats .= '; '; ! $cats .= $cat->title; ! } ! $content .= '"' . $cats . '",'; ! } ! } ! */ $content .= '"' . $this->getDisplay_email() . '",'; $content .= '"' . $this->getWebsite() . '",'; --- 1737,1743 ---- $content .= '"' . $this->getDepartment . '",'; $content .= '"' . $this->getPosition_title . '",'; ! $content .= '"' . implode('; ', $this->get_categories(true, true)) . '",'; ! $content .= '"' . implode('; ', $this->get_locations(true, true)) . '",'; ! $content .= '"' . implode('; ', $this->get_features(true, true)) . '",'; $content .= '"' . $this->getDisplay_email() . '",'; $content .= '"' . $this->getWebsite() . '",'; |