You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(120) |
Jun
(74) |
Jul
(97) |
Aug
(35) |
Sep
(35) |
Oct
(34) |
Nov
|
Dec
(6) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(18) |
Feb
(8) |
Mar
(7) |
Apr
(23) |
May
(28) |
Jun
(31) |
Jul
(27) |
Aug
(34) |
Sep
(48) |
Oct
(511) |
Nov
(197) |
Dec
(333) |
| 2005 |
Jan
(212) |
Feb
(33) |
Mar
(94) |
Apr
(51) |
May
(16) |
Jun
|
Jul
(200) |
Aug
(43) |
Sep
(88) |
Oct
(60) |
Nov
(62) |
Dec
(41) |
| 2006 |
Jan
(94) |
Feb
(49) |
Mar
(54) |
Apr
|
May
(39) |
Jun
(39) |
Jul
(61) |
Aug
(36) |
Sep
(23) |
Oct
(76) |
Nov
(73) |
Dec
(32) |
| 2007 |
Jan
|
Feb
(87) |
Mar
|
Apr
(8) |
May
(36) |
Jun
(49) |
Jul
(54) |
Aug
(8) |
Sep
(50) |
Oct
(36) |
Nov
|
Dec
(3) |
| 2008 |
Jan
(133) |
Feb
(54) |
Mar
(39) |
Apr
(2) |
May
(6) |
Jun
(74) |
Jul
(97) |
Aug
(70) |
Sep
(12) |
Oct
(20) |
Nov
(64) |
Dec
(24) |
| 2009 |
Jan
(25) |
Feb
(49) |
Mar
(18) |
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
(10) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(7) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Verdon V. <ve...@us...> - 2008-06-17 13:28:02
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22769/docs Modified Files: CHANGELOG TODO Log Message: final tidy up for 0.7 release Index: TODO =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/docs/TODO,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TODO 16 Jun 2008 18:21:44 -0000 1.10 --- TODO 17 Jun 2008 13:27:36 -0000 1.11 *************** *** 5,15 **** - enhance categories view - - further refine avatar and image routines - they work now, but - - should I even do the avatar? - - should I unique name and delete old images as work-around refresh - or some other means to force a refresh when uploading a new image? - consider option to delete demographics records when uninstalling rolodex consider option to delete demographics record when deleting rolodex member --- 5,8 ---- *************** *** 20,27 **** - - - UPDATE CHANGELOG - ##################### - - update language files --- 13,14 ---- Index: CHANGELOG =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/docs/CHANGELOG,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CHANGELOG 11 Jun 2008 17:43:33 -0000 1.2 --- CHANGELOG 17 Jun 2008 13:27:36 -0000 1.3 *************** *** 9,17 **** Version 0.6.0 -- May 2008 ------------------------------------------------------------------ ! + Fixes from user input at phpwsforums Version 0.7.0 -- June 2008 ------------------------------------------------------------------ + Add support for Location(s) and Feature(s) ! --- 9,27 ---- Version 0.6.0 -- May 2008 ------------------------------------------------------------------ ! + Fixed all legit bugs reported here ! + http://phpwsforums.com/showthread.php?t=5655 Version 0.7.0 -- June 2008 ------------------------------------------------------------------ + Add support for Location(s) and Feature(s) ! + Added a bunch of new views to support those ! + Improved Category views ! + Improved image handling ! + Removed avatar support (it's in My Page > Comments anyways) ! + Improved CSV export ! + A few security tweaks ! + Added en_US language file ! + Added inc/remove_user.php for new user mod features ! + Added a couple date format examples to config.php ! + Consolidated various nav links arrays into one function |
|
From: Verdon V. <ve...@us...> - 2008-06-17 13:28:00
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/conf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22769/conf Modified Files: config.php Log Message: final tidy up for 0.7 release Index: config.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/conf/config.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** config.php 16 Jun 2008 15:59:20 -0000 1.3 --- config.php 17 Jun 2008 13:27:35 -0000 1.4 *************** *** 23,34 **** */ // define('RDX_DATE_FORMAT', '%c'); /* Fri Jun 13 09:50:50 2008 */ // define('RDX_DATE_FORMAT', '%a %b %e %Y'); /* Fri Jun 13 2008 */ - define('RDX_DATE_FORMAT', '%A %B %e, %Y'); /* Friday June 13, 2008 */ // define('RDX_DATE_FORMAT', '%Y/%m/%d'); /* 2008/06/13 */ - define('RDX_MAX_AVATAR_WIDTH', 150); - define('RDX_MAX_AVATAR_HEIGHT', 150); - define('RDX_DEFAULT_LIMIT', 20); --- 23,31 ---- */ + define('RDX_DATE_FORMAT', '%A %B %e, %Y'); /* Friday June 13, 2008 */ // define('RDX_DATE_FORMAT', '%c'); /* Fri Jun 13 09:50:50 2008 */ // define('RDX_DATE_FORMAT', '%a %b %e %Y'); /* Fri Jun 13 2008 */ // define('RDX_DATE_FORMAT', '%Y/%m/%d'); /* 2008/06/13 */ define('RDX_DEFAULT_LIMIT', 20); |
|
From: Verdon V. <ve...@us...> - 2008-06-17 13:28:00
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/class In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22769/class Modified Files: RDX_Forms.php RDX_Member.php RDX_Mypage.php Rolodex.php Log Message: final tidy up for 0.7 release Index: RDX_Forms.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Forms.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** RDX_Forms.php 13 Jun 2008 03:51:17 -0000 1.11 --- RDX_Forms.php 17 Jun 2008 13:27:32 -0000 1.12 *************** *** 708,712 **** $form->addTplTag('CURRENT_IMAGE', $member->getImage(true)); $form->addTplTag('CURRENT_THUMB', $member->getThumbnail(true)); ! $form->setLabel('image', dgettext('rolodex', 'Image (removes existing, may need browser refresh to see updated)')); $form->addText('contact_email', $member->contact_email); --- 708,715 ---- $form->addTplTag('CURRENT_IMAGE', $member->getImage(true)); $form->addTplTag('CURRENT_THUMB', $member->getThumbnail(true)); ! $form->setLabel('image', dgettext('rolodex', 'New Image (Clears current image)')); ! ! $form->addCheckbox('clear_image', 1); ! $form->setLabel('clear_image', dgettext('rolodex', 'Check to clear image')); $form->addText('contact_email', $member->contact_email); *************** *** 782,796 **** $form->setLabel('business_zip_code', dgettext('rolodex', 'Postal/Zip code')); - if (PHPWS_Settings::get('comments', 'allow_avatars')) { - if (PHPWS_Settings::get('comments', 'local_avatars')) { - $form->addFile('avatar'); - $form->addTplTag('CURRENT_AVATAR', $member->getAvatar(true)); - } else { - $form->addText('avatar', $member->getAvatar()); - $form->setSize('avatar', 60); - } - $form->setLabel('avatar', dgettext('comments', 'Avatar')); - } - if (PHPWS_Settings::get('rolodex', 'comments_enable')) { if (PHPWS_Settings::get('rolodex', 'comments_enforce')) { --- 785,788 ---- *************** *** 1032,1038 **** $tpl['TITLE'] = dgettext('rolodex', 'Important Information'); $tpl['INFO_1_LABEL'] = dgettext('rolodex', 'About this module:'); ! $tpl['INFO_1'] = dgettext('rolodex', 'This is an early beta release of this module. There is not much documentation yet, but it will come.'); $tpl['INFO_2_LABEL'] = dgettext('rolodex', 'Bugs:'); ! $tpl['INFO_2'] = sprintf(dgettext('rolodex', 'Please report any bugs or observations of this beta release in %s this post at phpwsforums.com %s'), '<a href="http://phpwsforums.com/showthread.php?t=5655" target="new">', '</a>'); $tpl['INFO_3_LABEL'] = null; $tpl['INFO_3'] = null; --- 1024,1030 ---- $tpl['TITLE'] = dgettext('rolodex', 'Important Information'); $tpl['INFO_1_LABEL'] = dgettext('rolodex', 'About this module:'); ! $tpl['INFO_1'] = dgettext('rolodex', 'This is a second beta release of this module. Many features have been added and it is getting close to final release. Please see docs/CHANGELOG for details.'); $tpl['INFO_2_LABEL'] = dgettext('rolodex', 'Bugs:'); ! $tpl['INFO_2'] = sprintf(dgettext('rolodex', 'Please report any bugs or observations of this beta release in %s this post at phpwsforums.com %s'), '<a href="http://phpwsforums.com/showthread.php?t=5927" target="new">', '</a>'); $tpl['INFO_3_LABEL'] = null; $tpl['INFO_3'] = null; Index: Rolodex.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/Rolodex.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Rolodex.php 16 Jun 2008 18:21:33 -0000 1.10 --- Rolodex.php 17 Jun 2008 13:27:34 -0000 1.11 *************** *** 955,1006 **** - PHPWS_Core::initModClass('filecabinet', 'Image.php'); - - /* begin avatar stuff */ - if (empty($_POST['avatar'])) { - $val['avatar'] = null; - } else { - $image_info = @getimagesize($_POST['avatar']); - if (!$image_info) { - $errors[] = dgettext('rolodex', 'Could not access avatar url.'); - } - } - if (PHPWS_Settings::get('comments', 'allow_avatars')) { - if (PHPWS_Settings::get('comments', 'local_avatars')) { - if (isset($_FILES['avatar']) && !empty($_FILES['avatar']['name'])) { - $image = new PHPWS_Image; - $_FILES['avatar']['name'] = $this->member->user_id . '_' . $_FILES['avatar']['name']; - $image->setDirectory('images/comments/'); - $image->setMaxWidth(COMMENT_MAX_AVATAR_WIDTH); - $image->setMaxHeight(COMMENT_MAX_AVATAR_HEIGHT); - if (!$image->importPost('avatar', false, true)) { - if (isset($image->_errors)) { - foreach ($image->_errors as $oError) { - $errors[] = $oError->getMessage(); - } - } - } else { - $result = $image->write(); - if (PEAR::isError($result)) { - PHPWS_Error::log($result); - $errors[] = array(dgettext('rolodex', 'There was a problem saving your avatar image.')); - } else { - $this->member->setAvatar($image->getPath()); - } - } - } - } else { - if ($this->member->testAvatar(trim($_POST['avatar']))) { - $this->member->setAvatar($_POST['avatar']); - } - } - } else { - $this->member->avatar = NULL; - } - /* end avatar stuff */ - - /* begin image stuff */ if (isset($_FILES['image']) && !empty($_FILES['image']['name'])) { $img_array = null; $image = new PHPWS_Image; --- 955,963 ---- /* begin image stuff */ + PHPWS_Core::initModClass('filecabinet', 'Image.php'); if (isset($_FILES['image']) && !empty($_FILES['image']['name'])) { + $current_image = 'images/rolodex/' . $this->member->image['name']; + $current_thumb = 'images/rolodex/' . $this->member->image['thumb_name']; $img_array = null; $image = new PHPWS_Image; *************** *** 1008,1012 **** $image->setMaxWidth(PHPWS_Settings::get('rolodex', 'max_img_width')); $image->setMaxHeight(PHPWS_Settings::get('rolodex', 'max_img_height')); ! if (!$image->importPost('image', false, true)) { if (isset($image->_errors)) { foreach ($image->_errors as $oError) { --- 965,971 ---- $image->setMaxWidth(PHPWS_Settings::get('rolodex', 'max_img_width')); $image->setMaxHeight(PHPWS_Settings::get('rolodex', 'max_img_height')); ! ! $prefix = sprintf('%s_%s_', $this->member->user_id, mktime()); ! if (!$image->importPost('image', false, true, $prefix)) { if (isset($image->_errors)) { foreach ($image->_errors as $oError) { *************** *** 1014,1019 **** } } ! } else { ! $image->file_name = $this->member->user_id . '.' . $image->getExtension(); $result = $image->write(); if (PEAR::isError($result)) { --- 973,977 ---- } } ! } elseif ($image->file_name) { $result = $image->write(); if (PEAR::isError($result)) { *************** *** 1021,1024 **** --- 979,986 ---- $errors[] = array(dgettext('rolodex', 'There was a problem saving your image.')); } else { + if ($current_image != $image->getPath() && is_file($current_image)) { + @unlink($current_image); + @unlink($current_thumb); + } $img_array['name'] = $image->file_name; $img_array['width'] = $image->width; *************** *** 1026,1029 **** --- 988,992 ---- } } + /* make the thumb */ $source = $image->file_directory . $image->file_name; *************** *** 1040,1043 **** --- 1003,1016 ---- $this->member->setImage($img_array); + } elseif (isset($_POST['clear_image'])) { + $current_image = 'images/rolodex/' . $this->member->image['name']; + $current_thumb = 'images/rolodex/' . $this->member->image['thumb_name']; + if (is_file($current_image)) { + @unlink($current_image); + } + if (is_file($current_thumb)) { + @unlink($current_thumb); + } + $this->member->image = null; } /* end image stuff */ Index: RDX_Mypage.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Mypage.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** RDX_Mypage.php 16 Jun 2008 18:21:33 -0000 1.6 --- RDX_Mypage.php 17 Jun 2008 13:27:34 -0000 1.7 *************** *** 53,64 **** } - /* - $vars2['uop'] = 'list'; - $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')); - */ $links = array_merge($links, Rolodex::navLinks()); --- 53,56 ---- Index: RDX_Member.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Member.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** RDX_Member.php 16 Jun 2008 18:21:33 -0000 1.9 --- RDX_Member.php 17 Jun 2008 13:27:34 -0000 1.10 *************** *** 29,33 **** /* new demographics fields */ - var $avatar = null; var $tollfree_phone = null; var $business_name = null; --- 29,32 ---- *************** *** 183,204 **** - function setAvatar($avatar_url) - { - $this->avatar = $avatar_url; - } - - function getAvatar($print=false) - { - if (empty($this->avatar)) { - return null; - } - if ($print) { - return sprintf('<img src="%s" />', $this->avatar); - } else { - return $this->avatar; - } - } - - function setImage($img_array) { --- 182,185 ---- *************** *** 1820,1838 **** - /** - * Tests an image's url to see if it is the correct file type, - * dimensions, etc. - */ - // Not finished - function testAvatar($url) - { - $test = @getimagesize($url); - if (!$test) { - return false; - } - - return true; - } - } --- 1801,1804 ---- |
|
From: Verdon V. <ve...@us...> - 2008-06-17 13:27:36
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/locale/en_US/LC_MESSAGES In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22769/locale/en_US/LC_MESSAGES Modified Files: rolodex.po Log Message: final tidy up for 0.7 release Index: rolodex.po =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/locale/en_US/LC_MESSAGES/rolodex.po,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** rolodex.po 4 Feb 2008 03:09:18 -0000 1.1.1.1 --- rolodex.po 17 Jun 2008 13:27:38 -0000 1.2 *************** *** 21,22 **** --- 21,883 ---- # #, fuzzy + msgid "" + msgstr "" + "Project-Id-Version: PACKAGE VERSION\n" + "Report-Msgid-Bugs-To: \n" + "POT-Creation-Date: 2008-06-17 08:46-0400\n" + "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" + "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" + "Language-Team: LANGUAGE <LL...@li...>\n" + "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=CHARSET\n" + "Content-Transfer-Encoding: 8bit\n" + + #, php-format + msgid "%s Advanced Search" + msgstr "" + + #, php-format + msgid "%s Categories" + msgstr "" + + #, php-format + msgid "%s Features" + msgstr "" + + #, php-format + msgid "%s Locations" + msgstr "" + + #, php-format + msgid "%s Members" + msgstr "" + + #, php-format + msgid "%s Utilities" + msgstr "" + + #, php-format + msgid "%s expired member(s) were deleted." + msgstr "" + + #, php-format + msgid "%s's Website" + msgstr "" + + msgid "About this module:" + msgstr "" + + msgid "Activate" + msgstr "" + + msgid "Active" + msgstr "" + + msgid "Add Feature" + msgstr "" + + msgid "Add Location" + msgstr "" + + msgid "Add my profile" + msgstr "" + + msgid "Add/Edit member" + msgstr "" + + msgid "Advanced" + msgstr "" + + msgid "All" + msgstr "" + + msgid "All current member records have been indexed with the search module." + msgstr "" + + msgid "All current member records have been removed from the search module." + msgstr "" + + #, php-format + msgid "All expiry dates set to %s days from now." + msgstr "" + + msgid "Allow anonymous comments" + msgstr "" + + msgid "Allow anonymous comments has been set to no on all members." + msgstr "" + + msgid "Allow anonymous comments has been set to yes on all members." + msgstr "" + + msgid "Allow anonymous viewing" + msgstr "" + + msgid "Allow comments has been set to no on all members." + msgstr "" + + msgid "Allow comments has been set to yes on all members." + msgstr "" + + msgid "An error occurred when accessing this feature's members." + msgstr "" + + msgid "An error occurred when accessing this location's members." + msgstr "" + + msgid "" + "Are you sure you want to delete all expired members?\\nEach user's " + "demographic information will be retained for other modules, but all Rolodex " + "information will be permanently removed." + msgstr "" + + #, php-format + msgid "Are you sure you want to delete the feature %s?" + msgstr "" + + #, php-format + msgid "Are you sure you want to delete the location %s?" + msgstr "" + + #, php-format + msgid "" + "Are you sure you want to delete the member %s?\\nDemographic information " + "will be retained for other modules, but all Rolodex member information will " + "be permanently removed." + msgstr "" + + msgid "Available users" + msgstr "" + + msgid "Browse all members" + msgstr "" + + msgid "Browse members" + msgstr "" + + msgid "Bugs:" + msgstr "" + + msgid "Business Address 1" + msgstr "" + + msgid "Business Address 2" + msgstr "" + + msgid "Business City" + msgstr "" + + msgid "Business Country" + msgstr "" + + msgid "Business Postal/Zip" + msgstr "" + + msgid "Business Province/State" + msgstr "" + + msgid "Business address" + msgstr "" + + msgid "Business address 1" + msgstr "" + + msgid "Business address 2" + msgstr "" + + msgid "Business name" + msgstr "" + + msgid "Business/Organization" + msgstr "" + + msgid "Business/Organization name" + msgstr "" + + msgid "CSV Export" + msgstr "" + + msgid "Categories" + msgstr "" + + msgid "Category(s)" + msgstr "" + + msgid "Check to clear image" + msgstr "" + + #, php-format + msgid "Check your %s then create a %s to begin" + msgstr "" + + msgid "Check your admin contact e-mail address for formatting errors." + msgstr "" + + msgid "Check your contact e-mail address for formatting errors." + msgstr "" + + msgid "Check your website address for formatting errors." + msgstr "" + + msgid "City" + msgstr "" + + msgid "Comments Settings" + msgstr "" + + msgid "Comments utilities" + msgstr "" + + msgid "Contact" + msgstr "" + + #, php-format + msgid "Contact e-mail (or leave empty to use %s)" + msgstr "" + + msgid "Contact information" + msgstr "" + + msgid "Contact link" + msgstr "" + + msgid "Continue" + msgstr "" + + msgid "Country" + msgstr "" + + msgid "Create" + msgstr "" + + #, php-format + msgid "Create %s feature" + msgstr "" + + #, php-format + msgid "Create %s location" + msgstr "" + + msgid "Create member profile" + msgstr "" + + msgid "Creation date" + msgstr "" + + msgid "Criteria" + msgstr "" + + msgid "Custom Fields" + msgstr "" + + msgid "Custom field eight name (internal use only)" + msgstr "" + + msgid "Custom field five name (internal use only)" + msgstr "" + + msgid "Custom field four name" + msgstr "" + + msgid "Custom field one name" + msgstr "" + + msgid "Custom field seven name (internal use only)" + msgstr "" + + msgid "Custom field six name (internal use only)" + msgstr "" + + msgid "Custom field three name" + msgstr "" + + msgid "Custom field two name" + msgstr "" + + msgid "Day phone" + msgstr "" + + msgid "Deactivate" + msgstr "" + + msgid "Default expiry interval (in days), if expiry is enabled" + msgstr "" + + msgid "Default sort lists by" + msgstr "" + + msgid "Delete" + msgstr "" + + msgid "Delete all expired members" + msgstr "" + + msgid "Delete member" + msgstr "" + + msgid "Department" + msgstr "" + + msgid "Description" + msgstr "" + + msgid "Details" + msgstr "" + + msgid "E-Mail" + msgstr "" + + msgid "E-mail" + msgstr "" + + msgid "Edit" + msgstr "" + + msgid "Edit feature" + msgstr "" + + msgid "Edit location" + msgstr "" + + msgid "Edit member" + msgstr "" + + msgid "Edit my profile" + msgstr "" + + msgid "Email" + msgstr "" + + msgid "" + "Enable anonymous comment settings on profiles (required for the next Force " + "anonymous setting)" + msgstr "" + + msgid "" + "Enable comment settings on profiles (required for the rest of the Comments " + "Settings)" + msgstr "" + + msgid "Enable comments" + msgstr "" + + msgid "Enable expiry on member profiles" + msgstr "" + + msgid "Error occurred when saving feature." + msgstr "" + + msgid "Error occurred when saving location." + msgstr "" + + msgid "Error occurred when saving member profile." + msgstr "" + + msgid "Error occurred when submitting member profile." + msgstr "" + + msgid "Expiration utilities" + msgstr "" + + #, php-format + msgid "Expired %s Members" + msgstr "" + + #, php-format + msgid "Expired (%s)" + msgstr "" + + msgid "Expiry date" + msgstr "" + + msgid "Export records to csv" + msgstr "" + + msgid "Ext" + msgstr "" + + msgid "Extension" + msgstr "" + + msgid "Extra" + msgstr "" + + msgid "Fax" + msgstr "" + + msgid "Feature deleted." + msgstr "" + + msgid "Feature saved successfully." + msgstr "" + + msgid "Feature(s)" + msgstr "" + + msgid "Features" + msgstr "" + + msgid "First Name" + msgstr "" + + msgid "First name" + msgstr "" + + msgid "Force anonymous comments enabled, on all profiles" + msgstr "" + + msgid "Force comments enabled, on all profiles" + msgstr "" + + msgid "General Settings" + msgstr "" + + msgid "Get Google Map" + msgstr "" + + msgid "Go" + msgstr "" + + msgid "Home Address 1" + msgstr "" + + msgid "Home Address 2" + msgstr "" + + msgid "Home City" + msgstr "" + + msgid "Home Country" + msgstr "" + + msgid "Home Postal/Zip" + msgstr "" + + msgid "Home Province/State" + msgstr "" + + msgid "Home address" + msgstr "" + + msgid "Honorific" + msgstr "" + + msgid "I" + msgstr "" + + #, php-format + msgid "" + "If you would like to help out with the ongoing development of Rolodex, or " + "other modules by Verdon Vaillancourt, %s click here to donate %s (opens in " + "new browser window)." + msgstr "" + + msgid "Image Settings" + msgstr "" + + msgid "Important Information" + msgstr "" + + msgid "Last Name" + msgstr "" + + msgid "Last name" + msgstr "" + + msgid "List Members" + msgstr "" + + msgid "List all features" + msgstr "" + + msgid "List all locations" + msgstr "" + + msgid "Location deleted." + msgstr "" + + msgid "Location saved successfully." + msgstr "" + + msgid "Location(s)" + msgstr "" + + msgid "Locations" + msgstr "" + + msgid "Mailing address 1" + msgstr "" + + msgid "Mailing address 2" + msgstr "" + + msgid "Manage a member directory of any sort." + msgstr "" + + #, php-format + msgid "Manage my %s profile" + msgstr "" + + msgid "Maximum image height (50-600)" + msgstr "" + + msgid "Maximum image height for locations/features (20-400)" + msgstr "" + + msgid "Maximum image width (50-600)" + msgstr "" + + msgid "Maximum image width for locations/features (20-400)" + msgstr "" + + msgid "Maximum thumbnail height (40-200)" + msgstr "" + + msgid "Maximum thumbnail width (40-200)" + msgstr "" + + msgid "Member profile saved successfully." + msgstr "" + + msgid "Member profile submitted successfully. An admin will review." + msgstr "" + + msgid "Members only" + msgstr "" + + msgid "Miscellaneous" + msgstr "" + + msgid "Most Recent Member" + msgstr "" + + msgid "Most recent" + msgstr "" + + msgid "New Feature" + msgstr "" + + msgid "New Image (Clears current image)" + msgstr "" + + msgid "New Location" + msgstr "" + + msgid "New Member" + msgstr "" + + msgid "New member step one" + msgstr "" + + msgid "No" + msgstr "" + + msgid "No choices configured." + msgstr "" + + msgid "Not Active" + msgstr "" + + msgid "Other" + msgstr "" + + #, php-format + msgid "Pending %s Application" + msgstr "" + + msgid "Phone numbers" + msgstr "" + + msgid "Please provide a module title." + msgstr "" + + #, php-format + msgid "" + "Please report any bugs or observations of this beta release in %s this post " + "at phpwsforums.com %s" + msgstr "" + + msgid "Position title" + msgstr "" + + msgid "Postal/Zip code" + msgstr "" + + msgid "Privacy Settings" + msgstr "" + + msgid "Privacy level" + msgstr "" + + msgid "Private" + msgstr "" + + msgid "Profile" + msgstr "" + + msgid "Province/State" + msgstr "" + + msgid "Public" + msgstr "" + + msgid "Random" + msgstr "" + + msgid "Random Member" + msgstr "" + + msgid "Read me" + msgstr "" + + msgid "Register all current rolodex records to the search module" + msgstr "" + + msgid "Register records in search module" + msgstr "" + + msgid "Remove all current rolodex records from the search module" + msgstr "" + + msgid "Require approval for new profiles" + msgstr "" + + msgid "Reset \"Allow anonymous comments\" on all records to no" + msgstr "" + + msgid "Reset \"Allow anonymous comments\" on all records to yes" + msgstr "" + + msgid "Reset \"Allow comments\" on all records to no" + msgstr "" + + msgid "Reset \"Allow comments\" on all records to yes" + msgstr "" + + #, php-format + msgid "Reset all expiry dates to %s days from now" + msgstr "" + + msgid "Restricted users" + msgstr "" + + msgid "Rolodex" + msgstr "" + + msgid "Rolodex images removed." + msgstr "" + + msgid "Rolodex member activated." + msgstr "" + + msgid "Rolodex member deactivated." + msgstr "" + + msgid "Rolodex member deleted." + msgstr "" + + msgid "Rolodex member is missing user id." + msgstr "" + + msgid "Rolodex settings saved." + msgstr "" + + msgid "Rolodex tables dropped." + msgstr "" + + msgid "Save settings" + msgstr "" + + msgid "Search" + msgstr "" + + #, php-format + msgid "Search %s" + msgstr "" + + msgid "" + "Search indexing is disabled in Rolodex settings. You must enable it there " + "before you may perform this action." + msgstr "" + + msgid "" + "Search indexing is enabled in Rolodex settings. You must disable it there " + "before you may perform this action." + msgstr "" + + msgid "Search utilities" + msgstr "" + + msgid "Semi-private" + msgstr "" + + msgid "Send notification of pending applications" + msgstr "" + + msgid "Settings" + msgstr "" + + msgid "Show on home only" + msgstr "" + + msgid "Show rolodex block" + msgstr "" + + msgid "" + "Sorry, anonymous member viewing is not allowed. You will need to login to " + "view this directory." + msgstr "" + + msgid "" + "Sorry, anonymous member viewing is not allowed. You will need to login to " + "view this member." + msgstr "" + + msgid "Sorry, no features are available at this time." + msgstr "" + + msgid "Sorry, no locations are available at this time." + msgstr "" + + msgid "" + "Sorry, no members are available at this time. Try broadening your search or " + "returning later." + msgstr "" + + msgid "" + "Sorry, there are no users available. You will have to create a user account " + "first." + msgstr "" + + msgid "Sorry, this membership has expired." + msgstr "" + + msgid "Sorry, this user has restricted privacy settings." + msgstr "" + + msgid "Sorry, your access does not allow CSV exporting." + msgstr "" + + msgid "Submit" + msgstr "" + + msgid "Submit member profile" + msgstr "" + + msgid "Submit my profile" + msgstr "" + + msgid "The admin contact email address for this module" + msgstr "" + + msgid "" + "The display title for this module, eg. Members, or Businesses, or Contacts" + msgstr "" + + msgid "There was a problem deleting the image." + msgstr "" + + msgid "" + "There was a problem deleting the rolodex images. You may want to do it " + "manually." + msgstr "" + + msgid "There was a problem saving your image." + msgstr "" + + msgid "There was a problem saving your thumbnail image." + msgstr "" + + msgid "There were no expired records to delete." + msgstr "" + + msgid "" + "This is a second beta release of this module. Many features have " + "been added and it is getting close to final release. Please see " + "docs/CHANGELOG for details." + msgstr "" + + msgid "Title" + msgstr "" + + msgid "Toll-free phone" + msgstr "" + + msgid "Tollfree" + msgstr "" + + #, php-format + msgid "Unapproved %s Members" + msgstr "" + + #, php-format + msgid "Unapproved (%s)" + msgstr "" + + msgid "Update" + msgstr "" + + #, php-format + msgid "Update %s feature" + msgstr "" + + #, php-format + msgid "Update %s location" + msgstr "" + + msgid "Update member profile" + msgstr "" + + msgid "Updated" + msgstr "" + + msgid "Updated date" + msgstr "" + + msgid "User options" + msgstr "" + + msgid "Utilities" + msgstr "" + + msgid "Utilities, Locations, Features & Change settings (Unrestricted only)" + msgstr "" + + msgid "View private members" + msgstr "" + + msgid "Web" + msgstr "" + + msgid "Web site" + msgstr "" + + msgid "Website" + msgstr "" + + msgid "Website link" + msgstr "" + + msgid "Yes" + msgstr "" + + #, php-format + msgid "You have a new %s application from %s waiting for your review at %s." + msgstr "" + + msgid "You may only edit your own profile." + msgstr "" + + msgid "" + "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." + msgstr "" + + msgid "You must give this feature a title." + msgstr "" + + msgid "You must give this location a title." + msgstr "" |
|
From: Verdon V. <ve...@us...> - 2008-06-17 13:27:34
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22769/templates Modified Files: edit_member.tpl list_feature.tpl list_location.tpl Log Message: final tidy up for 0.7 release Index: list_location.tpl =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/templates/list_location.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** list_location.tpl 12 Jun 2008 21:18:55 -0000 1.1 --- list_location.tpl 17 Jun 2008 13:27:39 -0000 1.2 *************** *** 9,13 **** <!-- BEGIN listrows --> <tr {TOGGLE}> ! <td>{TITLE}</td> <td>{DESCRIPTION}</td> <td>{ACTION}</td> --- 9,13 ---- <!-- BEGIN listrows --> <tr {TOGGLE}> ! <td nowrap="nowrap">{TITLE}</td> <td>{DESCRIPTION}</td> <td>{ACTION}</td> Index: edit_member.tpl =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/templates/edit_member.tpl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** edit_member.tpl 11 Jun 2008 17:43:36 -0000 1.4 --- edit_member.tpl 17 Jun 2008 13:27:39 -0000 1.5 *************** *** 22,26 **** <p>{DESCRIPTION} {DESCRIPTION_LABEL}</p> <p>{IMAGE} {IMAGE_LABEL}</p> ! <p>{CURRENT_IMAGE} {CURRENT_THUMB}</p> </fieldset> <fieldset> --- 22,26 ---- <p>{DESCRIPTION} {DESCRIPTION_LABEL}</p> <p>{IMAGE} {IMAGE_LABEL}</p> ! <!-- BEGIN current_image --><p>{CURRENT_IMAGE} {CURRENT_THUMB} {CLEAR_IMAGE} {CLEAR_IMAGE_LABEL}</p><!-- END current_image --> </fieldset> <fieldset> *************** *** 56,61 **** <p>{ACTIVE} {ACTIVE_LABEL}</p> <p>{PRIVACY} {PRIVACY_LABEL}</p> - <p>{AVATAR} {AVATAR_LABEL}</p> - <p>{CURRENT_AVATAR}</p> </fieldset> <!-- BEGIN meta_group_label --> --- 56,59 ---- Index: list_feature.tpl =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/templates/list_feature.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** list_feature.tpl 12 Jun 2008 21:18:55 -0000 1.1 --- list_feature.tpl 17 Jun 2008 13:27:39 -0000 1.2 *************** *** 9,13 **** <!-- BEGIN listrows --> <tr {TOGGLE}> ! <td>{TITLE}</td> <td>{DESCRIPTION}</td> <td>{ACTION}</td> --- 9,13 ---- <!-- BEGIN listrows --> <tr {TOGGLE}> ! <td nowrap="nowrap">{TITLE}</td> <td>{DESCRIPTION}</td> <td>{ACTION}</td> |
|
From: Verdon V. <ve...@us...> - 2008-06-16 18:21:40
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/class In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12343/class Modified Files: RDX_Feature.php RDX_Location.php RDX_Member.php RDX_Mypage.php Rolodex.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.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RDX_Feature.php 16 Jun 2008 15:59:19 -0000 1.2 --- RDX_Feature.php 16 Jun 2008 18:21:32 -0000 1.3 *************** *** 276,284 **** } ! $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Browse members'), 'rolodex', array('uop'=>'list')); ! $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')); if($links) --- 276,280 ---- } ! $links = array_merge($links, Rolodex::navLinks()); if($links) Index: RDX_Location.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Location.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RDX_Location.php 16 Jun 2008 15:59:19 -0000 1.2 --- RDX_Location.php 16 Jun 2008 18:21:33 -0000 1.3 *************** *** 274,283 **** $links[] = PHPWS_Text::secureLink(dgettext('rolodex', 'Edit location'), 'rolodex', $vars); } ! ! $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Browse members'), 'rolodex', array('uop'=>'list')); ! $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')); if($links) --- 274,279 ---- $links[] = PHPWS_Text::secureLink(dgettext('rolodex', 'Edit location'), 'rolodex', $vars); } ! ! $links = array_merge($links, Rolodex::navLinks()); if($links) Index: Rolodex.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/Rolodex.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Rolodex.php 13 Jun 2008 03:51:17 -0000 1.9 --- Rolodex.php 16 Jun 2008 18:21:33 -0000 1.10 *************** *** 1377,1380 **** --- 1377,1413 ---- + function navLinks() + { + + $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Browse members'), 'rolodex', array('uop'=>'list')); + + $db = new PHPWS_DB('category_items'); + $db->addWhere('module', 'rolodex'); + $categories = $db->count(); + if ($categories > 0) { + $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Categories'), "rolodex", array('uop'=>'categories')); + } + + $db = new PHPWS_DB('rolodex_location'); + $locations = $db->count(); + if ($locations > 0) { + $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Locations'), "rolodex", array('uop'=>'locations')); + } + + $db = new PHPWS_DB('rolodex_feature'); + $features = $db->count(); + if ($features > 0) { + $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Features'), "rolodex", array('uop'=>'features')); + } + + $db = new PHPWS_DB('rolodex_feature'); + $features = $db->count(); + if ($categories > 0 || $locations > 0 || $features > 0) { + $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Advanced'), "rolodex", array('uop'=>'advanced')); + } + + return $links; + } + function alpha_click() { *************** *** 1404,1408 **** $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Other'), "rolodex", $vars) . "\n"; $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'All'), "rolodex", array('uop'=>'list')) . "\n"; - // $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Categories'), "rolodex", array('uop'=>'categories')) . "\n"; } elseif (@$_REQUEST['aop'] == "list_expired") { $vars['aop'] = 'list_expired'; --- 1437,1440 ---- *************** *** 1410,1414 **** $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Other'), "rolodex", $vars) . "\n"; $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'All'), "rolodex", array('aop'=>'list_expired')) . "\n"; - // $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Categories'), "rolodex", array('uop'=>'categories')) . "\n"; } else { $vars['uop'] = 'list'; --- 1442,1445 ---- *************** *** 1416,1426 **** $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Other'), "rolodex", $vars) . "\n"; $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'All'), "rolodex", array('uop'=>'list')) . "\n"; - // $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Categories'), "rolodex", array('uop'=>'categories')) . "\n"; } ! $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['LIST'] = implode(' | ', $alpha); --- 1447,1453 ---- $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Other'), "rolodex", $vars) . "\n"; $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'All'), "rolodex", array('uop'=>'list')) . "\n"; } ! $links = $this->navLinks(); $tpl['LIST'] = implode(' | ', $alpha); *************** *** 1550,1567 **** } ! if ($multiple) { ! $form = new PHPWS_Form; ! $form->addMultiple($select_name, $items); ! if (!empty($match) && is_array($match)) { ! $form->setMatch($select_name, $match); } - return $form->get($select_name); } else { ! $form = new PHPWS_Form; ! $form->addSelect($select_name, $items); ! if (!empty($match) && is_string($match)) { ! $form->setMatch($select_name, $match); ! } ! return $form->get($select_name); } --- 1577,1598 ---- } ! if ($items) { ! if ($multiple) { ! $form = new PHPWS_Form; ! $form->addMultiple($select_name, $items); ! if (!empty($match) && is_array($match)) { ! $form->setMatch($select_name, $match); ! } ! return $form->get($select_name); ! } else { ! $form = new PHPWS_Form; ! $form->addSelect($select_name, $items); ! if (!empty($match) && is_string($match)) { ! $form->setMatch($select_name, $match); ! } ! return $form->get($select_name); } } else { ! return dgettext('rolodex', 'No choices configured.'); } *************** *** 1592,1609 **** } ! if ($multiple) { ! $form = new PHPWS_Form; ! $form->addMultiple($select_name, $items); ! if (!empty($match) && is_array($match)) { ! $form->setMatch($select_name, $match); } - return $form->get($select_name); } else { ! $form = new PHPWS_Form; ! $form->addSelect($select_name, $items); ! if (!empty($match) && is_string($match)) { ! $form->setMatch($select_name, $match); ! } ! return $form->get($select_name); } --- 1623,1644 ---- } ! if ($items) { ! if ($multiple) { ! $form = new PHPWS_Form; ! $form->addMultiple($select_name, $items); ! if (!empty($match) && is_array($match)) { ! $form->setMatch($select_name, $match); ! } ! return $form->get($select_name); ! } else { ! $form = new PHPWS_Form; ! $form->addSelect($select_name, $items); ! if (!empty($match) && is_string($match)) { ! $form->setMatch($select_name, $match); ! } ! return $form->get($select_name); } } else { ! return dgettext('rolodex', 'No choices configured.'); } Index: RDX_Mypage.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Mypage.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RDX_Mypage.php 16 Jun 2008 15:59:19 -0000 1.5 --- RDX_Mypage.php 16 Jun 2008 18:21:33 -0000 1.6 *************** *** 24,27 **** --- 24,28 ---- + PHPWS_Core::initModClass('rolodex', 'Rolodex.php'); class Rolodex_Mypage { *************** *** 51,54 **** --- 52,57 ---- } } + + /* $vars2['uop'] = 'list'; $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Browse members'), 'rolodex', $vars2); *************** *** 57,60 **** --- 60,66 ---- $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Features'), "rolodex", array('uop'=>'features')); $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Advanced'), "rolodex", array('uop'=>'advanced')); + */ + $links = array_merge($links, Rolodex::navLinks()); + $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.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** RDX_Member.php 16 Jun 2008 15:59:19 -0000 1.8 --- RDX_Member.php 16 Jun 2008 18:21:33 -0000 1.9 *************** *** 138,148 **** $result = $db->select('col'); if ($print) { ! PHPWS_Core::initModClass('rolodex', 'RDX_Location.php'); ! foreach ($result as $id){ ! $location = new Rolodex_Location($id); ! if ($nolink) { ! $link[] = $location->getTitle(true); ! } else { ! $link[] = $location->viewLink(); } } --- 138,152 ---- $result = $db->select('col'); if ($print) { ! if (empty($result)) { ! $link[] = null; ! } else { ! PHPWS_Core::initModClass('rolodex', 'RDX_Location.php'); ! foreach ($result as $id){ ! $location = new Rolodex_Location($id); ! if ($nolink) { ! $link[] = $location->getTitle(true); ! } else { ! $link[] = $location->viewLink(); ! } } } *************** *** 160,170 **** $result = $db->select('col'); if ($print) { ! PHPWS_Core::initModClass('rolodex', 'RDX_Feature.php'); ! foreach ($result as $id){ ! $feature = new Rolodex_Feature($id); ! if ($nolink) { ! $link[] = $feature->getTitle(true); ! } else { ! $link[] = $feature->viewLink(); } } --- 164,178 ---- $result = $db->select('col'); if ($print) { ! if (empty($result)) { ! $link[] = null; ! } else { ! PHPWS_Core::initModClass('rolodex', 'RDX_Feature.php'); ! foreach ($result as $id){ ! $feature = new Rolodex_Feature($id); ! if ($nolink) { ! $link[] = $feature->getTitle(true); ! } else { ! $link[] = $feature->viewLink(); ! } } } *************** *** 1085,1093 **** $links[] = $this->editLink(); } ! $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Browse members'), 'rolodex', array('uop'=>'list')); ! $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')); if($links) --- 1093,1098 ---- $links[] = $this->editLink(); } ! ! $links = array_merge($links, Rolodex::navLinks()); if($links) |
|
From: Verdon V. <ve...@us...> - 2008-06-16 18:21:40
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12343/docs Modified Files: TODO Log Message: tweaks to support features locations etc Index: TODO =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/docs/TODO,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TODO 16 Jun 2008 15:59:21 -0000 1.9 --- TODO 16 Jun 2008 18:21:44 -0000 1.10 *************** *** 25,30 **** ##################### - - - test location and feature items removal to delete user/member update language files --- 25,27 ---- |
|
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() . '",'; |
|
From: Verdon V. <ve...@us...> - 2008-06-16 15:59:42
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/boost In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24656/boost Modified Files: permission.php update.php Log Message: tweaks to support features locations etc Index: permission.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/boost/permission.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** permission.php 8 Feb 2008 19:38:45 -0000 1.2 --- permission.php 16 Jun 2008 15:59:15 -0000 1.3 *************** *** 29,33 **** $permissions['delete_member'] = dgettext('rolodex', 'Delete member'); $permissions['view_privates'] = dgettext('rolodex', 'View private members'); ! $permissions['settings'] = dgettext('rolodex', 'Utilities & Change settings (Unrestricted only)'); ?> \ No newline at end of file --- 29,33 ---- $permissions['delete_member'] = dgettext('rolodex', 'Delete member'); $permissions['view_privates'] = dgettext('rolodex', 'View private members'); ! $permissions['settings'] = dgettext('rolodex', 'Utilities, Locations, Features & Change settings (Unrestricted only)'); ?> \ No newline at end of file Index: update.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/boost/update.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** update.php 13 Jun 2008 13:40:55 -0000 1.3 --- update.php 16 Jun 2008 15:59:15 -0000 1.4 *************** *** 44,47 **** --- 44,48 ---- 'templates/list_feature.tpl', 'templates/list_category.tpl', + 'templates/list_member.tpl', 'templates/view_location.tpl', 'templates/view_feature.tpl', |
|
From: Verdon V. <ve...@us...> - 2008-06-16 15:59:16
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24656/docs Modified Files: TODO Log Message: tweaks to support features locations etc Index: TODO =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/docs/TODO,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TODO 13 Jun 2008 13:40:58 -0000 1.8 --- TODO 16 Jun 2008 15:59:21 -0000 1.9 *************** *** 27,31 **** ! security for edit/post/delete location and feature ! cats, locations, features to the export function ! add location and feature items removal to delete user/member --- 27,30 ---- ! test location and feature items removal to delete user/member ! update language files |
|
From: Verdon V. <ve...@us...> - 2008-06-16 15:59:16
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/conf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24656/conf Modified Files: config.php Log Message: tweaks to support features locations etc Index: config.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/conf/config.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** config.php 10 Jun 2008 17:15:15 -0000 1.2 --- config.php 16 Jun 2008 15:59:20 -0000 1.3 *************** *** 23,29 **** */ ! //define('RDX_DATE_FORMAT', '%c'); ! define('RDX_DATE_FORMAT', '%a %b %e %Y'); ! //define('RDX_DATE_FORMAT', '%Y/%m/%d'); define('RDX_MAX_AVATAR_WIDTH', 150); --- 23,30 ---- */ ! // define('RDX_DATE_FORMAT', '%c'); /* Fri Jun 13 09:50:50 2008 */ ! // define('RDX_DATE_FORMAT', '%a %b %e %Y'); /* Fri Jun 13 2008 */ ! define('RDX_DATE_FORMAT', '%A %B %e, %Y'); /* Friday June 13, 2008 */ ! // define('RDX_DATE_FORMAT', '%Y/%m/%d'); /* 2008/06/13 */ define('RDX_MAX_AVATAR_WIDTH', 150); |
|
From: Verdon V. <ve...@us...> - 2008-06-13 13:41:21
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/boost In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8173/boost Modified Files: update.php Log Message: add remove_user inc file Index: update.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/boost/update.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** update.php 13 Jun 2008 03:51:13 -0000 1.2 --- update.php 13 Jun 2008 13:40:55 -0000 1.3 *************** *** 48,51 **** --- 48,52 ---- 'templates/view_member.tpl', 'templates/view_category.tpl', + 'templates/adv_search_form.tpl', 'templates/edit_settings.tpl' ); |
|
From: Verdon V. <ve...@us...> - 2008-06-13 13:40:54
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/inc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8173/inc Added Files: remove_user.php Log Message: add remove_user inc file --- NEW FILE: remove_user.php --- <?php /** * rolodex - phpwebsite module * * See docs/AUTHORS and docs/COPYRIGHT for relevant info. * * 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. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @version $Id: remove_user.php,v 1.1 2008/06/13 13:41:00 verdonv Exp $ * @author Verdon Vaillancourt <verdonv at users dot sourceforge dot net> */ function rolodex_remove_user($user_id) { PHPWS_Core::initModClass('rolodex', 'RDX_Member.php'); $member = new Rolodex_member((int)$user_id); if (!$member->user_id) { return; } return $member->deleteMember(); } ?> |
|
From: Verdon V. <ve...@us...> - 2008-06-13 13:40:53
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8173/docs Modified Files: TODO Log Message: add remove_user inc file Index: TODO =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/docs/TODO,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TODO 12 Jun 2008 21:18:53 -0000 1.7 --- TODO 13 Jun 2008 13:40:58 -0000 1.8 *************** *** 29,30 **** --- 29,31 ---- security for edit/post/delete location and feature cats, locations, features to the export function + add location and feature items removal to delete user/member |
|
From: Verdon V. <ve...@us...> - 2008-06-13 03:51:40
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/boost In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11911/boost Modified Files: update.php Log Message: new category views Index: update.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/boost/update.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** update.php 12 Jun 2008 21:18:48 -0000 1.1 --- update.php 13 Jun 2008 03:51:13 -0000 1.2 *************** *** 43,49 **** --- 43,51 ---- 'templates/list_location.tpl', 'templates/list_feature.tpl', + 'templates/list_category.tpl', 'templates/view_location.tpl', 'templates/view_feature.tpl', 'templates/view_member.tpl', + 'templates/view_category.tpl', 'templates/edit_settings.tpl' ); |
|
From: Verdon V. <ve...@us...> - 2008-06-13 03:51:12
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11911/templates Modified Files: adv_search_form.tpl Added Files: list_category.tpl view_category.tpl Log Message: new category views Index: adv_search_form.tpl =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/templates/adv_search_form.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** adv_search_form.tpl 12 Jun 2008 21:18:55 -0000 1.1 --- adv_search_form.tpl 13 Jun 2008 03:51:18 -0000 1.2 *************** *** 5,8 **** --- 5,9 ---- <p>{LOCATION_LABEL}<br />{LOCATION_SELECT}</p> <p>{FEATURE_LABEL}<br />{FEATURE_SELECT}</p> + <p>{CATEGORY_LABEL}<br />{CATEGORY_SELECT}</p> </fieldset> {SUBMIT} --- NEW FILE: list_category.tpl --- {ALPHA_CLICK} <table width="99%" cellpadding="4"> <tr> <th>{TITLE_HEADER} {TITLE_SORT}</th> <th>{DESCRIPTION_HEADER} {DESCRIPTION_SORT}</th> <th> </th> </tr> <!-- BEGIN listrows --> <tr {TOGGLE}> <td nowrap="nowrap">{TITLE}</td> <td>{DESCRIPTION}</td> <td>{ICON}</td> </tr> <!-- END listrows --> </table> {EMPTY_MESSAGE} <div class="align-center"> {TOTAL_ROWS}<br /> {PAGE_LABEL} {PAGES}<br /> {LIMIT_LABEL} {LIMITS} </div> <div class="align-right"> {SEARCH} </div> --- NEW FILE: view_category.tpl --- <div id="rolodex-category"> <div align="right">{CATEGORY_LINKS}</div> <div style="float: right; margin: 0 0 .2em .5em;">{IMAGE}</div> <p>{DESCRIPTION}</p> <br style="clear: right;" /> <!-- BEGIN empty --><p>{EMPTY}</p><!-- END empty --> <!-- BEGIN current-members --> <div class="rolodex-member"> <fieldset><legend>{MEMBER_TITLE}</legend> <p>{MEMBER_DESCRIPTION}</p> <p>{MEMBER_LINKS}</p> </fieldset> </div> <!-- END current-members --> </div> |
|
From: Verdon V. <ve...@us...> - 2008-06-13 03:51:11
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/class In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11911/class Modified Files: RDX_Forms.php Rolodex.php Log Message: new category views Index: RDX_Forms.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Forms.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** RDX_Forms.php 12 Jun 2008 21:18:52 -0000 1.10 --- RDX_Forms.php 13 Jun 2008 03:51:17 -0000 1.11 *************** *** 225,228 **** --- 225,236 ---- } + /* search by category */ + if (isset($_REQUEST['categories'])) { + $pager->db->addColumn('category_items.*'); + $pager->db->addWhere('rolodex_member.key_id', 'category_items.key_id'); + $pager->db->addWhere('category_items.cat_id', $_REQUEST['categories']); + $pager->db->addGroupBy('category_items.key_id'); + } + /* the default sort order */ $pager->setOrder($sortby, 'asc', true); *************** *** 347,350 **** --- 355,403 ---- + function listCategories() + { + + $ptags['TITLE_HEADER'] = dgettext('rolodex', 'Title'); + $ptags['DESCRIPTION_HEADER'] = dgettext('rolodex', 'Description'); + $ptags['ALPHA_CLICK'] = $this->rolodex->alpha_click(); + + PHPWS_Core::initCoreClass('DBPager.php'); + $pager = new DBPager('categories'); + $pager->setModule('rolodex'); + $pager->setOrder('title', 'asc', true); + $pager->setTemplate('list_category.tpl'); + $num = $pager->getTotalRows(); + $pager->addRowFunction(array('Rolodex_Forms', 'listCatsRow')); + $pager->addPageTags($ptags); + $pager->addToggle('class="toggle1"'); + $pager->setSearch('title', 'description'); + + // $pager->db->setTestMode(); + $this->rolodex->content = $pager->get(); + $this->rolodex->title = sprintf(dgettext('rolodex', '%s Categories'), PHPWS_Settings::get('rolodex', 'module_title')); + } + + + function listCatsRow($value) + { + $db = new PHPWS_DB('category_items'); + $db->addWhere('cat_id', $value['id']); + $db->addWhere('module', 'rolodex'); + $num = $db->count(); + $tpl['TITLE'] = PHPWS_Text::moduleLink($value['title'], "rolodex", array('uop'=>'view_category', 'category'=>$value['id'])) . ' ('.$num.')'; + + if (empty($value['description'])) { + $tpl['DESCRIPTION'] = ''; + } else { + $tpl['DESCRIPTION'] = substr(ltrim(strip_tags(str_replace('<br />', ' ', PHPWS_Text::parseOutput($value['description'])))), 0, 120) . ' ...'; + } + + PHPWS_Core::initModClass('filecabinet', 'Cabinet.php'); + $tpl['ICON'] = Cabinet::getTag($value['icon']); + + return $tpl; + } + + function advSearchForm() { *************** *** 360,365 **** --- 413,420 ---- $tpl['LOCATION_SELECT'] = $this->rolodex->getItemSelect('location', null, 'locations'); $tpl['FEATURE_SELECT'] = $this->rolodex->getItemSelect('feature', null, 'features'); + $tpl['CATEGORY_SELECT'] = $this->rolodex->getCatSelect(null, 'categories'); $tpl['LOCATION_LABEL'] = dgettext('rolodex', 'Location(s)'); $tpl['FEATURE_LABEL'] = dgettext('rolodex', 'Feature(s)'); + $tpl['CATEGORY_LABEL'] = dgettext('rolodex', 'Category(s)'); $tpl['CRITERIA_LABEL'] = dgettext('rolodex', 'Criteria'); Index: Rolodex.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/Rolodex.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Rolodex.php 12 Jun 2008 21:18:52 -0000 1.8 --- Rolodex.php 13 Jun 2008 03:51:17 -0000 1.9 *************** *** 29,38 **** class Rolodex { ! var $forms = null; ! var $panel = null; ! var $title = null; ! var $message = null; ! var $content = null; ! var $member = null; --- 29,41 ---- class Rolodex { ! var $forms = null; ! var $panel = null; ! var $title = null; ! var $message = null; ! var $content = null; ! var $member = null; ! var $location = null; ! var $feature = null; ! var $category = null; *************** *** 330,334 **** $this->forms = new Rolodex_Forms; $this->forms->rolodex = & $this; ! $this->forms->categories(); } break; --- 333,338 ---- $this->forms = new Rolodex_Forms; $this->forms->rolodex = & $this; ! // $this->forms->categories(); ! $this->forms->listCategories(); } break; *************** *** 465,468 **** --- 469,478 ---- break; + case 'view_category': + $this->loadCategory(); + $this->title = $this->category->getTitle(); + $this->content = $this->categoryView(); + break; + *************** *** 543,546 **** --- 553,573 ---- + function loadCategory($id=0) + { + PHPWS_Core::initModClass('categories', 'Category.php'); + + if ($id) { + $this->category = new Category($id); + } elseif (isset($_REQUEST['category_id'])) { + $this->category = new Category($_REQUEST['category_id']); + } elseif (isset($_REQUEST['category'])) { + $this->category = new Category($_REQUEST['category']); + } else { + $this->category = new Category($_REQUEST['id']); + } + + } + + function loadPanel() { *************** *** 1260,1263 **** --- 1287,1380 ---- + 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(); + + $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Browse members'), 'rolodex', array('uop'=>'list')); + $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')); + if($links) + $template['CATEGORY_LINKS'] = implode(' | ', $links); + + $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 alpha_click() { *************** *** 1452,1455 **** --- 1569,1614 ---- + function getCatSelect($match=null, $select_name='categories', $multiple=true, $count=true) + { + + PHPWS_Core::initModClass('categories', 'Category.php'); + $db = new PHPWS_DB('categories'); + $db->addOrder('title asc'); + + $result = $db->getObjects('Category'); + + if ($result) { + foreach ($result as $item) { + if ($count) { + $db = new PHPWS_DB('category_items'); + $db->addWhere('cat_id', $item->id); + $db->addWhere('module', 'rolodex'); + $qty = $db->count(); + $items[$item->id] = $item->title . ' ('.$qty.')'; + } else { + $items[$item->id] = $item->title; + } + } + } + + if ($multiple) { + $form = new PHPWS_Form; + $form->addMultiple($select_name, $items); + if (!empty($match) && is_array($match)) { + $form->setMatch($select_name, $match); + } + return $form->get($select_name); + } else { + $form = new PHPWS_Form; + $form->addSelect($select_name, $items); + if (!empty($match) && is_string($match)) { + $form->setMatch($select_name, $match); + } + return $form->get($select_name); + } + + } + + |
|
From: Verdon V. <ve...@us...> - 2008-06-12 21:19:17
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/class In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26163/class Modified Files: RDX_Forms.php RDX_Member.php Rolodex.php Added Files: RDX_Feature.php RDX_Location.php Log Message: add support for locations and features --- NEW FILE: RDX_Feature.php --- <?php /** * rolodex - phpwebsite module * * See docs/AUTHORS and docs/COPYRIGHT for relevant info. * * 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. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @version $Id: RDX_Feature.php,v 1.1 2008/06/12 21:18:52 verdonv Exp $ * @author Verdon Vaillancourt <verdonv at users dot sourceforge dot net> */ class Rolodex_Feature { var $id = 0; var $title = null; var $description = null; var $image_id = 0; var $_error = null; function Rolodex_Feature($id=0) { if (!$id) { return; } $this->id = (int)$id; $this->init(); } function init() { $db = new PHPWS_DB('rolodex_feature'); $result = $db->loadObject($this); if (PEAR::isError($result)) { $this->_error = & $result; $this->id = 0; } elseif (!$result) { $this->id = 0; } } function setTitle($title) { $this->title = strip_tags($title); } function setDescription($description) { $this->description = PHPWS_Text::parseInput($description); } function setImage_id($image_id) { $this->image_id = $image_id; } function getTitle($print=false) { if (empty($this->title)) { return null; } if ($print) { return PHPWS_Text::parseOutput($this->title); } else { return $this->title; } } function getDescription($print=false) { if (empty($this->description)) { return null; } if ($print) { return PHPWS_Text::parseOutput($this->description); } else { return $this->description; } } function getListDescription($length=60) { if (empty($this->description)) { return ''; } return substr(ltrim(strip_tags(str_replace('<br />', ' ', $this->getDescription(true)))), 0, $length) . ' ...'; } function getQtyMembers() { $db = new PHPWS_DB('rolodex_feature_items'); $db->addWhere('feature_id', $this->id); $num = $db->count(); return $num; } function getFile() { if (!$this->image_id) { return null; } return Cabinet::getTag($this->image_id); } 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', 'edit_feature')) { $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', 'edit_feature')) { $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() { if (!$this->id) { return; } $db = new PHPWS_DB('rolodex_feature'); $db->addWhere('id', $this->id); PHPWS_Error::logIfError($db->delete()); $db = new PHPWS_DB('rolodex_feature_items'); $db->addWhere('feature_id', $this->id); PHPWS_Error::logIfError($db->delete()); } 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() { $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); $js['QUESTION'] = sprintf(dgettext('rolodex', 'Are you sure you want to delete the feature %s?'), $this->getTitle()); $js['LINK'] = dgettext('rolodex', 'Delete'); $links[] = javascript('confirm', $js); } $tpl['TITLE'] = $this->viewLink() . ' ('.$this->getQtyMembers().')'; $tpl['DESCRIPTION'] = $this->getListDescription(120); if($links) $tpl['ACTION'] = implode(' | ', $links); return $tpl; } function featureLinks() { if (Current_User::allow('rolodex', 'settings')) { $vars['feature'] = $this->id; $vars['aop'] = 'edit_feature'; $links[] = PHPWS_Text::secureLink(dgettext('rolodex', 'Edit feature'), 'rolodex', $vars); } $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Browse members'), 'rolodex', array('uop'=>'list')); $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')); if($links) return implode(' | ', $links); } function save() { $db = new PHPWS_DB('rolodex_feature'); $result = $db->saveObject($this); if (PEAR::isError($result)) { return $result; } } function viewLink() { // return PHPWS_Text::rewriteLink($this->title, 'rolodex', $this->id); $vars['uop'] = 'view_feature'; $vars['feature'] = $this->id; return PHPWS_Text::moduleLink(dgettext('rolodex', $this->title), 'rolodex', $vars); } } ?> Index: RDX_Forms.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Forms.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** RDX_Forms.php 11 Jun 2008 17:43:32 -0000 1.9 --- RDX_Forms.php 12 Jun 2008 21:18:52 -0000 1.10 *************** *** 131,134 **** --- 131,135 ---- function listMembers($approved=null, $expired=false) { + //print_r($_REQUEST); exit; /* init the classes */ PHPWS_Core::initModClass('rolodex', 'RDX_Member.php'); *************** *** 155,160 **** --- 156,163 ---- $pager->db->addColumn('demographics.*'); $pager->db->addColumn('rolodex_member.*'); + $pager->db->addWhere('rolodex_member.user_id', 'demographics.user_id'); + /* approved yes/no */ if (isset($approved)) { *************** *** 205,208 **** --- 208,227 ---- } } + + /* search by location */ + if (isset($_REQUEST['locations'])) { + $pager->db->addColumn('rolodex_location_items.*'); + $pager->db->addWhere('rolodex_member.user_id', 'rolodex_location_items.member_id'); + $pager->db->addWhere('rolodex_location_items.location_id', $_REQUEST['locations']); + $pager->db->addGroupBy('rolodex_location_items.member_id'); + } + + /* search by feature */ + if (isset($_REQUEST['features'])) { + $pager->db->addColumn('rolodex_feature_items.*'); + $pager->db->addWhere('rolodex_member.user_id', 'rolodex_feature_items.member_id'); + $pager->db->addWhere('rolodex_feature_items.feature_id', $_REQUEST['features']); + $pager->db->addGroupBy('rolodex_feature_items.member_id'); + } /* the default sort order */ *************** *** 256,259 **** --- 275,279 ---- $ptags['TITLE_HEADER'] = dgettext('rolodex', 'Title'); $ptags['DESCRIPTION_HEADER'] = dgettext('rolodex', 'Description'); + $ptags['ALPHA_CLICK'] = $this->rolodex->alpha_click(); PHPWS_Core::initModClass('rolodex', 'RDX_Location.php'); *************** *** 261,265 **** $pager = new DBPager('rolodex_location', 'Rolodex_Location'); $pager->setModule('rolodex'); ! $pager->setOrder('title', 'asc', true); $pager->setTemplate('list_location.tpl'); $pager->addRowTags('rowTag'); --- 281,286 ---- $pager = new DBPager('rolodex_location', 'Rolodex_Location'); $pager->setModule('rolodex'); ! // $pager->setOrder('title', 'asc', true); ! $pager->setDefaultOrder('title', 'asc', true); $pager->setTemplate('list_location.tpl'); $pager->addRowTags('rowTag'); *************** *** 282,285 **** --- 303,307 ---- $pager->addToggle('class="toggle1"'); $pager->setSearch('title', 'description'); + // $pager->addSortHeader('title', dgettext('rolodex', 'Title')); $this->rolodex->content = $pager->get(); *************** *** 292,295 **** --- 314,318 ---- $ptags['TITLE_HEADER'] = dgettext('rolodex', 'Title'); $ptags['DESCRIPTION_HEADER'] = dgettext('rolodex', 'Description'); + $ptags['ALPHA_CLICK'] = $this->rolodex->alpha_click(); PHPWS_Core::initModClass('rolodex', 'RDX_Feature.php'); *************** *** 324,327 **** --- 347,373 ---- + function advSearchForm() + { + $form = new PHPWS_Form('rolodex_adv_search'); + + $form->addHidden('module', 'rolodex'); + $form->addHidden('uop', 'adv_search'); + + $form->addSubmit(dgettext('rolodex', 'Go')); + $tpl = $form->getTemplate(); + + $tpl['ALPHA_CLICK'] = $this->rolodex->alpha_click(); + $tpl['LOCATION_SELECT'] = $this->rolodex->getItemSelect('location', null, 'locations'); + $tpl['FEATURE_SELECT'] = $this->rolodex->getItemSelect('feature', null, 'features'); + $tpl['LOCATION_LABEL'] = dgettext('rolodex', 'Location(s)'); + $tpl['FEATURE_LABEL'] = dgettext('rolodex', 'Feature(s)'); + $tpl['CRITERIA_LABEL'] = dgettext('rolodex', 'Criteria'); + + $this->rolodex->title = sprintf(dgettext('rolodex', '%s Advanced Search'), PHPWS_Settings::get('rolodex', 'module_title')); + $this->rolodex->content = PHPWS_Template::process($tpl, 'rolodex', 'adv_search_form.tpl'); + + } + + function editSettings() { *************** *** 780,785 **** $tpl['CATEGORIES'] = Categories::getForm($match=$member->get_categories(), $select_name='categories', $multiple=true); ! $tpl['LOCATIONS'] = $this->rolodex->getForm('location', $match=$member->get_locations(), $select_name='locations', $multiple=true); ! $tpl['FEATURES'] = $this->rolodex->getForm('feature', $match=$member->get_features(), $select_name='features', $multiple=true); $tpl['CATEGORIES_LABEL'] = dgettext('rolodex', 'Category(s)'); $tpl['LOCATIONS_LABEL'] = dgettext('rolodex', 'Location(s)'); --- 826,831 ---- $tpl['CATEGORIES'] = Categories::getForm($match=$member->get_categories(), $select_name='categories', $multiple=true); ! $tpl['LOCATIONS'] = $this->rolodex->getItemForm('location', $match=$member->get_locations(), $select_name='locations', $multiple=true); ! $tpl['FEATURES'] = $this->rolodex->getItemForm('feature', $match=$member->get_features(), $select_name='features', $multiple=true); $tpl['CATEGORIES_LABEL'] = dgettext('rolodex', 'Category(s)'); $tpl['LOCATIONS_LABEL'] = dgettext('rolodex', 'Location(s)'); --- NEW FILE: RDX_Location.php --- <?php /** * rolodex - phpwebsite module * * See docs/AUTHORS and docs/COPYRIGHT for relevant info. * * 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. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @version $Id: RDX_Location.php,v 1.1 2008/06/12 21:18:52 verdonv Exp $ * @author Verdon Vaillancourt <verdonv at users dot sourceforge dot net> */ class Rolodex_Location { var $id = 0; var $title = null; var $description = null; var $image_id = 0; var $_error = null; function Rolodex_Location($id=0) { if (!$id) { return; } $this->id = (int)$id; $this->init(); } function init() { $db = new PHPWS_DB('rolodex_location'); $result = $db->loadObject($this); if (PEAR::isError($result)) { $this->_error = & $result; $this->id = 0; } elseif (!$result) { $this->id = 0; } } function setTitle($title) { $this->title = strip_tags($title); } function setDescription($description) { $this->description = PHPWS_Text::parseInput($description); } function setImage_id($image_id) { $this->image_id = $image_id; } function getTitle($print=false) { if (empty($this->title)) { return null; } if ($print) { return PHPWS_Text::parseOutput($this->title); } else { return $this->title; } } function getDescription($print=false) { if (empty($this->description)) { return null; } if ($print) { return PHPWS_Text::parseOutput($this->description); } else { return $this->description; } } function getListDescription($length=60){ if (empty($this->description)) { return ''; } return substr(ltrim(strip_tags(str_replace('<br />', ' ', $this->getDescription(true)))), 0, $length) . ' ...'; } function getQtyMembers() { $db = new PHPWS_DB('rolodex_location_items'); $db->addWhere('location_id', $this->id); $num = $db->count(); return $num; } function getFile() { if (!$this->image_id) { return null; } return Cabinet::getTag($this->image_id); } 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', 'edit_location')) { $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', 'edit_location')) { $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() { if (!$this->id) { return; } $db = new PHPWS_DB('rolodex_location'); $db->addWhere('id', $this->id); PHPWS_Error::logIfError($db->delete()); $db = new PHPWS_DB('rolodex_location_items'); $db->addWhere('location_id', $this->id); PHPWS_Error::logIfError($db->delete()); } 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() { $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); $js['QUESTION'] = sprintf(dgettext('rolodex', 'Are you sure you want to delete the location %s?'), $this->getTitle()); $js['LINK'] = dgettext('rolodex', 'Delete'); $links[] = javascript('confirm', $js); } $tpl['TITLE'] = $this->viewLink() . ' ('.$this->getQtyMembers().')'; $tpl['DESCRIPTION'] = $this->getListDescription(120); if($links) $tpl['ACTION'] = implode(' | ', $links); return $tpl; } function locationLinks() { if (Current_User::allow('rolodex', 'settings')) { $vars['location'] = $this->id; $vars['aop'] = 'edit_location'; $links[] = PHPWS_Text::secureLink(dgettext('rolodex', 'Edit location'), 'rolodex', $vars); } $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Browse members'), 'rolodex', array('uop'=>'list')); $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')); if($links) return implode(' | ', $links); } function save() { $db = new PHPWS_DB('rolodex_location'); $result = $db->saveObject($this); if (PEAR::isError($result)) { return $result; } } function viewLink() { // return PHPWS_Text::rewriteLink($this->title, 'rolodex', $this->id); $vars['uop'] = 'view_location'; $vars['location'] = $this->id; return PHPWS_Text::moduleLink(dgettext('rolodex', $this->title), 'rolodex', $vars); } } ?> Index: Rolodex.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/Rolodex.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Rolodex.php 11 Jun 2008 17:43:32 -0000 1.7 --- Rolodex.php 12 Jun 2008 21:18:52 -0000 1.8 *************** *** 216,220 **** $this->location->delete(); $this->message = dgettext('rolodex', 'Location deleted.'); ! $this->loadForm('list'); break; --- 216,220 ---- $this->location->delete(); $this->message = dgettext('rolodex', 'Location deleted.'); ! $this->loadForm('locations'); break; *************** *** 242,246 **** $this->feature->delete(); $this->message = dgettext('rolodex', 'Feature deleted.'); ! $this->loadForm('list'); break; --- 242,246 ---- $this->feature->delete(); $this->message = dgettext('rolodex', 'Feature deleted.'); ! $this->loadForm('features'); break; *************** *** 334,337 **** --- 334,385 ---- break; + case 'locations': + if (!PHPWS_Settings::get('rolodex', 'allow_anon') && !Current_User::getId()) { + $this->title = PHPWS_Settings::get('rolodex', 'module_title'); + $this->content = dgettext('rolodex', 'Sorry, anonymous member viewing is not allowed. You will need to login to view this directory.'); + } else { + PHPWS_Core::initModClass('rolodex', 'RDX_Forms.php'); + $this->forms = new Rolodex_Forms; + $this->forms->rolodex = & $this; + $this->forms->listLocations(); + } + break; + + case 'features': + if (!PHPWS_Settings::get('rolodex', 'allow_anon') && !Current_User::getId()) { + $this->title = PHPWS_Settings::get('rolodex', 'module_title'); + $this->content = dgettext('rolodex', 'Sorry, anonymous member viewing is not allowed. You will need to login to view this directory.'); + } else { + PHPWS_Core::initModClass('rolodex', 'RDX_Forms.php'); + $this->forms = new Rolodex_Forms; + $this->forms->rolodex = & $this; + $this->forms->listFeatures(); + } + break; + + case 'advanced': + if (!PHPWS_Settings::get('rolodex', 'allow_anon') && !Current_User::getId()) { + $this->title = PHPWS_Settings::get('rolodex', 'module_title'); + $this->content = dgettext('rolodex', 'Sorry, anonymous member viewing is not allowed. You will need to login to view this directory.'); + } else { + PHPWS_Core::initModClass('rolodex', 'RDX_Forms.php'); + $this->forms = new Rolodex_Forms; + $this->forms->rolodex = & $this; + $this->forms->advSearchForm(); + } + break; + + case 'adv_search': + if (!PHPWS_Settings::get('rolodex', 'allow_anon') && !Current_User::getId()) { + $this->title = PHPWS_Settings::get('rolodex', 'module_title'); + $this->content = dgettext('rolodex', 'Sorry, anonymous member viewing is not allowed. You will need to login to view this directory.'); + } else { + PHPWS_Core::initModClass('rolodex', 'RDX_Forms.php'); + $this->forms = new Rolodex_Forms; + $this->forms->rolodex = & $this; + $this->forms->listMembers(1); + } + break; + case 'export': PHPWS_Core::initModClass('rolodex', 'RDX_Member.php'); *************** *** 469,472 **** --- 517,522 ---- } elseif (isset($_REQUEST['location'])) { $this->location = new Rolodex_Location($_REQUEST['location']); + } elseif (isset($_REQUEST['id'])) { + $this->location = new Rolodex_Location($_REQUEST['id']); } else { $this->location = new Rolodex_Location; *************** *** 485,488 **** --- 535,540 ---- } elseif (isset($_REQUEST['feature'])) { $this->feature = new Rolodex_Feature($_REQUEST['feature']); + } elseif (isset($_REQUEST['id'])) { + $this->feature = new Rolodex_Feature($_REQUEST['id']); } else { $this->feature = new Rolodex_Feature; *************** *** 994,1000 **** } ! if (empty($_POST['description'])) { ! $errors[] = dgettext('rolodex', 'You must give this location a description.'); ! } else { $this->location->setDescription($_POST['description']); } --- 1046,1050 ---- } ! if (isset($_POST['description'])) { $this->location->setDescription($_POST['description']); } *************** *** 1024,1030 **** } ! if (empty($_POST['description'])) { ! $errors[] = dgettext('rolodex', 'You must give this feature a description.'); ! } else { $this->feature->setDescription($_POST['description']); } --- 1074,1078 ---- } ! if (isset($_POST['description'])) { $this->feature->setDescription($_POST['description']); } *************** *** 1217,1220 **** --- 1265,1269 ---- $alphabet = $this->alphabet(); $alpha = array(); + $links = array(); foreach ($alphabet as $alphachar) { if (@$_REQUEST['uop'] == "list") { *************** *** 1238,1242 **** $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Other'), "rolodex", $vars) . "\n"; $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'All'), "rolodex", array('uop'=>'list')) . "\n"; ! $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Categories'), "rolodex", array('uop'=>'categories')) . "\n"; } elseif (@$_REQUEST['aop'] == "list_expired") { $vars['aop'] = 'list_expired'; --- 1287,1291 ---- $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Other'), "rolodex", $vars) . "\n"; $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'All'), "rolodex", array('uop'=>'list')) . "\n"; ! // $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Categories'), "rolodex", array('uop'=>'categories')) . "\n"; } elseif (@$_REQUEST['aop'] == "list_expired") { $vars['aop'] = 'list_expired'; *************** *** 1244,1248 **** $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Other'), "rolodex", $vars) . "\n"; $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'All'), "rolodex", array('aop'=>'list_expired')) . "\n"; ! $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Categories'), "rolodex", array('uop'=>'categories')) . "\n"; } else { $vars['uop'] = 'list'; --- 1293,1297 ---- $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Other'), "rolodex", $vars) . "\n"; $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'All'), "rolodex", array('aop'=>'list_expired')) . "\n"; ! // $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Categories'), "rolodex", array('uop'=>'categories')) . "\n"; } else { $vars['uop'] = 'list'; *************** *** 1250,1257 **** $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Other'), "rolodex", $vars) . "\n"; $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'All'), "rolodex", array('uop'=>'list')) . "\n"; ! $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Categories'), "rolodex", array('uop'=>'categories')) . "\n"; } $tpl['LIST'] = implode(' | ', $alpha); return PHPWS_Template::process($tpl, 'rolodex', 'alpha_click.tpl'); --- 1299,1312 ---- $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Other'), "rolodex", $vars) . "\n"; $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'All'), "rolodex", array('uop'=>'list')) . "\n"; ! // $alpha[] .= PHPWS_Text::moduleLink(dgettext('rolodex', 'Categories'), "rolodex", array('uop'=>'categories')) . "\n"; } + $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['LIST'] = implode(' | ', $alpha); + $tpl['LINKS'] = implode(' | ', $links); return PHPWS_Template::process($tpl, 'rolodex', 'alpha_click.tpl'); *************** *** 1294,1298 **** * @access public */ ! function getForm($type='location', $match=null, $select_name='location', $multiple=true) { --- 1349,1353 ---- * @access public */ ! function getItemForm($type='location', $match=null, $select_name='location', $multiple=true) { *************** *** 1312,1317 **** } ! foreach ($result as $item) { ! $items[$item->id] = $item->title; } --- 1367,1374 ---- } ! if ($result) { ! foreach ($result as $item) { ! $items[$item->id] = $item->title; ! } } *************** *** 1345,1348 **** --- 1402,1455 ---- + function getItemSelect($type='location', $match=null, $select_name='location', $multiple=true, $count=true) + { + + switch($type) { + case 'location': + PHPWS_Core::initModClass('rolodex', 'RDX_Location.php'); + $db = new PHPWS_DB('rolodex_location'); + $db->addOrder('title asc'); + $result = $db->getObjects('Rolodex_Location'); + break; + case 'feature': + PHPWS_Core::initModClass('rolodex', 'RDX_Feature.php'); + $db = new PHPWS_DB('rolodex_feature'); + $db->addOrder('title asc'); + $result = $db->getObjects('Rolodex_Feature'); + break; + } + + if ($result) { + foreach ($result as $item) { + if ($count) { + $db = new PHPWS_DB('rolodex_'.$type.'_items'); + $db->addWhere($type.'_id', $item->id); + $qty = $db->count(); + $items[$item->id] = $item->title . ' ('.$qty.')'; + } else { + $items[$item->id] = $item->title; + } + } + } + + if ($multiple) { + $form = new PHPWS_Form; + $form->addMultiple($select_name, $items); + if (!empty($match) && is_array($match)) { + $form->setMatch($select_name, $match); + } + return $form->get($select_name); + } else { + $form = new PHPWS_Form; + $form->addSelect($select_name, $items); + if (!empty($match) && is_string($match)) { + $form->setMatch($select_name, $match); + } + return $form->get($select_name); + } + + } + + Index: RDX_Member.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Member.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** RDX_Member.php 11 Jun 2008 17:43:32 -0000 1.6 --- RDX_Member.php 12 Jun 2008 21:18:52 -0000 1.7 *************** *** 115,138 **** } function get_locations($print=false) { if ($print) { ! $result = 'code this'; ! } else { ! $result = unserialize($this->locations); ! } ! return $result; } function get_features($print=false) { if ($print) { ! $result = 'code this'; ! } else { ! $result = unserialize($this->features); ! } ! return $result; } function setAvatar($avatar_url) { --- 115,155 ---- } + function get_locations($print=false) { + $db = new PHPWS_DB('rolodex_location_items'); + $db->addWhere('member_id', (int)$this->user_id); + $db->addColumn('location_id'); + $result = $db->select('col'); if ($print) { ! PHPWS_Core::initModClass('rolodex', 'RDX_Location.php'); ! foreach ($result as $id){ ! $location = new Rolodex_Location($id); ! $link[] = $location->viewLink(); ! } ! $result = $link; ! } ! return $result; } + function get_features($print=false) { + $db = new PHPWS_DB('rolodex_feature_items'); + $db->addWhere('member_id', (int)$this->user_id); + $db->addColumn('feature_id'); + $result = $db->select('col'); if ($print) { ! PHPWS_Core::initModClass('rolodex', 'RDX_Feature.php'); ! foreach ($result as $id){ ! $feature = new Rolodex_Feature($id); ! $link[] = $feature->viewLink(); ! } ! $result = $link; ! } ! return $result; } + function setAvatar($avatar_url) { *************** *** 1042,1061 **** function memberLinks() { ! ! if (Current_User::allow('rolodex', 'edit_member') || $this->isMine()) { ! if ($this->isMine()) { ! $vars['user_id'] = $this->user_id; ! $vars['uop'] = 'edit_member'; ! $links[] = PHPWS_Text::secureLink(dgettext('rolodex', 'Edit my profile'), 'rolodex', $vars); ! } else { ! $vars['user_id'] = $this->user_id; ! $vars['aop'] = 'edit_member'; ! $links[] = PHPWS_Text::secureLink(dgettext('rolodex', 'Edit member'), 'rolodex', $vars); ! } } ! ! $vars2['uop'] = 'list'; ! $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Browse members'), 'rolodex', $vars2); $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Categories'), "rolodex", array('uop'=>'categories')); if($links) --- 1059,1070 ---- function memberLinks() { ! if ($this->editLink()) { ! $links[] = $this->editLink(); } ! $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Browse members'), 'rolodex', array('uop'=>'list')); $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')); if($links) *************** *** 1099,1102 **** --- 1108,1120 ---- } + if ($this->get_locations(true)) { + $tpl['LOCATION_LINKS'] = implode(', ', $this->get_locations(true)); + $tpl['LOCATION_LINKS_LABEL'] = dgettext('rolodex', 'Location(s)'); + } + if ($this->get_features(true)) { + $tpl['FEATURE_LINKS'] = implode(', ', $this->get_features(true)); + $tpl['FEATURE_LINKS_LABEL'] = dgettext('rolodex', 'Feature(s)'); + } + $tpl['PROFILE_GROUP_LABEL'] = dgettext('rolodex', 'Profile'); $tpl['COURTESY_TITLE'] = $this->getCourtesy_title(true); *************** *** 1290,1293 **** --- 1308,1338 ---- + function editLink() + { + if (Current_User::allow('rolodex', 'edit_member') || $this->isMine()) { + if ($this->isMine()) { + $vars['user_id'] = $this->user_id; + $vars['uop'] = 'edit_member'; + $link = PHPWS_Text::secureLink(dgettext('rolodex', 'Edit my profile'), 'rolodex', $vars); + } else { + $vars['user_id'] = $this->user_id; + $vars['aop'] = 'edit_member'; + $link = PHPWS_Text::secureLink(dgettext('rolodex', 'Edit member'), 'rolodex', $vars); + } + } + return $link; + } + + + function viewTpl() + { + $template['MEMBER_TITLE'] = $this->viewLink(); + $template['MEMBER_DESCRIPTION'] = $this->getDescription(true); + $template['MEMBER_LINKS'] = $this->editLink(); + + return $template; + } + + function getGoogleMap($location='mailing') { *************** *** 1439,1443 **** } ! if (isset($_POST['categories'])) { $db = new PHPWS_DB('category_items'); $db->addWhere('key_id', (int)$this->key_id); --- 1484,1488 ---- } ! if (isset($_POST['categories']) && $_POST['categories'][0] !== '0') { $db = new PHPWS_DB('category_items'); $db->addWhere('key_id', (int)$this->key_id); *************** *** 1453,1462 **** } ! if (isset($_POST['locations'])) { } else { } ! if (isset($_POST['features'])) { } else { } --- 1498,1525 ---- } ! if (isset($_POST['locations']) && $_POST['locations'][0] !== '0') { ! $db = new PHPWS_DB('rolodex_location_items'); ! $db->addWhere('member_id', (int)$this->user_id); ! PHPWS_Error::logIfError($db->delete()); ! foreach ($_POST['locations'] as $var => $val) { ! $this->addItem('location', $val, $this->user_id); ! } } else { + $db = new PHPWS_DB('rolodex_location_items'); + $db->addWhere('member_id', (int)$this->user_id); + PHPWS_Error::logIfError($db->delete()); } ! if (isset($_POST['features']) && $_POST['features'][0] !== '0') { ! $db = new PHPWS_DB('rolodex_feature_items'); ! $db->addWhere('member_id', (int)$this->user_id); ! PHPWS_Error::logIfError($db->delete()); ! foreach ($_POST['features'] as $var => $val) { ! $this->addItem('feature', $val, $this->user_id); ! } } else { + $db = new PHPWS_DB('rolodex_feature_items'); + $db->addWhere('member_id', (int)$this->user_id); + PHPWS_Error::logIfError($db->delete()); } *************** *** 1506,1509 **** --- 1569,1586 ---- + function addItem($type, $item_id, $member_id) + { + if ($type =='location') { + $db = new PHPWS_DB('rolodex_location_items'); + $db->addValue('location_id', (int)$item_id); + } elseif ($type =='feature') { + $db = new PHPWS_DB('rolodex_feature_items'); + $db->addValue('feature_id', (int)$item_id); + } + $db->addValue('member_id', (int)$member_id); + return $db->insert(); + } + + function isDataVisible($group) { |
|
From: Verdon V. <ve...@us...> - 2008-06-12 21:19:16
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/boost In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26163/boost Modified Files: install.sql Added Files: sql_update_070.sql update.php Log Message: add support for locations and features --- NEW FILE: sql_update_070.sql --- -- rolodex - phpwebsite module -- @version $Id: sql_update_070.sql,v 1.1 2008/06/12 21:18:48 verdonv Exp $ -- @author Verdon Vaillancourt <verdonv at users dot sourceforge dot net> CREATE TABLE rolodex_location ( id int not null default 0, title varchar(80) not null, description text, image_id INT NOT NULL default 0, PRIMARY KEY (id) ); CREATE TABLE rolodex_feature ( id int not null default 0, title varchar(80) not null, description text, image_id INT NOT NULL default 0, PRIMARY KEY (id) ); CREATE TABLE rolodex_location_items ( location_id int NOT NULL default 0, member_id int NOT NULL default 0 ); CREATE TABLE rolodex_feature_items ( feature_id int NOT NULL default 0, member_id int NOT NULL default 0 ); Index: install.sql =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/boost/install.sql,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** install.sql 11 Jun 2008 17:43:28 -0000 1.2 --- install.sql 12 Jun 2008 21:18:48 -0000 1.3 *************** *** 44,53 **** ); ! CREATE TABLE rolodex_loc_items ( location_id int NOT NULL default 0, member_id int NOT NULL default 0 ); ! CREATE TABLE rolodex_fea_items ( feature_id int NOT NULL default 0, member_id int NOT NULL default 0 --- 44,53 ---- ); ! CREATE TABLE rolodex_location_items ( location_id int NOT NULL default 0, member_id int NOT NULL default 0 ); ! CREATE TABLE rolodex_feature_items ( feature_id int NOT NULL default 0, member_id int NOT NULL default 0 --- NEW FILE: update.php --- <?php /** * rolodex - phpwebsite module * * See docs/AUTHORS and docs/COPYRIGHT for relevant info. * * 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. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @version $Id: update.php,v 1.1 2008/06/12 21:18:48 verdonv Exp $ * @author Verdon Vaillancourt <verdonv at users dot sourceforge dot net> */ function rolodex_update(&$content, $currentVersion) { $home_dir = PHPWS_Boost::getHomeDir(); switch ($currentVersion) { case version_compare($currentVersion, '0.7.0', '<'): $result = PHPWS_DB::importFile(PHPWS_SOURCE_DIR . 'mod/rolodex/boost/sql_update_070.sql'); if (PEAR::isError($result)) { PHPWS_Error::log($result); $content[] = '+ Unable to add the location and feature tables.'; return false; } else { $content[] = '<pre>'; $files = array('templates/edit_location.tpl', 'templates/edit_feature.tpl', 'templates/edit_member.tpl', 'templates/list_location.tpl', 'templates/list_feature.tpl', 'templates/view_location.tpl', 'templates/view_feature.tpl', 'templates/view_member.tpl', 'templates/edit_settings.tpl' ); rolodexUpdateFiles($files, $content); $content[] = '0.7.0 changes ---------------- + Added support for locations and features </pre>'; } } // end switch return true; } function rolodexUpdateFiles($files, &$content) { if (PHPWS_Boost::updateFiles($files, 'rolodex')) { $content[] = '--- Updated the following files:'; } else { $content[] = '--- Unable to update the following files:'; } $content[] = " " . implode("\n ", $files); } ?> |
|
From: Verdon V. <ve...@us...> - 2008-06-12 21:18:50
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26163/templates Modified Files: alpha_click.tpl view_member.tpl Added Files: adv_search_form.tpl edit_feature.tpl edit_location.tpl list_feature.tpl list_location.tpl view_feature.tpl view_location.tpl Log Message: add support for locations and features Index: alpha_click.tpl =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/templates/alpha_click.tpl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** alpha_click.tpl 4 Feb 2008 03:09:18 -0000 1.1.1.1 --- alpha_click.tpl 12 Jun 2008 21:18:55 -0000 1.2 *************** *** 1 **** ! <div class="rolodex-alphalist" style="text-align: right;">{LIST}</div> \ No newline at end of file --- 1 ---- ! <div class="rolodex-alphalist" style="text-align: right;">{LIST}<br />{LINKS}</div> \ No newline at end of file --- NEW FILE: list_location.tpl --- {ALPHA_CLICK} <!-- BEGIN add_link --><div align="right">{ADD_LINK}</div><!-- END add_link --> <table width="99%" cellpadding="4"> <tr> <th>{TITLE_HEADER} {TITLE_SORT}</th> <th>{DESCRIPTION_HEADER} {DESCRIPTION_SORT}</th> <th> </th> </tr> <!-- BEGIN listrows --> <tr {TOGGLE}> <td>{TITLE}</td> <td>{DESCRIPTION}</td> <td>{ACTION}</td> </tr> <!-- END listrows --> </table> {EMPTY_MESSAGE} <div class="align-center"> {TOTAL_ROWS}<br /> {PAGE_LABEL} {PAGES}<br /> {LIMIT_LABEL} {LIMITS} </div> <div class="align-right"> {SEARCH} </div> --- NEW FILE: adv_search_form.tpl --- {ALPHA_CLICK} {START_FORM} <fieldset> <legend><strong>{CRITERIA_LABEL}</strong></legend> <p>{LOCATION_LABEL}<br />{LOCATION_SELECT}</p> <p>{FEATURE_LABEL}<br />{FEATURE_SELECT}</p> </fieldset> {SUBMIT} {END_FORM} --- NEW FILE: view_location.tpl --- <div id="rolodex-location"> <div align="right">{LOCATION_LINKS}</div> <div style="float: right; margin: 0 0 .2em .5em;">{IMAGE}</div> <p>{DESCRIPTION}</p> <br style="clear: right;" /> <!-- BEGIN empty --><p>{EMPTY}</p><!-- END empty --> <!-- BEGIN current-members --> <div class="rolodex-member"> <fieldset><legend>{MEMBER_TITLE}</legend> <p>{MEMBER_DESCRIPTION}</p> <p>{MEMBER_LINKS}</p> </fieldset> </div> <!-- END current-members --> </div> --- NEW FILE: edit_location.tpl --- {START_FORM} <fieldset> <legend><strong>{DETAILS_LABEL}</strong></legend> <p>{TITLE} {TITLE_LABEL}</p> <p>{DESCRIPTION} {DESCRIPTION_LABEL}</p> <p>{IMAGE_MANAGER} {IMAGE_MANAGER_LABEL}</p> <p>{FILE_MANAGER}</p> </fieldset> {SUBMIT} {END_FORM} --- NEW FILE: list_feature.tpl --- {ALPHA_CLICK} <!-- BEGIN add_link --><div align="right">{ADD_LINK}</div><!-- END add_link --> <table width="99%" cellpadding="4"> <tr> <th>{TITLE_HEADER} {TITLE_SORT}</th> <th>{DESCRIPTION_HEADER} {DESCRIPTION_SORT}</th> <th> </th> </tr> <!-- BEGIN listrows --> <tr {TOGGLE}> <td>{TITLE}</td> <td>{DESCRIPTION}</td> <td>{ACTION}</td> </tr> <!-- END listrows --> </table> {EMPTY_MESSAGE} <div class="align-center"> {TOTAL_ROWS}<br /> {PAGE_LABEL} {PAGES}<br /> {LIMIT_LABEL} {LIMITS} </div> <div class="align-right"> {SEARCH} </div> Index: view_member.tpl =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/templates/view_member.tpl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** view_member.tpl 10 Jun 2008 17:15:18 -0000 1.3 --- view_member.tpl 12 Jun 2008 21:18:55 -0000 1.4 *************** *** 10,13 **** --- 10,15 ---- <br style="clear: right;" /> <!-- BEGIN category_links --><p><strong>{CATEGORY_LINKS_LABEL}:</strong> {CATEGORY_LINKS}</p><!-- END category_links --> + <!-- BEGIN location_links --><p><strong>{LOCATION_LINKS_LABEL}:</strong> {LOCATION_LINKS}</p><!-- END location_links --> + <!-- BEGIN feature_links --><p><strong>{FEATURE_LINKS_LABEL}:</strong> {FEATURE_LINKS}</p><!-- END feature_links --> <fieldset> <legend><strong>{CONTACT_GROUP_LABEL}</strong></legend> --- NEW FILE: view_feature.tpl --- <div id="rolodex-feature"> <div align="right">{FEATURE_LINKS}</div> <div style="float: right; margin: 0 0 .2em .5em;">{IMAGE}</div> <p>{DESCRIPTION}</p> <br style="clear: right;" /> <!-- BEGIN empty --><p>{EMPTY}</p><!-- END empty --> <!-- BEGIN current-members --> <div class="rolodex-member"> <fieldset><legend>{MEMBER_TITLE}</legend> <p>{MEMBER_DESCRIPTION}</p> <p>{MEMBER_LINKS}</p> </fieldset> </div> <!-- END current-members --> </div> --- NEW FILE: edit_feature.tpl --- {START_FORM} <fieldset> <legend><strong>{DETAILS_LABEL}</strong></legend> <p>{TITLE} {TITLE_LABEL}</p> <p>{DESCRIPTION} {DESCRIPTION_LABEL}</p> <p>{IMAGE_MANAGER} {IMAGE_MANAGER_LABEL}</p> <p>{FILE_MANAGER}</p> </fieldset> {SUBMIT} {END_FORM} |
|
From: Verdon V. <ve...@us...> - 2008-06-12 21:18:50
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26163/docs Modified Files: TODO Log Message: add support for locations and features Index: TODO =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/docs/TODO,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TODO 11 Jun 2008 17:43:33 -0000 1.6 --- TODO 12 Jun 2008 21:18:53 -0000 1.7 *************** *** 27,30 **** ! security for edit/post/delete location cats, locations, features to the export function --- 27,30 ---- ! security for edit/post/delete location and feature cats, locations, features to the export function |
|
From: Verdon V. <ve...@us...> - 2008-06-11 17:44:08
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/boost In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8749/boost Modified Files: boost.php install.sql Log Message: adding locations and features Index: install.sql =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/boost/install.sql,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** install.sql 4 Feb 2008 03:09:15 -0000 1.1.1.1 --- install.sql 11 Jun 2008 17:43:28 -0000 1.2 *************** *** 28,29 **** --- 28,55 ---- CREATE INDEX rolodexmember_idx on rolodex_member(key_id); + CREATE TABLE rolodex_location ( + id int not null default 0, + title varchar(80) not null, + description text, + image_id INT NOT NULL default 0, + PRIMARY KEY (id) + ); + + CREATE TABLE rolodex_feature ( + id int not null default 0, + title varchar(80) not null, + description text, + image_id INT NOT NULL default 0, + PRIMARY KEY (id) + ); + + CREATE TABLE rolodex_loc_items ( + location_id int NOT NULL default 0, + member_id int NOT NULL default 0 + ); + + CREATE TABLE rolodex_fea_items ( + feature_id int NOT NULL default 0, + member_id int NOT NULL default 0 + ); + Index: boost.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/boost/boost.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** boost.php 4 Feb 2008 03:09:14 -0000 1.1.1.1 --- boost.php 11 Jun 2008 17:43:28 -0000 1.2 *************** *** 24,28 **** $proper_name = 'Rolodex'; ! $version = '0.5.0'; $image_dir = true; $import_sql = true; --- 24,28 ---- $proper_name = 'Rolodex'; ! $version = '0.7.0'; $image_dir = true; $import_sql = true; |
|
From: Verdon V. <ve...@us...> - 2008-06-11 17:44:08
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8749/docs Modified Files: CHANGELOG TODO Log Message: adding locations and features Index: TODO =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/docs/TODO,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TODO 10 Jun 2008 17:15:17 -0000 1.5 --- TODO 11 Jun 2008 17:43:33 -0000 1.6 *************** *** 25,26 **** --- 25,30 ---- ##################### + + + security for edit/post/delete location + cats, locations, features to the export function Index: CHANGELOG =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/docs/CHANGELOG,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** CHANGELOG 4 Feb 2008 03:09:17 -0000 1.1.1.1 --- CHANGELOG 11 Jun 2008 17:43:33 -0000 1.2 *************** *** 3,4 **** --- 3,17 ---- + Initial rough-in + Version 0.5.0 -- Mar 2008 + ------------------------------------------------------------------ + + Beta release + + Version 0.6.0 -- May 2008 + ------------------------------------------------------------------ + + Fixes from user input at phpwsforums + + Version 0.7.0 -- June 2008 + ------------------------------------------------------------------ + + Add support for Location(s) and Feature(s) + + |
|
From: Verdon V. <ve...@us...> - 2008-06-11 17:44:08
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/class In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8749/class Modified Files: RDX_Forms.php RDX_Member.php Rolodex.php Log Message: adding locations and features Index: RDX_Forms.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Forms.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** RDX_Forms.php 10 Jun 2008 17:15:12 -0000 1.8 --- RDX_Forms.php 11 Jun 2008 17:43:32 -0000 1.9 *************** *** 68,71 **** --- 68,87 ---- break; + case 'edit_location': + if (empty($this->rolodex->location)) { + $this->rolodex->loadLocation(); + } + $this->rolodex->panel->setCurrentTab('locations'); + $this->editLocation(); + break; + + case 'edit_feature': + if (empty($this->rolodex->feature)) { + $this->rolodex->loadFeature(); + } + $this->rolodex->panel->setCurrentTab('features'); + $this->editFeature(); + break; + case 'list': $this->rolodex->panel->setCurrentTab('list'); *************** *** 93,96 **** --- 109,122 ---- break; + case 'locations': + $this->rolodex->panel->setCurrentTab('locations'); + $this->listLocations(); + break; + + case 'features': + $this->rolodex->panel->setCurrentTab('features'); + $this->listFeatures(); + break; + case 'info': $this->rolodex->panel->setCurrentTab('info'); *************** *** 226,229 **** --- 252,327 ---- + function listLocations() + { + $ptags['TITLE_HEADER'] = dgettext('rolodex', 'Title'); + $ptags['DESCRIPTION_HEADER'] = dgettext('rolodex', 'Description'); + + PHPWS_Core::initModClass('rolodex', 'RDX_Location.php'); + PHPWS_Core::initCoreClass('DBPager.php'); + $pager = new DBPager('rolodex_location', 'Rolodex_Location'); + $pager->setModule('rolodex'); + $pager->setOrder('title', 'asc', true); + $pager->setTemplate('list_location.tpl'); + $pager->addRowTags('rowTag'); + $num = $pager->getTotalRows(); + if ($num == '0') { + if (Current_User::allow('rolodex', 'settings')) { + $vars['aop'] = 'menu'; + $vars['tab'] = 'settings'; + $vars2['aop'] = 'new_location'; + $ptags['EMPTY_MESSAGE'] = sprintf(dgettext('rolodex', 'Check your %s then create a %s to begin'), PHPWS_Text::secureLink(dgettext('rolodex', 'Settings'), 'rolodex', $vars), PHPWS_Text::secureLink(dgettext('rolodex', 'New Location'), 'rolodex', $vars2)); + } else { + $ptags['EMPTY_MESSAGE'] = dgettext('rolodex', 'Sorry, no locations are available at this time.'); + } + } + if (Current_User::allow('rolodex', 'settings')) { + $vars['aop'] = 'new_location'; + $ptags['ADD_LINK'] = PHPWS_Text::secureLink(dgettext('rolodex', 'Add Location'), 'rolodex', $vars); + } + $pager->addPageTags($ptags); + $pager->addToggle('class="toggle1"'); + $pager->setSearch('title', 'description'); + + $this->rolodex->content = $pager->get(); + $this->rolodex->title = sprintf(dgettext('rolodex', '%s Locations'), PHPWS_Settings::get('rolodex', 'module_title')); + } + + + function listFeatures() + { + $ptags['TITLE_HEADER'] = dgettext('rolodex', 'Title'); + $ptags['DESCRIPTION_HEADER'] = dgettext('rolodex', 'Description'); + + PHPWS_Core::initModClass('rolodex', 'RDX_Feature.php'); + PHPWS_Core::initCoreClass('DBPager.php'); + $pager = new DBPager('rolodex_feature', 'Rolodex_feature'); + $pager->setModule('rolodex'); + $pager->setOrder('title', 'asc', true); + $pager->setTemplate('list_feature.tpl'); + $pager->addRowTags('rowTag'); + $num = $pager->getTotalRows(); + if ($num == '0') { + if (Current_User::allow('rolodex', 'settings')) { + $vars['aop'] = 'menu'; + $vars['tab'] = 'settings'; + $vars2['aop'] = 'new_feature'; + $ptags['EMPTY_MESSAGE'] = sprintf(dgettext('rolodex', 'Check your %s then create a %s to begin'), PHPWS_Text::secureLink(dgettext('rolodex', 'Settings'), 'rolodex', $vars), PHPWS_Text::secureLink(dgettext('rolodex', 'New Feature'), 'rolodex', $vars2)); + } else { + $ptags['EMPTY_MESSAGE'] = dgettext('rolodex', 'Sorry, no features are available at this time.'); + } + } + if (Current_User::allow('rolodex', 'settings')) { + $vars['aop'] = 'new_feature'; + $ptags['ADD_LINK'] = PHPWS_Text::secureLink(dgettext('rolodex', 'Add Feature'), 'rolodex', $vars); + } + $pager->addPageTags($ptags); + $pager->addToggle('class="toggle1"'); + $pager->setSearch('title', 'description'); + + $this->rolodex->content = $pager->get(); + $this->rolodex->title = sprintf(dgettext('rolodex', '%s Features'), PHPWS_Settings::get('rolodex', 'module_title')); + } + + function editSettings() { *************** *** 325,328 **** --- 423,434 ---- $form->setSize('max_thumb_height', 4,4); + $form->addTextField('other_img_width', PHPWS_Settings::get('rolodex', 'other_img_width')); + $form->setLabel('other_img_width', dgettext('rolodex', 'Maximum image width for locations/features (20-400)')); + $form->setSize('other_img_width', 4,4); + + $form->addTextField('other_img_height', PHPWS_Settings::get('rolodex', 'other_img_height')); + $form->setLabel('other_img_height', dgettext('rolodex', 'Maximum image height for locations/features (20-400)')); + $form->setSize('other_img_height', 4,4); + $form->addCheckbox('show_block', 1); $form->setMatch('show_block', PHPWS_Settings::get('rolodex', 'show_block')); *************** *** 674,677 **** --- 780,788 ---- $tpl['CATEGORIES'] = Categories::getForm($match=$member->get_categories(), $select_name='categories', $multiple=true); + $tpl['LOCATIONS'] = $this->rolodex->getForm('location', $match=$member->get_locations(), $select_name='locations', $multiple=true); + $tpl['FEATURES'] = $this->rolodex->getForm('feature', $match=$member->get_features(), $select_name='features', $multiple=true); + $tpl['CATEGORIES_LABEL'] = dgettext('rolodex', 'Category(s)'); + $tpl['LOCATIONS_LABEL'] = dgettext('rolodex', 'Location(s)'); + $tpl['FEATURES_LABEL'] = dgettext('rolodex', 'Feature(s)'); if (Current_User::allow('rolodex', 'edit_member')) { *************** *** 696,699 **** --- 807,898 ---- + function editLocation() + { + $form = new PHPWS_Form('rolodex_location'); + $location = & $this->rolodex->location; + + $form->addHidden('module', 'rolodex'); + $form->addHidden('aop', 'post_location'); + + if ($location->id) { + $form->addHidden('id', $location->id); + $form->addSubmit(dgettext('rolodex', 'Update')); + $this->rolodex->title = sprintf(dgettext('rolodex', 'Update %s location'), PHPWS_Settings::get('rolodex', 'module_title')); + } else { + $form->addSubmit(dgettext('rolodex', 'Create')); + $this->rolodex->title = sprintf(dgettext('rolodex', 'Create %s location'), PHPWS_Settings::get('rolodex', 'module_title')); + } + + $form->addText('title', $location->title); + $form->setSize('title', 40); + $form->setLabel('title', dgettext('rolodex', 'Title')); + + $form->addTextArea('description', $location->description); + $form->setRows('description', '6'); + $form->setCols('description', '40'); + $form->setLabel('description', dgettext('rolodex', 'Description')); + + PHPWS_Core::initModClass('filecabinet', 'Cabinet.php'); + $manager = Cabinet::fileManager('image_id', $location->image_id); + $manager->imageOnly(); + $manager->maxImageWidth(PHPWS_Settings::get('rolodex', 'other_img_width')); + $manager->maxImageHeight(PHPWS_Settings::get('rolodex', 'other_img_height')); + + if ($manager) { + $form->addTplTag('FILE_MANAGER', $manager->get()); + } + + $tpl = $form->getTemplate(); + $tpl['DETAILS_LABEL'] = dgettext('rolodex', 'Details'); + + $this->rolodex->content = PHPWS_Template::process($tpl, 'rolodex', 'edit_location.tpl'); + + } + + + function editFeature() + { + $form = new PHPWS_Form('rolodex_feature'); + $feature = & $this->rolodex->feature; + + $form->addHidden('module', 'rolodex'); + $form->addHidden('aop', 'post_feature'); + + if ($feature->id) { + $form->addHidden('id', $feature->id); + $form->addSubmit(dgettext('rolodex', 'Update')); + $this->rolodex->title = sprintf(dgettext('rolodex', 'Update %s feature'), PHPWS_Settings::get('rolodex', 'module_title')); + } else { + $form->addSubmit(dgettext('rolodex', 'Create')); + $this->rolodex->title = sprintf(dgettext('rolodex', 'Create %s feature'), PHPWS_Settings::get('rolodex', 'module_title')); + } + + $form->addText('title', $feature->title); + $form->setSize('title', 40); + $form->setLabel('title', dgettext('rolodex', 'Title')); + + $form->addTextArea('description', $feature->description); + $form->setRows('description', '6'); + $form->setCols('description', '40'); + $form->setLabel('description', dgettext('rolodex', 'Description')); + + PHPWS_Core::initModClass('filecabinet', 'Cabinet.php'); + $manager = Cabinet::fileManager('image_id', $feature->image_id); + $manager->imageOnly(); + $manager->maxImageWidth(PHPWS_Settings::get('rolodex', 'other_img_width')); + $manager->maxImageHeight(PHPWS_Settings::get('rolodex', 'other_img_height')); + + if ($manager) { + $form->addTplTag('FILE_MANAGER', $manager->get()); + } + + $tpl = $form->getTemplate(); + $tpl['DETAILS_LABEL'] = dgettext('rolodex', 'Details'); + + $this->rolodex->content = PHPWS_Template::process($tpl, 'rolodex', 'edit_feature.tpl'); + + } + + function utilities() { Index: Rolodex.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/Rolodex.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Rolodex.php 10 Jun 2008 17:15:12 -0000 1.6 --- Rolodex.php 11 Jun 2008 17:43:32 -0000 1.7 *************** *** 92,100 **** $this->forwardMessage(dgettext('rolodex', 'Error occurred when saving member profile.')); PHPWS_Core::reroute('index.php?module=rolodex&aop=edit_member&user_id=' . $this->member->user_id); - // PHPWS_Core::reroute('index.php?module=rolodex&aop=menu&tab=list'); } else { $this->forwardMessage(dgettext('rolodex', 'Member profile saved successfully.')); - // PHPWS_Core::reroute('index.php?module=rolodex&aop=edit_member&user_id=' . $this->member->user_id); - // PHPWS_Core::reroute('index.php?module=rolodex&aop=menu&tab=list'); PHPWS_Core::reroute('index.php?module=rolodex&id=' . $this->member->user_id); } --- 92,97 ---- *************** *** 196,199 **** --- 193,248 ---- break; + case 'new_location': + case 'edit_location': + $this->loadForm('edit_location'); + break; + + case 'post_location': + if ($this->postLocation()) { + if (PHPWS_Error::logIfError($this->location->save())) { + $this->forwardMessage(dgettext('rolodex', 'Error occurred when saving location.')); + PHPWS_Core::reroute('index.php?module=rolodex&aop=edit_location&location=' . $this->location->id); + } else { + $this->forwardMessage(dgettext('rolodex', 'Location saved successfully.')); + PHPWS_Core::reroute('index.php?module=rolodex&aop=menu&tab=locations'); + } + } else { + $this->loadForm('edit_location'); + } + break; + + case 'delete_location': + $this->loadLocation(); + $this->location->delete(); + $this->message = dgettext('rolodex', 'Location deleted.'); + $this->loadForm('list'); + break; + + case 'new_feature': + case 'edit_feature': + $this->loadForm('edit_feature'); + break; + + case 'post_feature': + if ($this->postFeature()) { + if (PHPWS_Error::logIfError($this->feature->save())) { + $this->forwardMessage(dgettext('rolodex', 'Error occurred when saving feature.')); + PHPWS_Core::reroute('index.php?module=rolodex&aop=edit_feature&feature=' . $this->feature->id); + } else { + $this->forwardMessage(dgettext('rolodex', 'Feature saved successfully.')); + PHPWS_Core::reroute('index.php?module=rolodex&aop=menu&tab=features'); + } + } else { + $this->loadForm('edit_feature'); + } + break; + + case 'delete_feature': + $this->loadFeature(); + $this->feature->delete(); + $this->message = dgettext('rolodex', 'Feature deleted.'); + $this->loadForm('list'); + break; + } *************** *** 342,346 **** } PHPWS_Core::reroute('index.php?module=rolodex&uop=edit_member&user_id=' . $this->member->user_id); - // PHPWS_Core::reroute('index.php?module=rolodex&uop=list'); } else { if (PHPWS_Settings::get('rolodex', 'req_approval') && $this->member->isNew()) { --- 391,394 ---- *************** *** 357,360 **** --- 405,420 ---- break; + 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; + *************** *** 399,402 **** --- 459,494 ---- + function loadLocation($id=0) + { + PHPWS_Core::initModClass('rolodex', 'RDX_Location.php'); + + if ($id) { + $this->location = new Rolodex_Location($id); + } elseif (isset($_REQUEST['location_id'])) { + $this->location = new Rolodex_Location($_REQUEST['location_id']); + } elseif (isset($_REQUEST['location'])) { + $this->location = new Rolodex_Location($_REQUEST['location']); + } else { + $this->location = new Rolodex_Location; + } + } + + + function loadFeature($id=0) + { + PHPWS_Core::initModClass('rolodex', 'RDX_Feature.php'); + + if ($id) { + $this->feature = new Rolodex_Feature($id); + } elseif (isset($_REQUEST['feature_id'])) { + $this->feature = new Rolodex_Feature($_REQUEST['feature_id']); + } elseif (isset($_REQUEST['feature'])) { + $this->feature = new Rolodex_Feature($_REQUEST['feature']); + } else { + $this->feature = new Rolodex_Feature; + } + } + + function loadPanel() { *************** *** 430,433 **** --- 522,529 ---- 'link'=>$link); } + $tags['locations'] = array('title'=>dgettext('rolodex', 'Locations'), + 'link'=>$link); + $tags['features'] = array('title'=>dgettext('rolodex', 'Features'), + 'link'=>$link); if (Current_User::allow('rolodex', 'edit_member')){ $tags['info'] = array('title'=>dgettext('rolodex', 'Read me'), *************** *** 544,547 **** --- 640,657 ---- } + if ( !empty($_POST['other_img_width']) ) { + $other_img_width = (int)$_POST['other_img_width']; + if ($other_img_width >= 20 && $other_img_width <= 400 ) { + PHPWS_Settings::set('rolodex', 'other_img_width', $other_img_width); + } + } + + if ( !empty($_POST['other_img_height']) ) { + $other_img_height = (int)$_POST['other_img_height']; + if ($other_img_height >= 20 && $other_img_height <= 400 ) { + PHPWS_Settings::set('rolodex', 'other_img_height', $other_img_height); + } + } + isset($_POST['show_block']) ? PHPWS_Settings::set('rolodex', 'show_block', 1) : *************** *** 874,877 **** --- 984,1047 ---- + function postLocation() + { + $this->loadLocation(); + + if (empty($_POST['title'])) { + $errors[] = dgettext('rolodex', 'You must give this location a title.'); + } else { + $this->location->setTitle($_POST['title']); + } + + if (empty($_POST['description'])) { + $errors[] = dgettext('rolodex', 'You must give this location a description.'); + } else { + $this->location->setDescription($_POST['description']); + } + + if (isset($_POST['image_id'])) { + $this->location->setImage_id((int)$_POST['image_id']); + } + + if (isset($errors)) { + $this->message = implode('<br />', $errors); + return false; + } else { + return true; + } + + } + + + function postFeature() + { + $this->loadFeature(); + + if (empty($_POST['title'])) { + $errors[] = dgettext('rolodex', 'You must give this feature a title.'); + } else { + $this->feature->setTitle($_POST['title']); + } + + if (empty($_POST['description'])) { + $errors[] = dgettext('rolodex', 'You must give this feature a description.'); + } else { + $this->feature->setDescription($_POST['description']); + } + + if (isset($_POST['image_id'])) { + $this->feature->setImage_id((int)$_POST['image_id']); + } + + if (isset($errors)) { + $this->message = implode('<br />', $errors); + return false; + } else { + return true; + } + + } + + function resetExpired($interval) { *************** *** 1118,1121 **** --- 1288,1348 ---- + /** + * Returns a form for module inclusion + * @author Matthew McNaney <ma...@NO...> + * @modified Verdon Vaillancourt + * @access public + */ + function getForm($type='location', $match=null, $select_name='location', $multiple=true) + { + + switch($type) { + case 'location': + PHPWS_Core::initModClass('rolodex', 'RDX_Location.php'); + $db = new PHPWS_DB('rolodex_location'); + $db->addOrder('title asc'); + $result = $db->getObjects('Rolodex_Location'); + break; + case 'feature': + PHPWS_Core::initModClass('rolodex', 'RDX_Feature.php'); + $db = new PHPWS_DB('rolodex_feature'); + $db->addOrder('title asc'); + $result = $db->getObjects('Rolodex_Feature'); + break; + } + + foreach ($result as $item) { + $items[$item->id] = $item->title; + } + + if ($multiple) { + if (javascriptEnabled()) { + $vars['id'] = 'cid-' . rand(); + $vars['select_name'] = $select_name; + $vars['options'] = $items; + if (!empty($match) && is_array($match)) { + $vars['match'] = $match; + } + return javascript('multiple_select', $vars); + } else { + $form = new PHPWS_Form; + $form->addMultiple($select_name, $items); + if (!empty($match) && is_array($match)) { + $form->setMatch($select_name, $match); + } + return $form->get($select_name); + } + } else { + $form = new PHPWS_Form; + $form->addSelect($select_name, $items); + if (!empty($match) && is_string($match)) { + $form->setMatch($select_name, $match); + } + return $form->get($select_name); + } + + } + + Index: RDX_Member.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Member.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RDX_Member.php 10 Jun 2008 17:15:12 -0000 1.5 --- RDX_Member.php 11 Jun 2008 17:43:32 -0000 1.6 *************** *** 115,118 **** --- 115,138 ---- } + function get_locations($print=false) + { + if ($print) { + $result = 'code this'; + } else { + $result = unserialize($this->locations); + } + return $result; + } + + function get_features($print=false) + { + if ($print) { + $result = 'code this'; + } else { + $result = unserialize($this->features); + } + return $result; + } + function setAvatar($avatar_url) { *************** *** 1433,1436 **** --- 1453,1464 ---- } + if (isset($_POST['locations'])) { + } else { + } + + if (isset($_POST['features'])) { + } else { + } + return $this->save(); } |
|
From: Verdon V. <ve...@us...> - 2008-06-11 17:44:08
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8749/templates Modified Files: edit_member.tpl edit_settings.tpl Log Message: adding locations and features Index: edit_member.tpl =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/templates/edit_member.tpl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** edit_member.tpl 31 Mar 2008 19:42:49 -0000 1.3 --- edit_member.tpl 11 Jun 2008 17:43:36 -0000 1.4 *************** *** 48,52 **** <fieldset> <legend><strong>{SETTINGS_GROUP_LABEL}</strong></legend> ! <p>{CATEGORIES}</p> <p>{ALLOW_COMMENTS} {ALLOW_COMMENTS_LABEL}</p> <p>{ALLOW_ANON} {ALLOW_ANON_LABEL}</p> --- 48,54 ---- <fieldset> <legend><strong>{SETTINGS_GROUP_LABEL}</strong></legend> ! <p>{CATEGORIES_LABEL}<br />{CATEGORIES}</p> ! <p>{LOCATIONS_LABEL}<br />{LOCATIONS}</p> ! <p>{FEATURES_LABEL}<br />{FEATURES}</p> <p>{ALLOW_COMMENTS} {ALLOW_COMMENTS_LABEL}</p> <p>{ALLOW_ANON} {ALLOW_ANON_LABEL}</p> Index: edit_settings.tpl =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/templates/edit_settings.tpl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** edit_settings.tpl 31 Mar 2008 19:42:49 -0000 1.3 --- edit_settings.tpl 11 Jun 2008 17:43:36 -0000 1.4 *************** *** 34,37 **** --- 34,39 ---- <p>{MAX_THUMB_WIDTH} {MAX_THUMB_WIDTH_LABEL}</p> <p>{MAX_THUMB_HEIGHT} {MAX_THUMB_HEIGHT_LABEL}</p> + <p>{OTHER_IMG_WIDTH} {OTHER_IMG_WIDTH_LABEL}</p> + <p>{OTHER_IMG_HEIGHT} {OTHER_IMG_HEIGHT_LABEL}</p> </fieldset> <fieldset> |