isocial-svn Mailing List for isocial (Page 4)
Status: Pre-Alpha
Brought to you by:
aguidrevitch
You can subscribe to this list here.
2008 |
Jan
|
Feb
(11) |
Mar
(80) |
Apr
(22) |
May
(90) |
Jun
(28) |
Jul
(33) |
Aug
(12) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
---|
From: <agu...@us...> - 2008-06-01 15:39:56
|
Revision: 229 http://isocial.svn.sourceforge.net/isocial/?rev=229&view=rev Author: aguidrevitch Date: 2008-06-01 08:40:00 -0700 (Sun, 01 Jun 2008) Log Message: ----------- Independent File storage (on local disk) implemented Modified Paths: -------------- app/application_controller.php app/controllers/photoapp/album_controller.php app/installers/photoapp/album_installer.php app/installers/user_installer.php app/models/photoapp_album.php app/models/photoapp_photo.php app/models/user.php app/shared_model.php app/views/photoapp/album/view.tpl Added Paths: ----------- app/models/base_file.php app/models/stored_file.php Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-05-29 17:22:03 UTC (rev 228) +++ app/application_controller.php 2008-06-01 15:40:00 UTC (rev 229) @@ -20,8 +20,10 @@ var $_errors = array(); - var $app_models = array('User', 'Message'); - var $app_helpers = array('AutoComplete', 'City', 'Dialog', 'AccessField'); + var $app_models = array('User', 'Message', 'BaseFile', 'StoredFile'); + var $app_helpers = array('AutoComplete', 'City', 'Dialog', 'AccessField'); + var $uploaded_files = array(); + var $current_user; function __construct () { @@ -40,6 +42,7 @@ function beforeAction ( $method = '' ) { $this->_validateLoginStatus(); + $this->_processFiles(); } function _validateLoginStatus () { @@ -47,6 +50,47 @@ $this->redirectTo(array( 'controller' => 'user', 'action' => 'login' )); } } + + + function _processFiles() { + $uploaded = $this->Request->_getNormalizedFilesArray($this->params); + foreach ($uploaded as $fieldname => $key_or_value) { + if (is_array($key_or_value)) { + foreach ($key_or_value as $key => $value) { + if ($stored = $this->_processSingleFile($key_or_value[$key])) { + array_push($this->uploaded_files, $stored); + } + } + } else { + if ($stored = $this->_processSingleFile($uploaded[$fieldname])) { + array_push($this->uploaded_files, $stored); + } + } + } + } + + function _isValidUploadedFile($tmpfile) { + return $this->_isImage($tmpfile['tmp_name']); + } + + function _isImage ($filename) { + return getimagesize($filename); + } + + function _processSingleFile($tmpfile) { + if (empty($tmpfile['error']) && $tmpfile['size'] > 0) { + if (!$this->_isValidUploadedFile($tmpfile)) { + return; + } + $stored = $this->current_user->stored_file->build(); + $stored->setAttributes($tmpfile); + if ($stored->upload($tmpfile['name'], $tmpfile['type'], $tmpfile['size'], $tmpfile['tmp_name'])) { + if ($stored->save()) { + return $stored; + } + } + } + } function _getUserFromSession () { if (isset($this->session['user_id'])) { Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-29 17:22:03 UTC (rev 228) +++ app/controllers/photoapp/album_controller.php 2008-06-01 15:40:00 UTC (rev 229) @@ -146,9 +146,24 @@ } } + /* + function _isValidUploadedFile($tmpfile) { + return true; + } + */ + function add_photo () { - if (!empty($this->params['album']) && !empty($_FILES)){ - $this->_upload($this->params); + if (!empty($this->params['album'])){ + $this->album = $this->PhotoappAlbum->find($this->params['id']); + foreach ($this->uploaded_files as $file) { + unset($photo); + $photo = $this->album->photo->build(); + $photo->base_file_id = $file->id; + //$photo->stored_file->assign($file); + //$photo->stored_file->build(); + //$photo->stored_file->assign($file); + $photo->save(); + } } else if ($this->params['id']) { $this->album = $this->PhotoappAlbum->find($this->params['id']); return; @@ -198,42 +213,6 @@ } } - function _upload($params) { - //$this->debug($_FILES); - for ($i = 1 ; $i < 6 ; $i++) { - $field = 'photo' . $i; - - if ($_FILES['album']['error'][$field] == 0 ) { - // copy file; save photo - $photo_name = microtime(true) . ".jpeg"; - $user_path = AK_PUBLIC_DIR. "/images/uploaded/" . $this->current_user->getId(); - if(!file_exists($user_path)) { - `mkdir $user_path`; - `chmod 777 $user_path`; - } - $copy_to = $user_path . "/" . $photo_name;//$_FILES['album']['name'][$field]; - $copy_from = $_FILES['album']['tmp_name'][$field]; - if (move_uploaded_file($copy_from, $copy_to)) { - $album = $this->PhotoappAlbum->find($this->params['id']); - $photo = new PhotoappPhoto (); - $photo->img = $this->current_user->getId() . "@" . $photo_name; - $photo->album_id = $album->getId(); - $photo->save(); - - $album = $this->PhotoappAlbum->find($this->params['id']); - if( empty($album->img)) { - $album->img = $photo->img; - $photo->save(); - } - //$album->photos_count += 1; - $album->save(); - } - } - } // for - $this->redirectTo(array('action' => 'uploaded', 'id' => $this->params['id'])); - - } - function defaultUrlOptions($options) { return array('id' => $this->params['id']); } Modified: app/installers/photoapp/album_installer.php =================================================================== --- app/installers/photoapp/album_installer.php 2008-05-29 17:22:03 UTC (rev 228) +++ app/installers/photoapp/album_installer.php 2008-06-01 15:40:00 UTC (rev 229) @@ -22,12 +22,13 @@ $this->execute( "CREATE TABLE `photoapp_photos` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `album_id` int(11) NOT NULL , + `album_id` int(11) NOT NULL, + `base_file_id` int(11) NOT NULL, `name` char(100) NOT NULL DEFAULT '', `caption` char(255) NOT NULL DEFAULT '', - `created_at` datetime NOT NULL , - `img` char(255) NOT NULL DEFAULT '' - + FOREIGN KEY (album_id) REFERENCES photoapp_albums(id), + FOREIGN KEY (base_file_id) REFERENCES base_files(id), + INDEX album_idx (album_id) ) ENGINE=InnoDB"); Modified: app/installers/user_installer.php =================================================================== --- app/installers/user_installer.php 2008-05-29 17:22:03 UTC (rev 228) +++ app/installers/user_installer.php 2008-06-01 15:40:00 UTC (rev 229) @@ -14,6 +14,18 @@ `updated_at` datetime NOT NULL, `active` tinyint(1) NOT NULL DEFAULT '0' ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `base_files` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11), + `name` char(255) NOT NULL, + `type` char(40) NOT NULL, + `size` int(11) NOT NULL, + `created_at` datetime NOT NULL, + FOREIGN KEY (user_id) REFERENCES users(id), + INDEX user_idx (user_id) + ) ENGINE=InnoDB"); $this->execute( "CREATE TABLE `confirmations` ( @@ -197,14 +209,10 @@ `address` varchar(100), `website` text, `city_id` int(11), - `mobile_access` int(11) NOT NULL DEFAULT 0, `land_access` int(11) NOT NULL DEFAULT 0, `address_access` int(11) NOT NULL DEFAULT 0, `website_access` int(11) NOT NULL DEFAULT 0, - - `created_at` datetime NOT NULL, - `updated_at` datetime NOT NULL, FOREIGN KEY (user_id) REFERENCES users(id), FOREIGN KEY (city_id) REFERENCES cities(id), INDEX user_idx (user_id) @@ -238,16 +246,12 @@ `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, `user_id` int(11) NOT NULL, `marital_status_id` int(11) NOT NULL, - `interested_in_men` bool, `interested_in_women` bool, `looking_for_friendship` bool, `looking_for_dating` bool, `looking_for_relationship` bool, `looking_for_networking` bool, - - `created_at` datetime NOT NULL, - `updated_at` datetime NOT NULL, FOREIGN KEY (user_id) REFERENCES users(id), FOREIGN KEY (marital_status_id) REFERENCES marital_statuses(id), INDEX user_idx (user_id) @@ -257,6 +261,7 @@ "CREATE TABLE `personal_profiles` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, `user_id` int(11) NOT NULL, + `former_name` varchar(100), `activities` text, `interests` text, `music` text, @@ -265,17 +270,42 @@ `books` text, `quotes` text, `about` text, - `created_at` datetime NOT NULL, - `updated_at` datetime NOT NULL, FOREIGN KEY (user_id) REFERENCES users(id), INDEX user_idx (user_id) ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `groups` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `name` varchar(255), + `type` + `city_id` int(11), + `count` int(11), + FOREIGN KEY (user_id) REFERENCES users(id), + FOREIGN KEY (city_id) REFERENCES cities(id), + INDEX user_idx (user_id) + ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `group_profiles` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `group_id` int(11), + `from` datetime, + `to` datetime, + `position` char(100), + `concentration` char(100), + FOREIGN KEY (user_id) REFERENCES users(id), + INDEX user_idx (user_id) + ) ENGINE=InnoDB"); } function down_1() { $this->transactionComplete(); + $this->dropTable('group_profiles'); + $this->dropTable('groups'); $this->dropTable('personal_profiles'); $this->dropTable('marital_statuses'); $this->dropTable('relationship_profiles'); Added: app/models/base_file.php =================================================================== --- app/models/base_file.php (rev 0) +++ app/models/base_file.php 2008-06-01 15:40:00 UTC (rev 229) @@ -0,0 +1,21 @@ +<?php + +class BaseFile extends ActiveRecord +{ + var $table_name = 'base_files'; + var $belongs_to = array('User'); + + function upload () { + die("upload method is virtual"); + } + + function remove () { + die("remove method is virtual"); + } + + function url () { + die("url method is virtual"); + } +} + +?> Modified: app/models/photoapp_album.php =================================================================== --- app/models/photoapp_album.php 2008-05-29 17:22:03 UTC (rev 228) +++ app/models/photoapp_album.php 2008-06-01 15:40:00 UTC (rev 229) @@ -2,7 +2,6 @@ class PhotoappAlbum extends ActiveRecord { - //var $has_one = array('group_member' => array('class_name' => 'GroupappMember','foreign_key' => 'group_id'), ); var $has_many = array('photos' => array('class_name' => 'PhotoappPhoto', 'foreign_key' => 'album_id')); function validateOnCreate () Modified: app/models/photoapp_photo.php =================================================================== --- app/models/photoapp_photo.php 2008-05-29 17:22:03 UTC (rev 228) +++ app/models/photoapp_photo.php 2008-06-01 15:40:00 UTC (rev 229) @@ -2,10 +2,12 @@ class PhotoappPhoto extends ActiveRecord { - var $belongs_to = array('album' => array('class_name' => 'PhotoappAlbum', 'primary_key_name' => 'album_id') ); + var $belongs_to = array('album' => array('class_name' => 'PhotoappAlbum', 'primary_key_name' => 'album_id'), + 'stored_file' => array('class_name' => 'StoredFile', 'primary_key_name' => 'base_file_id')); + /* function beforeDestroy() { - + $albums_cover = $this->album->find('all', array('conditions' => array("img = '" . $this->img . "'"))); if ($albums_cover) foreach ($albums_cover as $album) { @@ -19,14 +21,9 @@ $file = AK_PUBLIC_DIR . "/images/uploaded/" . $path; `rm -f $file`; return parent::beforeDestroy(); + } - - function debug($str) { - echo "<pre>"; - print_r($str); - echo "</pre>"; - } - + */ } ?> \ No newline at end of file Added: app/models/stored_file.php =================================================================== --- app/models/stored_file.php (rev 0) +++ app/models/stored_file.php 2008-06-01 15:40:00 UTC (rev 229) @@ -0,0 +1,30 @@ +<?php + +class StoredFile extends BaseFile +{ + + function path () { + return "images" . DS . "uploaded" . DS . $this->user_id . DS; + } + + function upload ($name, $type, $size, $tmpname) { + $user_path = AK_PUBLIC_DIR . DS . $this->path(); + if(!file_exists($user_path)) { + mkdir($user_path, 0755, true); + } + $forbidden = preg_quote('\/:*?"<>', '/'); + $this->name = microtime(true) . "_" . preg_replace("/([\\x00-\\x1f{$forbidden}])/e", "_", $name); + return move_uploaded_file($tmpname, $user_path . DS . $this->name); + } + + function remove () { + unlink(AK_PUBLIC_DIR . DS . $this->path() . DS . $this->name); + } + + function url () { + return AK_ASSET_URL_PREFIX . "/" . $this->path() . "/" . $this->name; + } + +} + +?> Modified: app/models/user.php =================================================================== --- app/models/user.php 2008-05-29 17:22:03 UTC (rev 228) +++ app/models/user.php 2008-06-01 15:40:00 UTC (rev 229) @@ -12,6 +12,8 @@ 'conditions' => 'is_recipient_del = 0'), 'im_profiles' => array('class_name' => 'ImProfile', 'foreign_key' => 'user_id'), + 'stored_files' => array('class_name' => 'StoredFile', + 'foreign_key' => 'user_id'), /* 'groupapp_groups' => array('class_name' => 'GroupappMember', */ /* 'foreign_key' => 'user_id'), */ ); Modified: app/shared_model.php =================================================================== --- app/shared_model.php 2008-05-29 17:22:03 UTC (rev 228) +++ app/shared_model.php 2008-06-01 15:40:00 UTC (rev 229) @@ -14,6 +14,11 @@ */ class ActiveRecord extends AkActiveRecord { + + function getInheritanceColumn() { + return false; + } + function collect(&$source_array, $key_index, $value_index) { $resulting_array = array(); @@ -111,4 +116,9 @@ } -?> +class MediaItem extends ActiveRecord { + var $table_name = 'media_items'; +} + + +?> \ No newline at end of file Modified: app/views/photoapp/album/view.tpl =================================================================== --- app/views/photoapp/album/view.tpl 2008-05-29 17:22:03 UTC (rev 228) +++ app/views/photoapp/album/view.tpl 2008-06-01 15:40:00 UTC (rev 229) @@ -17,7 +17,8 @@ {loop photos} <div class="photo_view"> <div class="img"> - <img src="/preview/index/100x100/<?= $photo->get('img')?>" /> + <ximg src="/preview/index/100x100/<?= $photo->stored_file->load()->url()?>" /> + <img src="<? $photo->stored_file->load(); echo $photo->stored_file->url() ?>" /> </div> <div class="links"> <ul class="actions_list"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-05-29 17:21:58
|
Revision: 228 http://isocial.svn.sourceforge.net/isocial/?rev=228&view=rev Author: dim0s77 Date: 2008-05-29 10:22:03 -0700 (Thu, 29 May 2008) Log Message: ----------- added more info to group info page Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/locales/groupapp/group/ru.php app/models/groupapp_group.php app/models/groupapp_member.php app/views/groupapp/group/show_group.tpl public/stylesheets/common/Application.css public/stylesheets/groupapp/Group.css public/stylesheets/groupapp/Groupapp.css timesheet/dim0s77.txt Removed Paths: ------------- app/views/groupapp/group/group_info.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-05-25 14:19:54 UTC (rev 227) +++ app/controllers/groupapp/group_controller.php 2008-05-29 17:22:03 UTC (rev 228) @@ -145,15 +145,45 @@ 'include' => 'user')); } - function group_info () { - if (!empty($this->params['id']) && $this->GroupappGroup->find($this->params['id'])) { - $this->group = $this->GroupappGroup->find($this->params['id']); - } - } - function show_group () { if (!empty($this->params['id']) && $this->GroupappGroup->find($this->params['id'])) { $this->group = $this->GroupappGroup->find($this->params['id']); + $this->members = $this->_getGroupMembers($this->group); + $this->members_count = count($this->members); + $this->admins = array(); + foreach ($this->members as $member) { + if ($member->groupapp_member_role_id < 3) { + $member->role->load(); + $this->admins[] = $member; + } + } + $this->group_type = $this->group->group_type->load()->get('name'); + $messages = $this->GroupappMessage->find('all', + array( + 'conditions' => array("groupapp_group_id = ?", $this->group->getId()), + ) + ); + $topics = array(); + $persons = array(); + if(!empty($messages)) { + foreach ($messages as $message) { + if (!isset($topics[$message->topic_id])) { + $topics[$message->topic_id]['first'] = $message; + } + isset($topics[$message->topic_id]['posts']) ? + $topics[$message->topic_id]['posts']++ : + $topics[$message->topic_id]['posts'] = 1; + if (!isset($persons[$message->topic_id][$message->user_id])) { + $persons[$message->topic_id][$message->user_id] = 1; + isset($topics[$message->topic_id]['persons']) ? + $topics[$message->topic_id]['persons']++ : + $topics[$message->topic_id]['persons'] = 1; + } + $topics[$message->topic_id]['last'] = $message; + $topics[$message->topic_id]['last'] = $message; + } + } + $this->topics = $topics; } } Modified: app/locales/groupapp/group/ru.php =================================================================== --- app/locales/groupapp/group/ru.php 2008-05-25 14:19:54 UTC (rev 227) +++ app/locales/groupapp/group/ru.php 2008-05-29 17:22:03 UTC (rev 228) @@ -15,6 +15,12 @@ $dictionary['Start a New Group'] = 'Начать новую группу'; $dictionary['Find a Group'] = 'Найти группу'; $dictionary['Search Groups'] = 'Поиск групп'; +$dictionary['Type'] = 'Тип'; +$dictionary['Updated on'] = 'Обновлена'; +$dictionary['posts'] = 'сообщений'; +$dictionary['persons'] = 'участников'; +$dictionary['Start New Topic'] = 'Начать новую тему'; +$dictionary['Topics count'] = 'Обсуждаемых тем'; $dictionary['Step'] = 'Шаг'; $dictionary['Group Info'] = 'Инфо о группе'; @@ -73,6 +79,12 @@ 'Для присоединения нового участника требуется разрешение администраторов. Информацию о группе может увидеть только участник группы. Только участники группы смогут увидеть форум, доску объявлений, видео и фото.'; $dictionary['The group will not appear in search results or in the profiles of its members. Membership is by invitation only, and only members can see the group information. Only the members will be able to see the following: the discussion board, the wall, videos and photos.'] = 'Эта группа не будет отображаться в результатах поиска или в профилях своих участников. Членство в группе возможно только по приглашению, и только участники группы могут видеть информацию о группе. Только участники смогут увидеть форум, доску объявлений, видео и фото.'; +$dictionary['This is an open group. Anyone can join and invite others to join.'] = + 'Это открытая группа. Каждый может присоединиться и пригласить других.'; +$dictionary['This is a closed group. Members must be invited or approved by an admin.'] = + 'Это закрытая группа. Для присоединения нового участника требуется разрешение администраторов.'; +$dictionary['This is a secret group. It will not show up in your profile, and only admins can invite members.'] = + 'Это засекреченная группа. Эта группа не будет отображаться в результатах поиска или в профилях своих участников.'; $dictionary['Publicize'] = 'Опубликовать'; $dictionary['Show this group in search results'] = 'Показывать эту группу в результатах поиска'; Modified: app/models/groupapp_group.php =================================================================== --- app/models/groupapp_group.php 2008-05-25 14:19:54 UTC (rev 227) +++ app/models/groupapp_group.php 2008-05-29 17:22:03 UTC (rev 228) @@ -9,7 +9,7 @@ 'foreign_key' => 'groupapp_group_id') ); var $belongs_to = array('group_type' => array('class_name' => 'GroupappGroupType', - 'primary_key_name' => 'type_id') + 'primary_key_name' => 'type_id') ); Modified: app/models/groupapp_member.php =================================================================== --- app/models/groupapp_member.php 2008-05-25 14:19:54 UTC (rev 227) +++ app/models/groupapp_member.php 2008-05-29 17:22:03 UTC (rev 228) @@ -4,7 +4,7 @@ { var $belongs_to = array('user' => array('class_name' => 'User', 'primary_key_name' => 'user_id'), - 'role' => array('class_name' => 'GroupMemberRole', + 'role' => array('class_name' => 'GroupappMemberRole', 'primary_key_name' => 'groupapp_member_role_id'), 'group' => array('class_name' => 'GroupappGroup', 'primary_key_name' => 'groupapp_group_id') Deleted: app/views/groupapp/group/group_info.tpl =================================================================== --- app/views/groupapp/group/group_info.tpl 2008-05-25 14:19:54 UTC (rev 227) +++ app/views/groupapp/group/group_info.tpl 2008-05-29 17:22:03 UTC (rev 228) @@ -1 +0,0 @@ -<?= $controller->renderPartial("menu") ?> \ No newline at end of file Modified: app/views/groupapp/group/show_group.tpl =================================================================== --- app/views/groupapp/group/show_group.tpl 2008-05-25 14:19:54 UTC (rev 227) +++ app/views/groupapp/group/show_group.tpl 2008-05-29 17:22:03 UTC (rev 228) @@ -9,6 +9,10 @@ <div class="right_small"> <div class="right_content"> + <div class="group_avatar"> + <img src="/images/nophoto_men_sm.gif" alt="" class=""> + </div> + <ul class="actions_list"> <li><a href="/groupapp/">_{Message All Members}</a></li> <li><a href="/groupapp/group/edit_info/{group.id?}">_{Edit Group}</a></li> @@ -19,9 +23,18 @@ <div class="box"> <div class="header"> - <div class="edit"><a href="#">_{edit}</a></div> + <div class="edit"><a href="/groupapp/group/edit_customize/{group.id?}">_{edit}</a></div> <div class="box_title">_{Group Type}</div> </div> + <div class="body"> + <? if ($group->access == 0) { ?> + _{This is an open group. Anyone can join and invite others to join.} + <? } else if ($group->access == 1) { ?> + _{This is a closed group. Members must be invited or approved by an admin.} + <? } else if ($group->access == 2) { ?> + _{This is a secret group. It will not show up in your profile, and only admins can invite members.} + <? } ?> + </div> <div class="clearfix"></div> </div> @@ -29,6 +42,13 @@ <div class="header"> <div class="box_title">_{Administrators}</div> </div> + <div class="body"> + <ul class="simple_list"> + {loop admins} + <li><a href="/groupapp/">{admin.user.name?}</a> <span>(<?= $admin->role->get('name') ?>)</span></li> + {end} + </ul> + </div> <div class="clearfix"></div> </div> @@ -39,12 +59,17 @@ <div class="box"> <div class="header"> - <div class="edit"><a href="#">_{edit}</a></div> - <div class="box_title">_{Information}</div> + <div class="edit"><a href="/groupapp/group/edit_info/{group.id?}">_{edit}</a></div> + <div class="box_title">_{Group Info}</div> </div> <div class="clearfix"></div> <div class="body"> - Group Info + <div class="other param">_{Type}:</div> + <div class="other value">{group_type?}</div> + <div class="clearfix"></div> + <div class="other param">_{Description}:</div> + <div class="other value">{group.description}</div> + <div class="clearfix"></div> </div> </div> @@ -72,20 +97,35 @@ <div class="header"> <div class="box_title">_{Discussion board}</div> </div> - <div class="clearfix"></div> + {?topics} + <div class="menu"> + <div class="action"><a href="/groupapp/board/start_topic/{group.id?}">_{Start New Topic}</a></div> + <div class="info">_{Topics count}: <a href="/groupapp/board/{group.id?}">1</a></div> + </div> + <div class="simple_list"> + {loop topics} + <div class="row"> + <div class="box_title">{topic-first.subject?}</div> + <div class="subtext black">_{posts}: {topic-posts?}; _{persons}: {topic-persons?}</div> + <div class="subtext">_{Updated on} {topic-last.created_at?}</div> + </div> + {end} + </div> + {else} <div class="emptyblock"> - _{There are no discussions}.<br><a href="#">_{Start the first topic}</a>. + _{There are no discussions}.<br><a href="/groupapp/board/start_topic/{group.id?}">_{Start the first topic}</a>. </div> + {end} </div> <div class="box"> <div class="header"> - <div class="edit"><a href="#">_{edit}</a></div> + <div class="edit"><a href="/groupapp/group/edit_members/{group.id?}">_{edit}</a></div> <div class="box_title">_{Members}</div> </div> <div class="menu"> <div class="action"><a href="#">_{See all}</a></div> - <div class="info">_{Members count}: 1</div> + <div class="info">_{Members count}: {members_count?}</div> </div> <div class="clearfix"></div> <div class="body"> Modified: public/stylesheets/common/Application.css =================================================================== --- public/stylesheets/common/Application.css 2008-05-25 14:19:54 UTC (rev 227) +++ public/stylesheets/common/Application.css 2008-05-29 17:22:03 UTC (rev 228) @@ -279,19 +279,17 @@ } .box .header { - color: #3b5998; background: #d8dfea; - padding: 3px 0px 3px 0px; + padding: 3px 10px 3px 10px; } -.box .header .box_title { +.box_title { + color: #3b5998; font-weight: bold; - margin-left: 10px; } .box .header .edit { float: right; - margin-right: 10px; } .box .menu { @@ -314,6 +312,11 @@ padding: 10px; } +.box .simple_list .row { + border-bottom: 1px solid #aaaaaa; + padding: 10px ; +} + .box .emptyblock { border-top: 1px solid #aaaaaa; border-bottom: 1px solid #aaaaaa; @@ -352,6 +355,21 @@ color: #777777; } +.simple_list { + margin: 0px; + padding: 0px; +} + +.simple_list li { + list-style: square outside; + color: #3b5998; + margin: 0px 0px 5px 5px; +} + +.simple_list li span { + color: black; +} + .footer { float: left; display: block; Modified: public/stylesheets/groupapp/Group.css =================================================================== --- public/stylesheets/groupapp/Group.css 2008-05-25 14:19:54 UTC (rev 227) +++ public/stylesheets/groupapp/Group.css 2008-05-29 17:22:03 UTC (rev 228) @@ -178,12 +178,12 @@ margin-bottom: 10px; } -.groups_list .container .row .info .other { +.other { float: left; margin-bottom: 3px; } -.groups_list .container .row .info .other.param { +.other.param { color: #999999; margin-right: 5px; } @@ -192,3 +192,14 @@ float: right; width: 125px; } + +.subtext { + padding: 2px 5px 0px 0px; + font-size: 9px; + color: #777777; +} + +.subtext.black { + color: #000000; + float: left; +} Modified: public/stylesheets/groupapp/Groupapp.css =================================================================== --- public/stylesheets/groupapp/Groupapp.css 2008-05-25 14:19:54 UTC (rev 227) +++ public/stylesheets/groupapp/Groupapp.css 2008-05-29 17:22:03 UTC (rev 228) @@ -45,3 +45,7 @@ border-bottom: solid 1px #cccccc; } +.group_avatar { + text-align: center; + margin-bottom: 5px; +} \ No newline at end of file Modified: timesheet/dim0s77.txt =================================================================== --- timesheet/dim0s77.txt 2008-05-25 14:19:54 UTC (rev 227) +++ timesheet/dim0s77.txt 2008-05-29 17:22:03 UTC (rev 228) @@ -27,3 +27,5 @@ 2008-05-17,10:50,11:40,groupapp,RT:3,"discussion board: reply to post" 2008-05-25,09:00,16:35,groupapp,RT:3,"groupapp" + +2008-05-29,18:25,20:20,groupapp,RT:3,"groupapp: adding more info to group info page" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-25 14:19:45
|
Revision: 227 http://isocial.svn.sourceforge.net/isocial/?rev=227&view=rev Author: fsnobody Date: 2008-05-25 07:19:54 -0700 (Sun, 25 May 2008) Log Message: ----------- fogoten Modified Paths: -------------- app/views/shared/loggedin/sidebar.tpl Modified: app/views/shared/loggedin/sidebar.tpl =================================================================== --- app/views/shared/loggedin/sidebar.tpl 2008-05-25 14:08:14 UTC (rev 226) +++ app/views/shared/loggedin/sidebar.tpl 2008-05-25 14:19:54 UTC (rev 227) @@ -1,6 +1,6 @@ <div id="qsearch"> <div> - <h2>Search</h2> + <h2>_{Search}</h2> </div> <form action="/search"> <div id="qsearchwrapper"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-25 14:08:06
|
Revision: 226 http://isocial.svn.sourceforge.net/isocial/?rev=226&view=rev Author: fsnobody Date: 2008-05-25 07:08:14 -0700 (Sun, 25 May 2008) Log Message: ----------- Privacy for albums + translate Modified Paths: -------------- app/locales/photoapp/album/ru.php app/views/photoapp/album/_edit_menu.tpl app/views/photoapp/album/_form.tpl app/views/photoapp/album/add_photo.tpl app/views/photoapp/album/delete.tpl app/views/photoapp/album/index.tpl app/views/photoapp/album/uploaded.tpl app/views/photoapp/album/view.tpl timesheet/eerunov.txt Modified: app/locales/photoapp/album/ru.php =================================================================== --- app/locales/photoapp/album/ru.php 2008-05-25 13:36:14 UTC (rev 225) +++ app/locales/photoapp/album/ru.php 2008-05-25 14:08:14 UTC (rev 226) @@ -6,6 +6,7 @@ $dictionary['My Photos'] = 'Мои Фото'; $dictionary['Photos'] = 'Фото'; +$dictionary['Add photos'] = 'Добавить фото'; $dictionary['Photos of You'] = 'Мои личные фото'; $dictionary['Create a Photo Album'] = 'Создать фото альбом'; $dictionary['Welcome to PROJECT_NAME Photos'] = 'Добро пожаловать в PROJECT_NAME Фото'; @@ -14,7 +15,14 @@ $dictionary['Description'] = 'Описание'; $dictionary['Privacy'] = 'Доступ'; $dictionary['Create Album'] = 'Создать альбом'; +$dictionary['Save album'] = 'Сохранить альбом'; +$dictionary['Update'] = 'Обновить'; +$dictionary['Edit'] = 'Радактировать'; +$dictionary['Cover'] = 'Обложка'; +$dictionary['Back'] = 'Вернуться'; +$dictionary['may be not empty. Delete it with photos?'] = 'может быть не пуст. Удалить с фото?'; + $dictionary['My Albums'] = 'Мои альбомы'; $dictionary['Create a New Album'] = 'Создать новый альбом'; $dictionary['You have no any album'] = 'У вас нет альбомов'; @@ -23,12 +31,18 @@ $dictionary['Description'] = 'Описание'; $dictionary['Created'] = 'Создан'; $dictionary['Edit Album'] = 'Редактировать альбом'; +$dictionary['Edit info'] = 'Редактировать данные'; + +$dictionary['Edit uploaded'] = 'Загруженные'; $dictionary['View Album'] = 'Просмотреть альбом'; +$dictionary['View'] = 'Просмотр'; $dictionary['Delete Album'] = 'Удалить альбом'; +$dictionary['Delete'] = 'Удалить'; $dictionary['photos'] = 'фотографий'; $dictionary['Upload'] = 'Загрузить'; $dictionary['Choose'] = 'Обзор'; $dictionary['Uploaded'] = 'Загруженные'; +$dictionary['No cover choosed'] = 'Обложка не выбранна'; Modified: app/views/photoapp/album/_edit_menu.tpl =================================================================== --- app/views/photoapp/album/_edit_menu.tpl 2008-05-25 13:36:14 UTC (rev 225) +++ app/views/photoapp/album/_edit_menu.tpl 2008-05-25 14:08:14 UTC (rev 226) @@ -1,15 +1,15 @@ <div class="tabs"> <div class="left"> <ul class="toggle_tabs"> - <li class="first"><a href="/photoapp/album/add_photo/<?= $album->getId()?>" class="<?= $controller->getActionName() == 'add_photo' ? 'selected' : '' ?>">_{Add Photos}</a></li><? + <li class="first"><a href="/photoapp/album/add_photo/<?= $album->getId()?>" class="<?= $controller->getActionName() == 'add_photo' ? 'selected' : '' ?>">_{Add photos}</a></li><? ?><li class="first"><a href="/photoapp/album/view/<?= $album->getId()?>" class="<?= in_array($controller->getActionName(),array( 'edit_photo', 'view')) ? 'selected' : '' ?>">_{View}</a></li><? ?><li class="first"><a href="/photoapp/album/uploaded/<?= $album->getId()?>" class="<?= $controller->getActionName() == 'uploaded' ? 'selected' : '' ?>">_{Edit uploaded}</a></li><? - ?><li><a href="/photoapp/album/edit/<?= $album->getId()?>" class="last <?= $controller->getActionName() == 'edit' ? 'selected' : '' ?>">_{Edit Info}</a></li><? + ?><li><a href="/photoapp/album/edit/<?= $album->getId()?>" class="last <?= $controller->getActionName() == 'edit' ? 'selected' : '' ?>">_{Edit info}</a></li><? ?><li><a href="/photoapp/album/delete/<?= $album->getId()?>" class="last <?= $controller->getActionName() == 'delete' ? 'selected' : '' ?>">_{Delete}</a></li> </ul> </div> <div class="right"> - <a href="/photoapp" class="<?= $controller->getActionName() == 'help' ? 'selected' : '' ?>">_{Back to Album}</a> + <a href="/photoapp" class="<?= $controller->getActionName() == 'help' ? 'selected' : '' ?>">_{Back}</a> </div> </div> <div class="clearfix"> </div> Modified: app/views/photoapp/album/_form.tpl =================================================================== --- app/views/photoapp/album/_form.tpl 2008-05-25 13:36:14 UTC (rev 225) +++ app/views/photoapp/album/_form.tpl 2008-05-25 14:08:14 UTC (rev 226) @@ -19,12 +19,7 @@ <div class="form_create_row"> <label >_{Privacy}:</label> <div class="form_create_col"> - <select> - <option>Everyone</option> - <option>Friends of Friends</option> - <option>Only Friends</option> - <option>Customize...</option> - </select> + <?= $access_field_helper->access_field('album', 'privacy', array('title' => 'Privacy')); ?> </div> </div> <div class="clearfix"></div> @@ -32,7 +27,7 @@ <div class="form_create_row"> <label > </label> <div class="form_create_col"> - <input class="submitinput" type="submit" value="_{Create Album}"/> + <input class="submitinput" type="submit" value="_{Save album}"/> </div> </div> <div class="clearfix"></div> Modified: app/views/photoapp/album/add_photo.tpl =================================================================== --- app/views/photoapp/album/add_photo.tpl 2008-05-25 13:36:14 UTC (rev 225) +++ app/views/photoapp/album/add_photo.tpl 2008-05-25 14:08:14 UTC (rev 226) @@ -51,7 +51,7 @@ <div class="clearfix"></div> <div class="form_row"> - <small>You can upload JPG, GIF or PNG files.</small> + <small>You can upload JPG files.</small> </div> <div class="clearfix"></div> @@ -68,7 +68,6 @@ <label > </label> <div class="form_create_col"> <input class="submitinput" type="submit" value="_{Upload}"/> - <input class="cancelinput" type="button" value="_{Cancel}"/> </div> </div> <div class="clearfix"></div> Modified: app/views/photoapp/album/delete.tpl =================================================================== --- app/views/photoapp/album/delete.tpl 2008-05-25 13:36:14 UTC (rev 225) +++ app/views/photoapp/album/delete.tpl 2008-05-25 14:08:14 UTC (rev 226) @@ -14,11 +14,10 @@ _{Delete Photo Album}? </div> <div class="text"> - {album.name?} is empty. Delete it? + {album.name?} _{may be not empty. Delete it with photos?} </div> <div class="formbtns"> <input class="submitinput" type="submit" value="_{Delete Album}"/> - <input class="cancelinput" type="button" value="_{Cancel}"/> </div> </div> </form> Modified: app/views/photoapp/album/index.tpl =================================================================== --- app/views/photoapp/album/index.tpl 2008-05-25 13:36:14 UTC (rev 225) +++ app/views/photoapp/album/index.tpl 2008-05-25 14:08:14 UTC (rev 226) @@ -27,7 +27,7 @@ {loop my_albums} <div class="album"> <div class="img"><? if ($my_album->get('img') != '' || $my_album->get('img')) {?><img src="/preview/index/100x100/<?= $my_album->get('img')?>" /><? - } else {?>No Cover choosed<? + } else {?>_{No cover choosed}<? } ?></div> <div class="info"> Modified: app/views/photoapp/album/uploaded.tpl =================================================================== --- app/views/photoapp/album/uploaded.tpl 2008-05-25 13:36:14 UTC (rev 225) +++ app/views/photoapp/album/uploaded.tpl 2008-05-25 14:08:14 UTC (rev 226) @@ -45,7 +45,7 @@ <div class="form_create_row"> <label class="medium"> </label> <div class="form_create_col"> - <input class="submitinput" type="submit" value="_{Update Info}"/> + <input class="submitinput" type="submit" value="_{Update}"/> </div> </div> <div class="clearfix"></div> Modified: app/views/photoapp/album/view.tpl =================================================================== --- app/views/photoapp/album/view.tpl 2008-05-25 13:36:14 UTC (rev 225) +++ app/views/photoapp/album/view.tpl 2008-05-25 14:08:14 UTC (rev 226) @@ -21,8 +21,8 @@ </div> <div class="links"> <ul class="actions_list"> - <li><a href="/photoapp/album/edit_photo/<?= $photo->getId()?>">_{Edit Photo}</a></li> - <li><a href="/photoapp/album/delete_photo/<?= $photo->getId()?>">_{Delete Photo}</a></li> + <li><a href="/photoapp/album/edit_photo/<?= $photo->getId()?>">_{Edit}</a></li> + <li><a href="/photoapp/album/delete_photo/<?= $photo->getId()?>">_{Delete}</a></li> <li><a href="/photoapp/album/set_cover/<?= $photo->getId()?>">_{Cover}</a></li> </ul> </div> Modified: timesheet/eerunov.txt =================================================================== --- timesheet/eerunov.txt 2008-05-25 13:36:14 UTC (rev 225) +++ timesheet/eerunov.txt 2008-05-25 14:08:14 UTC (rev 226) @@ -16,5 +16,5 @@ 2008-05-20,18:00,19:00,photoapp,RT:2,"edit photo - save cover to album,trouble in destroyPhoto when it is cover" 2008-05-21,18:30,21:20,photoapp,RT:2,"cover + triggers for photos_count in album" 2008-05-23,17:00,18:30,phoyoapp,RT:2,"remove is_cover in model" -2008-05-25,11:00,13:30.photoapp,RT:2,"album paginator" +2008-05-25,11:00,17:00.photoapp,RT:2,"album paginator" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-05-25 13:36:07
|
Revision: 225 http://isocial.svn.sourceforge.net/isocial/?rev=225&view=rev Author: dim0s77 Date: 2008-05-25 06:36:14 -0700 (Sun, 25 May 2008) Log Message: ----------- timesheeting Modified Paths: -------------- timesheet/dim0s77.txt Modified: timesheet/dim0s77.txt =================================================================== --- timesheet/dim0s77.txt 2008-05-25 13:33:19 UTC (rev 224) +++ timesheet/dim0s77.txt 2008-05-25 13:36:14 UTC (rev 225) @@ -25,3 +25,5 @@ 2008-05-15,21:15,22:00,groupapp,RT:3,"discussion board: reply to post" 2008-05-17,10:50,11:40,groupapp,RT:3,"discussion board: reply to post" + +2008-05-25,09:00,16:35,groupapp,RT:3,"groupapp" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-05-25 13:33:14
|
Revision: 224 http://isocial.svn.sourceforge.net/isocial/?rev=224&view=rev Author: dim0s77 Date: 2008-05-25 06:33:19 -0700 (Sun, 25 May 2008) Log Message: ----------- show user groups on home groupapp page Modified Paths: -------------- app/controllers/groupapp/board_controller.php app/controllers/groupapp/group_controller.php app/controllers/user_controller.php app/installers/groupapp/group_installer.php app/models/groupapp_group.php app/models/groupapp_member.php app/models/groupapp_message.php app/models/user.php app/views/groupapp/board/_menu.tpl app/views/groupapp/board/reply_to_post.tpl app/views/groupapp/board/reply_to_topic.tpl app/views/groupapp/board/start_topic.tpl app/views/groupapp/group/_members_list.tpl app/views/groupapp/group/edit_members.tpl app/views/groupapp/group/index.tpl public/stylesheets/common/Submenu.css public/stylesheets/groupapp/Board.css public/stylesheets/groupapp/Group.css Modified: app/controllers/groupapp/board_controller.php =================================================================== --- app/controllers/groupapp/board_controller.php 2008-05-25 13:15:10 UTC (rev 223) +++ app/controllers/groupapp/board_controller.php 2008-05-25 13:33:19 UTC (rev 224) @@ -8,7 +8,7 @@ if (!empty($this->params['id'])) { $messages = $this->GroupappMessage->find('all', array( - 'conditions' => array("group_id = ?", $this->params['id']), + 'conditions' => array("groupapp_group_id = ?", $this->params['id']), 'include' => 'user' ) ); @@ -33,7 +33,7 @@ $topics[$message->topic_id]['last'] = $message; } } - $this->group_id = $group->getId(); + $this->groupapp_group_id = $group->getId(); $this->group_name = $group->name; $this->topics = $topics; } @@ -48,13 +48,13 @@ ) ); if ($messages) { - $member = $this->GroupappMember->findFirst(array( 'group_id' => $messages[0]->group_id, + $member = $this->GroupappMember->findFirst(array( 'groupapp_group_id' => $messages[0]->groupapp_group_id, 'user_id' => $this->current_user->getId() )); - $group = $this->GroupappGroup->find( $messages[0]->group_id ); + $group = $this->GroupappGroup->find( $messages[0]->groupapp_group_id ); if (($group && $group->access == 1) || $member) { $this->messages = $messages; - $this->group_id = $group->getId(); + $this->groupapp_group_id = $group->getId(); $this->group_name = $group->name; $this->topic_id = $messages[0]->topic_id; } else { @@ -68,10 +68,10 @@ function start_topic () { if (!empty($this->params['topic']) && - !empty($this->params['topic']['group_id']) && + !empty($this->params['topic']['groupapp_group_id']) && !empty($this->params['topic']['body'])) { - if ( $this->group = $this->GroupappGroup->find( $this->params['topic']['group_id'] ) ) { - $member = $this->GroupappMember->findFirst(array( 'group_id' => $this->group->getId(), + if ( $this->group = $this->GroupappGroup->find( $this->params['topic']['groupapp_group_id'] ) ) { + $member = $this->GroupappMember->findFirst(array( 'groupapp_group_id' => $this->group->getId(), 'user_id' => $this->current_user->getId() )); if ($member) { @@ -95,7 +95,7 @@ } else if (!empty($this->params['id'])) { if ( $group = $this->GroupappGroup->find( $this->params['id'] ) ) { $this->topic = $group->message->build(); - $this->group_id = $group->getId(); + $this->groupapp_group_id = $group->getId(); $this->group_name = $group->name; $this->topic_id = $this->topic->getId(); } @@ -107,11 +107,11 @@ function reply_to_topic () { if (!empty($this->params['topic']) && - !empty($this->params['topic']['group_id']) && + !empty($this->params['topic']['groupapp_group_id']) && !empty($this->params['topic']['topic_id']) && !empty($this->params['topic']['body'])) { - if ( $this->group = $this->GroupappGroup->find( $this->params['topic']['group_id'] ) ) { - $member = $this->GroupappMember->findFirst(array( 'group_id' => $this->group->getId(), + if ( $this->group = $this->GroupappGroup->find( $this->params['topic']['groupapp_group_id'] ) ) { + $member = $this->GroupappMember->findFirst(array( 'groupapp_group_id' => $this->group->getId(), 'user_id' => $this->current_user->getId() )); if ($member) { @@ -130,13 +130,13 @@ ) ); if ($messages) { - $member = $this->GroupappMember->findFirst(array( 'group_id' => $messages[0]->group_id, + $member = $this->GroupappMember->findFirst(array( 'groupapp_group_id' => $messages[0]->groupapp_group_id, 'user_id' => $this->current_user->getId() )); - $group = $this->GroupappGroup->find( $messages[0]->group_id ); + $group = $this->GroupappGroup->find( $messages[0]->groupapp_group_id ); if (($group && $group->access == 1) || $member) { $this->messages = $messages; - $this->group_id = $group->getId(); + $this->groupapp_group_id = $group->getId(); $this->group_name = $group->name; $this->topic_id = $messages[0]->topic_id; } else { @@ -150,8 +150,8 @@ function reply_to_post () { if (!empty($this->params['topic'])) { - if ( $this->group = $this->GroupappGroup->find( $this->params['topic']['group_id'] ) ) { - $member = $this->GroupappMember->findFirst(array( 'group_id' => $this->group->getId(), + if ( $this->group = $this->GroupappGroup->find( $this->params['topic']['groupapp_group_id'] ) ) { + $member = $this->GroupappMember->findFirst(array( 'groupapp_group_id' => $this->group->getId(), 'user_id' => $this->current_user->getId() )); if ($member) { @@ -172,13 +172,13 @@ ) ); if ($message) { - $member = $this->GroupappMember->findFirst(array( 'group_id' => $message->group_id, + $member = $this->GroupappMember->findFirst(array( 'groupapp_group_id' => $message->groupapp_group_id, 'user_id' => $this->current_user->getId() )); - $group = $this->GroupappGroup->find( $message->group_id ); + $group = $this->GroupappGroup->find( $message->groupapp_group_id ); if (($group && $group->access == 1) || $member) { $this->message_to_reply = $message; - $this->group_id = $group->getId(); + $this->groupapp_group_id = $group->getId(); $this->group_name = $group->name; $this->topic_id = $message->topic_id; } else { Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-05-25 13:15:10 UTC (rev 223) +++ app/controllers/groupapp/group_controller.php 2008-05-25 13:33:19 UTC (rev 224) @@ -4,10 +4,18 @@ { var $models = array('GroupappGroup', 'GroupappGroupType', 'GroupappMember', 'GroupappMemberRole', - 'GroupappMessage'); + 'GroupappMessage', 'User'); function index () { $this->group_types = $this->GroupappGroupType->find('all', array('conditions' => array("parent_id = 0"))); + $this->user_groups = $this->current_user->groupapp_group->load(); + $gt = array(); + for ($i = 0; $i < count($this->group_types); $i++) { + $id = $this->group_types[$i]->id; + $name = $this->group_types[$i]->get('name'); + $gt[$id] = $name; + } + $this->gt = $gt; } function create () { @@ -84,25 +92,25 @@ $this->moderators_count = 0; $this->members_count = 0; foreach ($this->members as $member) { - if ($member->role_id == 1) $this->owners_count++; - elseif ($member->role_id == 2) $this->admins_count++; - elseif ($member->role_id == 3) $this->moderators_count++; - elseif ($member->role_id == 4) $this->members_count++; + if ($member->groupapp_member_role_id == 1) $this->owners_count++; + elseif ($member->groupapp_member_role_id == 2) $this->admins_count++; + elseif ($member->groupapp_member_role_id == 3) $this->moderators_count++; + elseif ($member->groupapp_member_role_id == 4) $this->members_count++; } } $this->importErrors( $this->GroupappGroup->getErrors() ); } function remove_member () { - if (!empty($this->params['group_id']) && !empty($this->params['member_id']) && - !empty($this->params['role_id']) && !empty($this->params['list_id'])) + if (!empty($this->params['groupapp_group_id']) && !empty($this->params['member_id']) && + !empty($this->params['groupapp_member_role_id']) && !empty($this->params['list_id'])) { - $this->group = $this->GroupappGroup->find($this->params['group_id']); + $this->group = $this->GroupappGroup->find($this->params['groupapp_group_id']); $this->GroupappMember->destroyAll("id = " . $this->params['member_id']); $members = $this->_getGroupMembers(); $members_count = 0; foreach ($members as $member) { - if ($member->role_id == $this->params['role_id']) { $members_count++; } + if ($member->groupapp_member_role_id == $this->params['groupapp_member_role_id']) { $members_count++; } } $members_group_name = ''; $empty_message = ''; @@ -117,22 +125,22 @@ 'members_count' => $members_count, 'members_group_name' => $members_group_name, 'empty_message' => $empty_message, - 'role' => $this->params['role_id'], + 'role' => $this->params['groupapp_member_role_id'], 'list_id' => $this->params['list_id'] ))); } } function change_member_status () { - if (!empty($this->params['group_id']) && !empty($this->params['member_id']) && - !empty($this->params['role_id']) && !empty($this->params['list_id'])) + if (!empty($this->params['groupapp_group_id']) && !empty($this->params['member_id']) && + !empty($this->params['groupapp_member_role_id']) && !empty($this->params['list_id'])) { - $this->group = $this->GroupappGroup->find($this->params['group_id']); + $this->group = $this->GroupappGroup->find($this->params['groupapp_group_id']); } } function _getGroupMembers () { - return $this->GroupappMember->find('all', array('conditions' => array("group_id = ?", + return $this->GroupappMember->find('all', array('conditions' => array("groupapp_group_id = ?", $this->group->getId()), 'include' => 'user')); } Modified: app/controllers/user_controller.php =================================================================== --- app/controllers/user_controller.php 2008-05-25 13:15:10 UTC (rev 223) +++ app/controllers/user_controller.php 2008-05-25 13:33:19 UTC (rev 224) @@ -2,9 +2,8 @@ class UserController extends ApplicationController { + var $models = array('User', 'Confirmation', 'GroupappGroup'); - var $models = array('User', 'Confirmation'); - function beforeAction ( $method = '' ) { $user = $this->_getUserFromSession(); Modified: app/installers/groupapp/group_installer.php =================================================================== --- app/installers/groupapp/group_installer.php 2008-05-25 13:15:10 UTC (rev 223) +++ app/installers/groupapp/group_installer.php 2008-05-25 13:33:19 UTC (rev 224) @@ -30,6 +30,7 @@ `type_id` int(11) NOT NULL DEFAULT '0', `name` char(100) NOT NULL DEFAULT '', `description` char(255) NOT NULL DEFAULT '', + `members_count` int(11) NOT NULL DEFAULT 0, `recent_news` char(255) NOT NULL DEFAULT '', `office` char(100) NOT NULL DEFAULT '', `email` char(100) NOT NULL DEFAULT '', @@ -63,26 +64,40 @@ $this->execute( "CREATE TABLE `groupapp_members` ( - `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `group_id` int(11) NOT NULL DEFAULT '0', - `user_id` int(11) NOT NULL DEFAULT '0', - `role_id` int(1) UNSIGNED NOT NULL DEFAULT '4', - FOREIGN KEY (group_id) REFERENCES groupapp_groups(id), - FOREIGN KEY (role_id) REFERENCES groupapp_member_roles(id) + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `groupapp_group_id` int(11) NOT NULL DEFAULT '0', + `user_id` int(11) NOT NULL DEFAULT '0', + `groupapp_member_role_id` int(1) UNSIGNED NOT NULL DEFAULT '4', + FOREIGN KEY (groupapp_group_id) REFERENCES groupapp_groups(id), + FOREIGN KEY (groupapp_member_role_id) REFERENCES groupapp_member_roles(id) ) ENGINE=InnoDB"); $this->execute( + "CREATE TRIGGER gapp_group_insert AFTER INSERT ON groupapp_members + FOR EACH ROW BEGIN + UPDATE `groupapp_groups` SET members_count = members_count + 1 WHERE id = NEW.groupapp_group_id; + END; + "); + + $this->execute( + "CREATE TRIGGER gapp_group_delete AFTER DELETE ON groupapp_members + FOR EACH ROW BEGIN + UPDATE `groupapp_groups` SET members_count = members_count - 1 WHERE id = OLD.groupapp_group_id; + END; + "); + + $this->execute( "CREATE TABLE `groupapp_messages` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `group_id` int(11) NOT NULL DEFAULT '0', + `groupapp_group_id` int(11) NOT NULL DEFAULT '0', `topic_id` int(11) NOT NULL DEFAULT '0', `reply_message_id` int(11) NOT NULL DEFAULT '0', `user_id` int(11) NOT NULL DEFAULT '0', `subject` char(255) NOT NULL DEFAULT '', `body` text NOT NULL DEFAULT '', `created_at` datetime NOT NULL, - FOREIGN KEY (group_id) REFERENCES groupapp_groups(id), - INDEX group_idx (group_id), + FOREIGN KEY (groupapp_group_id) REFERENCES groupapp_groups(id), + INDEX groupapp_group_idx (groupapp_group_id), INDEX topic_idx (topic_id) ) ENGINE=InnoDB"); @@ -90,12 +105,26 @@ function down_1() { + $this->transactionComplete(); $this->dropTable('groupapp_messages'); $this->dropTable('groupapp_members'); $this->dropTable('groupapp_member_roles'); $this->dropTable('groupapp_groups'); $this->dropTable('groupapp_group_types'); } + + function dropTable($table_name, $options = array()) + { + if($this->tableExists($table_name)){ + $result = $this->db->execute('DROP TABLE '.$table_name); + if ($result) { + unset($this->available_tables[array_search($table_name, $this->available_tables)]); + if(!empty($options['sequence'])){ + $this->dropSequence($table_name); + } + } + } + } } ?> Modified: app/models/groupapp_group.php =================================================================== --- app/models/groupapp_group.php 2008-05-25 13:15:10 UTC (rev 223) +++ app/models/groupapp_group.php 2008-05-25 13:33:19 UTC (rev 224) @@ -3,11 +3,18 @@ class GroupappGroup extends ActiveRecord { var $has_one = array('group_member' => array('class_name' => 'GroupappMember', - 'foreign_key' => 'group_id'), + 'foreign_key' => 'groupapp_group_id') ); var $has_many = array( 'messages' => array('class_name' => 'GroupappMessage', - 'foreign_key' => 'group_id') ); + 'foreign_key' => 'groupapp_group_id') ); + var $belongs_to = array('group_type' => array('class_name' => 'GroupappGroupType', + 'primary_key_name' => 'type_id') + ); + + +# var $has_and_belongs_to_many = array('users' => array('join_table' => 'groupapp_members')); + function validateOnCreate () { $this->validatesPresenceOf('name', 'Name is missing|please enter the name'); Modified: app/models/groupapp_member.php =================================================================== --- app/models/groupapp_member.php 2008-05-25 13:15:10 UTC (rev 223) +++ app/models/groupapp_member.php 2008-05-25 13:33:19 UTC (rev 224) @@ -5,11 +5,13 @@ var $belongs_to = array('user' => array('class_name' => 'User', 'primary_key_name' => 'user_id'), 'role' => array('class_name' => 'GroupMemberRole', - 'primary_key_name' => 'role_id') + 'primary_key_name' => 'groupapp_member_role_id'), + 'group' => array('class_name' => 'GroupappGroup', + 'primary_key_name' => 'groupapp_group_id') ); var $has_many = array( 'messages' => array('class_name' => 'GroupappMessage', - 'foreign_key' => 'user_id') ); - + 'foreign_key' => 'user_id') + ); } ?> Modified: app/models/groupapp_message.php =================================================================== --- app/models/groupapp_message.php 2008-05-25 13:15:10 UTC (rev 223) +++ app/models/groupapp_message.php 2008-05-25 13:33:19 UTC (rev 224) @@ -5,7 +5,7 @@ var $belongs_to = array('user' => array('class_name' => 'User', 'foreign_key' => 'user_id'), 'group' => array('class_name' => 'GroupappGroup', - 'foreign_key' => 'group_id') + 'foreign_key' => 'groupapp_group_id') ); /* function validateOnCreate () */ Modified: app/models/user.php =================================================================== --- app/models/user.php 2008-05-25 13:15:10 UTC (rev 223) +++ app/models/user.php 2008-05-25 13:33:19 UTC (rev 224) @@ -12,7 +12,11 @@ 'conditions' => 'is_recipient_del = 0'), 'im_profiles' => array('class_name' => 'ImProfile', 'foreign_key' => 'user_id'), + /* 'groupapp_groups' => array('class_name' => 'GroupappMember', */ + /* 'foreign_key' => 'user_id'), */ ); + + var $has_and_belongs_to_many = array('groupapp_groups' => array('join_table' => 'groupapp_members')); var $has_one = array('BasicProfile', 'ContactProfile', 'RelationshipProfile', 'PersonalProfile'); Modified: app/views/groupapp/board/_menu.tpl =================================================================== --- app/views/groupapp/board/_menu.tpl 2008-05-25 13:15:10 UTC (rev 223) +++ app/views/groupapp/board/_menu.tpl 2008-05-25 13:33:19 UTC (rev 224) @@ -1,7 +1,7 @@ <div class="tabs"> <div class="left"> <ul class="toggle_tabs"> - <li class="first"><a href="/groupapp/board/{group_id?}" class="<?= $controller->getActionName() == 'index' ? 'selected' : '' ?>">_{Discussion Board}</a></li><? + <li class="first"><a href="/groupapp/board/{groupapp_group_id?}" class="<?= $controller->getActionName() == 'index' ? 'selected' : '' ?>">_{Discussion Board}</a></li><? if ($controller->getActionName() == 'show_topic' || $controller->getActionName() == 'reply_to_topic' || $controller->getActionName() == 'reply_to_post' @@ -16,7 +16,7 @@ <div class="right"> <ul class="toggle_tabs"> <? if ($controller->getActionName() != 'reply_to_topic' && $controller->getActionName() != 'reply_to_post') { ?> - <li class="first last"><a href="/groupapp/board/start_topic/{group_id?}" class="<?= $controller->getActionName() == 'start_topic' ? 'selected' : '' ?>">_{Start New Topic}</a></li> + <li class="first last"><a href="/groupapp/board/start_topic/{groupapp_group_id?}" class="<?= $controller->getActionName() == 'start_topic' ? 'selected' : '' ?>">_{Start New Topic}</a></li> <? } ?> </ul> </div> Modified: app/views/groupapp/board/reply_to_post.tpl =================================================================== --- app/views/groupapp/board/reply_to_post.tpl 2008-05-25 13:15:10 UTC (rev 223) +++ app/views/groupapp/board/reply_to_post.tpl 2008-05-25 13:33:19 UTC (rev 224) @@ -46,7 +46,7 @@ </div> <div class="formrow"> <label> - <?= $form_helper->hidden_field('topic', 'group_id', array('value' => $message_to_reply->group_id))?> + <?= $form_helper->hidden_field('topic', 'groupapp_group_id', array('value' => $message_to_reply->groupapp_group_id))?> <?= $form_helper->hidden_field('topic', 'topic_id', array('value' => $message_to_reply->topic_id))?> <?= $form_helper->hidden_field('topic', 'subject', array('value' => $message_to_reply->subject))?> <?= $form_helper->hidden_field('topic', 'reply_message_id', array('value' => $message_to_reply->getId()))?> Modified: app/views/groupapp/board/reply_to_topic.tpl =================================================================== --- app/views/groupapp/board/reply_to_topic.tpl 2008-05-25 13:15:10 UTC (rev 223) +++ app/views/groupapp/board/reply_to_topic.tpl 2008-05-25 13:33:19 UTC (rev 224) @@ -20,7 +20,7 @@ </div> <div class="formrow"> <label> - <?= $form_helper->hidden_field('topic', 'group_id', array('value' => $messages[0]->group_id))?> + <?= $form_helper->hidden_field('topic', 'groupapp_group_id', array('value' => $messages[0]->groupapp_group_id))?> <?= $form_helper->hidden_field('topic', 'topic_id', array('value' => $messages[0]->topic_id))?> <?= $form_helper->hidden_field('topic', 'subject', array('value' => $messages[0]->subject))?> </label> Modified: app/views/groupapp/board/start_topic.tpl =================================================================== --- app/views/groupapp/board/start_topic.tpl 2008-05-25 13:15:10 UTC (rev 223) +++ app/views/groupapp/board/start_topic.tpl 2008-05-25 13:33:19 UTC (rev 224) @@ -3,7 +3,7 @@ <?= $controller->renderErrors() ?> <div class="board_from_background"> -<form action="/groupapp/board/start_topic/{group_id?}" method="post"> +<form action="/groupapp/board/start_topic/{groupapp_group_id?}" method="post"> <div class="editform"> <div class="formrow"> <label>_{Topic}:</label> @@ -15,7 +15,7 @@ </div> <div class="formrow"> <label> - <?= $form_helper->hidden_field('topic', 'group_id', array('value' => $group_id))?> + <?= $form_helper->hidden_field('topic', 'groupapp_group_id', array('value' => $groupapp_group_id))?> </label> <input class="submitinput" type="submit" value="_{Create new Topic}"> <input class="cancelinput" type="button" value="_{Cancel}"> Modified: app/views/groupapp/group/_members_list.tpl =================================================================== --- app/views/groupapp/group/_members_list.tpl 2008-05-25 13:15:10 UTC (rev 223) +++ app/views/groupapp/group/_members_list.tpl 2008-05-25 13:33:19 UTC (rev 224) @@ -6,7 +6,7 @@ <div class="members_list"> <ul> {?members}{loop members} - <? if ($member->role_id == $role) { ?> + <? if ($member->groupapp_member_role_id == $role) { ?> <li> <span class="member_name"><a href="/profile/show/{member.id}">{member.user.name}</a></span> <span class="change_status"><a href="#" onclick="change_member_status(this); return false;" name="{member.id}">_{change status}</a></span> Modified: app/views/groupapp/group/edit_members.tpl =================================================================== --- app/views/groupapp/group/edit_members.tpl 2008-05-25 13:15:10 UTC (rev 223) +++ app/views/groupapp/group/edit_members.tpl 2008-05-25 13:33:19 UTC (rev 224) @@ -36,7 +36,7 @@ <div class="members_list"> <ul> {?members}{loop members} - <? if ($member->role_id == 1) { ?> + <? if ($member->groupapp_member_role_id == 1) { ?> <li> <span class="member_name"><a href="/profile/show/{member.id}">{member.user.name}</a></span> <span class="change_status"> @@ -59,7 +59,7 @@ <div class="members_list"> <ul> {?members}{loop members} - <? if ($member->role_id == 2) { ?> + <? if ($member->groupapp_member_role_id == 2) { ?> <li> <span class="member_name"><a href="/profile/show/{member.id}">{member.user.name}</a></span> <span class="change_status"> @@ -82,7 +82,7 @@ <div class="members_list"> <ul> {?members}{loop members} - <? if ($member->role_id == 3) { ?> + <? if ($member->groupapp_member_role_id == 3) { ?> <li> <span class="member_name"><a href="/profile/show/{member.id}">{member.user.name}</a></span> <span class="change_status"> @@ -106,7 +106,7 @@ <div class="members_list"> <ul> {?members}{loop members} - <? if ($member->role_id == 4) { ?> + <? if ($member->groupapp_member_role_id == 4) { ?> <li> <span class="member_name"><a href="/profile/show/{member.id}">{member.user.name}</a></span> <span class="change_status"> @@ -130,7 +130,7 @@ </div> <script> -function remove_member (element, group_id, list_id, role) { +function remove_member (element, groupapp_group_id, list_id, role) { new Dialog.Box('dlg', { reference: element, title: '_{Remove member}?', @@ -143,10 +143,10 @@ { method:'post', asynchronous:true, parameters: - 'group_id=' + group_id + + 'groupapp_group_id=' + groupapp_group_id + '&list_id=' + list_id + '&member_id=' + element.name + - '&role_id=' + role + '&groupapp_member_role_id=' + role }); } }); @@ -154,7 +154,7 @@ return false; } -function change_member_status (element, group_id, list_id, role) { +function change_member_status (element, groupapp_group_id, list_id, role) { var body_content = '<?= $form_helper->radio_button('member', 'status', '1', array('checked' => 'checked')) ?>_{Owner}' + '<?= $form_helper->radio_button('member', 'status', '2') ?>_{Administrator}' + '<?= $form_helper->radio_button('member', 'status', '3') ?>_{Moderator}' + @@ -171,10 +171,10 @@ { method:'post', asynchronous:true, parameters: - 'group_id=' + group_id + + 'groupapp_group_id=' + groupapp_group_id + '&list_id=' + list_id + '&member_id=' + element.name + - '&role_id=' + role + '&groupapp_member_role_id=' + role }); } }); Modified: app/views/groupapp/group/index.tpl =================================================================== --- app/views/groupapp/group/index.tpl 2008-05-25 13:15:10 UTC (rev 223) +++ app/views/groupapp/group/index.tpl 2008-05-25 13:33:19 UTC (rev 224) @@ -13,12 +13,64 @@ <div class="clearfix"></div> <div class="subheader"><a href="/groupapp/group/create">_{Create a New Group}</a></div> </div> +<div class="clearfix"></div> </div> + +{?user_groups} +<div class="submenu_separator"> </div> +<div class="submenu"> + <div class="menu_block selector"> + <label for="action_select">_{Show}: + <select onchange="doselect(this)" id="action_select" name="action_select"> + <option selected="selected" value="none">_{All groups}</option> + <option value="read">_{Recently Updated}</option> + <option value="unread">_{By Group Member Size}</option> + <option value="all">_{Groups You Admin}</option> + </select> + </label> + </div> +</div> <div class="clearfix"></div> +<div class="groups_list"> + <div class="info">_{You are in groups}: <?= count($user_groups); ?></div> + + <div class="container"> + {loop user_groups} + <div class="row"> + + <div class="actions"> + <ul class="actions_list"> + <li><a href="/groupapp/group/edit_info/{user_group.id?}">_{Edit Group}</a></li> + <li><a href="#">_{Leave Group}</a></li> + </ul> + </div> + + <div class="avatar"> + <a href="/groupapp/group/show_group/{user_group.id?}"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a> + </div> + + <div class="info"> + <div class="name"><a href="/groupapp/group/show_group/{user_group.id?}">{user_group.name}</a></div> + <div class="other param">_{Members count}:</div> + <div class="other value">{user_group.members_count}</div> + <div class="clearfix"></div> + <div class="other param">_{Type}:</div> + <div class="other value"><? $id = $user_group->type_id; echo $gt[$id]; ?></div> + <div class="clearfix"></div> + </div> + + <div class="clearfix"></div> + </div> + {end} + </div> + +</div> +{else} <div class="nogroups"> _{You have not joined any groups}. </div> +{end} <div class="clearfix"></div> <div class="actions"> Modified: public/stylesheets/common/Submenu.css =================================================================== --- public/stylesheets/common/Submenu.css 2008-05-25 13:15:10 UTC (rev 223) +++ public/stylesheets/common/Submenu.css 2008-05-25 13:33:19 UTC (rev 224) @@ -55,3 +55,9 @@ cursor: default; text-decoration: none; } + +.submenu_separator { + display: block; + margin-top: 5px; + border-bottom: 1px solid #cccccc; +} \ No newline at end of file Modified: public/stylesheets/groupapp/Board.css =================================================================== --- public/stylesheets/groupapp/Board.css 2008-05-25 13:15:10 UTC (rev 223) +++ public/stylesheets/groupapp/Board.css 2008-05-25 13:33:19 UTC (rev 224) @@ -109,3 +109,10 @@ .message .head .sender .other_user { font-weight: bold; } + +.group_list { + float: left; + background: #ffffff; + width: 100%; + margin: 10px; +} Modified: public/stylesheets/groupapp/Group.css =================================================================== --- public/stylesheets/groupapp/Group.css 2008-05-25 13:15:10 UTC (rev 223) +++ public/stylesheets/groupapp/Group.css 2008-05-25 13:33:19 UTC (rev 224) @@ -136,3 +136,59 @@ text-align: center; padding: 20px 0px 20px 0px; } + +.groups_list { + float: left; + background: #ffffff; + width: 100%; +} + +.groups_list .info { + padding: 10px 10px 5px 20px; +} + +.groups_list .container { + background: #f7f7f7; + padding: 5px; + border-top: solid 1px #dddddd; + border-bottom: solid 1px #dddddd; +} + +.groups_list .container .row { + background: #ffffff; + border: 1px solid #cccccc; + display: block; + margin: 3px; + padding: 10px 20px 10px 20px; +} + +.groups_list .container .row .avatar { + float: left; + width: 100px; +} + +.groups_list .container .row .info { + float: left; + width: 300px; + padding: 0px 5px 0px 5px; +} + +.groups_list .container .row .info .name { + padding: 0px; + margin-bottom: 10px; +} + +.groups_list .container .row .info .other { + float: left; + margin-bottom: 3px; +} + +.groups_list .container .row .info .other.param { + color: #999999; + margin-right: 5px; +} + +.groups_list .container .row .actions { + float: right; + width: 125px; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-25 13:15:05
|
Revision: 223 http://isocial.svn.sourceforge.net/isocial/?rev=223&view=rev Author: fsnobody Date: 2008-05-25 06:15:10 -0700 (Sun, 25 May 2008) Log Message: ----------- paging for photos in album Modified Paths: -------------- app/controllers/photoapp/album_controller.php Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-25 12:16:21 UTC (rev 222) +++ app/controllers/photoapp/album_controller.php 2008-05-25 13:15:10 UTC (rev 223) @@ -234,6 +234,10 @@ } + function defaultUrlOptions($options) { + return array('id' => $this->params['id']); + } + function debug($str) { echo "<pre>"; print_r($str); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-25 12:16:13
|
Revision: 222 http://isocial.svn.sourceforge.net/isocial/?rev=222&view=rev Author: fsnobody Date: 2008-05-25 05:16:21 -0700 (Sun, 25 May 2008) Log Message: ----------- after add album go to add photo action Modified Paths: -------------- app/controllers/photoapp/album_controller.php Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-25 11:58:30 UTC (rev 221) +++ app/controllers/photoapp/album_controller.php 2008-05-25 12:16:21 UTC (rev 222) @@ -139,7 +139,7 @@ $this->PhotoappAlbum->owner = $this->current_user->getId(); if ($this->Request->isPost() && $this->PhotoappAlbum->save()){ // success - $this->redirectTo(array('action' => 'index')); + $this->redirectTo(array('action' => 'add_photo', 'id' => $this->PhotoappAlbum->getId())); } else { $this->importErrors( $this->PhotoappAlbum->getErrors() ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-25 11:58:22
|
Revision: 221 http://isocial.svn.sourceforge.net/isocial/?rev=221&view=rev Author: fsnobody Date: 2008-05-25 04:58:30 -0700 (Sun, 25 May 2008) Log Message: ----------- paginator photo v1 Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/views/photoapp/album/view.tpl Added Paths: ----------- public/images/uploaded/ Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-25 10:46:46 UTC (rev 220) +++ app/controllers/photoapp/album_controller.php 2008-05-25 11:58:30 UTC (rev 221) @@ -22,7 +22,19 @@ if (!empty($this->params['id']) && $this->PhotoappAlbum->find($this->params['id'])) { $this->album = $this->PhotoappAlbum->find($this->params['id']); } - $this->photos = $this->PhotoappPhoto->find('all', array('conditions' => array("album_id =" . $this->params['id']))); + //$this->photos = $this->PhotoappPhoto->find('all', array('conditions' => array("album_id =" . $this->params['id']))); + + + + $_filter_pagination = array('items_per_page' => 15, 'count_conditions' => "album_id =" . $this->params['id'] ); + + $this->photo_pages = $this->pagination_helper->getPaginator($this->PhotoappPhoto, $_filter_pagination);// paginator + + $_filter = array('conditions' => "album_id =" . $this->params['id']); + $options = array_merge($_filter, $this->pagination_helper->getFindOptions($this->PhotoappPhoto)); + + $this->photos = $this->PhotoappPhoto->find('all', $options); + return; } Modified: app/views/photoapp/album/view.tpl =================================================================== --- app/views/photoapp/album/view.tpl 2008-05-25 10:46:46 UTC (rev 220) +++ app/views/photoapp/album/view.tpl 2008-05-25 11:58:30 UTC (rev 221) @@ -30,6 +30,13 @@ {end} + {?photo_pages.links} + <div class="clearfix"></div> + <span><?php echo translate('Showing page %page of %number_of_pages',array('%page'=>$photo_pages->getCurrentPage(),'%number_of_pages'=>$photo_pages->pages))?></span> + <div>{photo_pages.links?}</div> + + {end} + </div> <div class="clearfix"></div> <? }?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-25 10:46:38
|
Revision: 220 http://isocial.svn.sourceforge.net/isocial/?rev=220&view=rev Author: fsnobody Date: 2008-05-25 03:46:46 -0700 (Sun, 25 May 2008) Log Message: ----------- album paginator Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/views/photoapp/album/index.tpl app/views/photoapp/album/uploaded.tpl public/stylesheets/photoapp/Album.css timesheet/eerunov.txt Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-23 17:14:09 UTC (rev 219) +++ app/controllers/photoapp/album_controller.php 2008-05-25 10:46:46 UTC (rev 220) @@ -5,12 +5,17 @@ var $models = array('photoapp', 'photoapp_album', 'photoapp_photo'); function index () { - //$this->redirectTo(array('action' => 'show')); - $this->my_albums = $this->PhotoappAlbum->find('all', array('conditions' => array('owner = ' . $this->current_user->getId()))); - if(is_array($this->my_albums)) - $this->count_albums = count($this->my_albums); - else - $this->count_albums = 0; + + $_filter_pagination = array('items_per_page' => 5, 'count_conditions' => 'owner = ' . $this->current_user->getId() ); + + $this->album_pages = $this->pagination_helper->getPaginator($this->PhotoappAlbum, $_filter_pagination);// paginator + + $_filter = array('conditions' => 'owner = ' . $this->current_user->getId()); + $options = array_merge($_filter, $this->pagination_helper->getFindOptions($this->PhotoappAlbum)); + + $this->my_albums = $this->PhotoappAlbum->find('all', $options); + + } function view () { Modified: app/views/photoapp/album/index.tpl =================================================================== --- app/views/photoapp/album/index.tpl 2008-05-23 17:14:09 UTC (rev 219) +++ app/views/photoapp/album/index.tpl 2008-05-25 10:46:46 UTC (rev 220) @@ -14,14 +14,14 @@ <div class="clearfix"></div> -<? if ($count_albums == 0) {?> +<? if ($album_pages->getItemCount() == 0) {?> <div class="noalbums"> _{You have no any album}. </div> <? } else {?> <div class="album_list"> - _{Photo Albums}: <?= $count_albums?> <span>|</span> <a href="#" >_{Album Privacy}</a> + _{Photo Albums}: <?= $album_pages->getItemCount()?> <span>|</span> <a href="#" >_{Album Privacy}</a> </div> <div class="container"> {loop my_albums} @@ -45,9 +45,15 @@ </div> </div> {end} + + {?album_pages.links} + <span><?php echo translate('Showing page %page of %number_of_pages',array('%page'=>$album_pages->getCurrentPage(),'%number_of_pages'=>$album_pages->pages))?></span> + <div>{album_pages.links?}</div> + {end} </div> <div class="clearfix"></div> + <? }?> <div class="clearfix"></div> Modified: app/views/photoapp/album/uploaded.tpl =================================================================== --- app/views/photoapp/album/uploaded.tpl 2008-05-23 17:14:09 UTC (rev 219) +++ app/views/photoapp/album/uploaded.tpl 2008-05-25 10:46:46 UTC (rev 220) @@ -17,7 +17,6 @@ {loop uploaded_photos} <div class="photo_comment"> <div class="img"> - <img src="/preview/index/100x100/<?= $uploaded_photo->get('img')?>" /> </div> <div class="data"> Modified: public/stylesheets/photoapp/Album.css =================================================================== --- public/stylesheets/photoapp/Album.css 2008-05-23 17:14:09 UTC (rev 219) +++ public/stylesheets/photoapp/Album.css 2008-05-25 10:46:46 UTC (rev 220) @@ -310,4 +310,8 @@ padding: 3px; margin: 2px 3px; text-align: center; +} + +.paginationLink { + padding: 1px 2px; } \ No newline at end of file Modified: timesheet/eerunov.txt =================================================================== --- timesheet/eerunov.txt 2008-05-23 17:14:09 UTC (rev 219) +++ timesheet/eerunov.txt 2008-05-25 10:46:46 UTC (rev 220) @@ -16,3 +16,5 @@ 2008-05-20,18:00,19:00,photoapp,RT:2,"edit photo - save cover to album,trouble in destroyPhoto when it is cover" 2008-05-21,18:30,21:20,photoapp,RT:2,"cover + triggers for photos_count in album" 2008-05-23,17:00,18:30,phoyoapp,RT:2,"remove is_cover in model" +2008-05-25,11:00,13:30.photoapp,RT:2,"album paginator" + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-23 17:14:01
|
Revision: 219 http://isocial.svn.sourceforge.net/isocial/?rev=219&view=rev Author: fsnobody Date: 2008-05-23 10:14:09 -0700 (Fri, 23 May 2008) Log Message: ----------- set cover + fix in beforeDestroy Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/models/photoapp_photo.php app/views/photoapp/album/_menu.tpl app/views/photoapp/album/edit_photo.tpl app/views/photoapp/album/view.tpl public/stylesheets/photoapp/Album.css Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-23 16:47:42 UTC (rev 218) +++ app/controllers/photoapp/album_controller.php 2008-05-23 17:14:09 UTC (rev 219) @@ -21,6 +21,23 @@ return; } + function set_cover () { + if (!empty($this->params['id']) && $this->PhotoappPhoto->find($this->params['id'])) { + $photo = $this->PhotoappPhoto->find($this->params['id']); + if ($photo) { + $album = $this->PhotoappAlbum->find($photo->album_id); + if ($album) { + + $album->img = $photo->img; + $album->save(); + } + } + $this->redirectTo(array('action' => 'view', 'id' => $photo->album_id)); + } + + } + + function edit_photo () { if (!empty($this->params['photo']) && $this->params['photo']['action_edit'] == 'do_edit'){ Modified: app/models/photoapp_photo.php =================================================================== --- app/models/photoapp_photo.php 2008-05-23 16:47:42 UTC (rev 218) +++ app/models/photoapp_photo.php 2008-05-23 17:14:09 UTC (rev 219) @@ -6,12 +6,14 @@ function beforeDestroy() { - $album_cover = $this->album->find('first', "img = '" . $this->img . "'"); - //$this->debug($album_cover); - if ($album_cover) { - $album_cover->img = ""; - $album_cover->save(); - } + $albums_cover = $this->album->find('all', array('conditions' => array("img = '" . $this->img . "'"))); + if ($albums_cover) + foreach ($albums_cover as $album) { + if ($album) { + $album->img = ""; + $album->save(); + } + } $path = str_replace("@" , "/", $this->img); $file = AK_PUBLIC_DIR . "/images/uploaded/" . $path; Modified: app/views/photoapp/album/_menu.tpl =================================================================== --- app/views/photoapp/album/_menu.tpl 2008-05-23 16:47:42 UTC (rev 218) +++ app/views/photoapp/album/_menu.tpl 2008-05-23 17:14:09 UTC (rev 219) @@ -2,8 +2,7 @@ <div class="left"> <ul class="toggle_tabs"> <li class="first"><a href="/photoapp/album/index" class="<?= $controller->getActionName() == 'index' ? 'selected' : '' ?>">_{My Albums}</a></li><? - ?><li><a href="/photoapp/album/photos_of_you" class="last <?= $controller->getActionName() == 'photos_of_you' ? 'selected' : '' ?>">_{Photos of You}</a></li> - </ul> + ?></ul> </div> <div class="right"> <ul class="toggle_tabs"> Modified: app/views/photoapp/album/edit_photo.tpl =================================================================== --- app/views/photoapp/album/edit_photo.tpl 2008-05-23 16:47:42 UTC (rev 218) +++ app/views/photoapp/album/edit_photo.tpl 2008-05-23 17:14:09 UTC (rev 219) @@ -21,14 +21,22 @@ </div> </div><div class="clearfix"></div> + <div class="form_create_row"> + <label > </label> + <div class="form_create_col"> + <a href="/photoapp/album/set_cover/<?= $photo->getId()?>" class="last">_{Set this photo as cover}</a> + </div> + </div><div class="clearfix"></div> + + + <div class="form_create_row"> <label >_{Description}:</label> <div class="form_create_col"> <?= $form_helper->text_area('photo', 'caption', array('rows' => '5', 'class' => 'small')) ?> </div> </div><div class="clearfix"></div> - <div class="form_create_row"> <label >_{Move to}:</label> <div class="form_create_col"> Modified: app/views/photoapp/album/view.tpl =================================================================== --- app/views/photoapp/album/view.tpl 2008-05-23 16:47:42 UTC (rev 218) +++ app/views/photoapp/album/view.tpl 2008-05-23 17:14:09 UTC (rev 219) @@ -23,6 +23,7 @@ <ul class="actions_list"> <li><a href="/photoapp/album/edit_photo/<?= $photo->getId()?>">_{Edit Photo}</a></li> <li><a href="/photoapp/album/delete_photo/<?= $photo->getId()?>">_{Delete Photo}</a></li> + <li><a href="/photoapp/album/set_cover/<?= $photo->getId()?>">_{Cover}</a></li> </ul> </div> </div> Modified: public/stylesheets/photoapp/Album.css =================================================================== --- public/stylesheets/photoapp/Album.css 2008-05-23 16:47:42 UTC (rev 218) +++ public/stylesheets/photoapp/Album.css 2008-05-23 17:14:09 UTC (rev 219) @@ -306,7 +306,7 @@ float: left; border: 1px solid #dedeee; width: 110px; - height: 136px; + height: 156px; padding: 3px; margin: 2px 3px; text-align: center; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-23 16:47:36
|
Revision: 218 http://isocial.svn.sourceforge.net/isocial/?rev=218&view=rev Author: fsnobody Date: 2008-05-23 09:47:42 -0700 (Fri, 23 May 2008) Log Message: ----------- fix in deleting albums Modified Paths: -------------- app/models/photoapp_photo.php Modified: app/models/photoapp_photo.php =================================================================== --- app/models/photoapp_photo.php 2008-05-23 16:24:56 UTC (rev 217) +++ app/models/photoapp_photo.php 2008-05-23 16:47:42 UTC (rev 218) @@ -4,15 +4,11 @@ { var $belongs_to = array('album' => array('class_name' => 'PhotoappAlbum', 'primary_key_name' => 'album_id') ); - /*function __constructor() { - echo 1; - die(); - $album = new PhotoappAlbum(); - return parent::__constructor(); - }*/ - function beforeDestroy() { - if ($album_cover = $this->album->findFirst("img = '" . $this->img . "'")) { + + $album_cover = $this->album->find('first', "img = '" . $this->img . "'"); + //$this->debug($album_cover); + if ($album_cover) { $album_cover->img = ""; $album_cover->save(); } @@ -23,6 +19,12 @@ return parent::beforeDestroy(); } + function debug($str) { + echo "<pre>"; + print_r($str); + echo "</pre>"; + } + } ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-23 16:24:58
|
Revision: 217 http://isocial.svn.sourceforge.net/isocial/?rev=217&view=rev Author: fsnobody Date: 2008-05-23 09:24:56 -0700 (Fri, 23 May 2008) Log Message: ----------- is_cover for photos removed Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/installers/photoapp/album_installer.php app/models/photoapp_photo.php app/views/photoapp/album/edit_photo.tpl timesheet/eerunov.txt Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-21 18:34:38 UTC (rev 216) +++ app/controllers/photoapp/album_controller.php 2008-05-23 16:24:56 UTC (rev 217) @@ -23,17 +23,20 @@ function edit_photo () { if (!empty($this->params['photo']) && $this->params['photo']['action_edit'] == 'do_edit'){ + + $photo = $this->PhotoappPhoto->findFirst(array('id' => $this->params['id'])); + $photo_old = new PhotoappPhoto(); + $photo_old->id = $photo->getId(); + $photo_old->album_id = $this->params['photo_old']['album_id']; + + if ($photo) { $album = $this->PhotoappAlbum->findFirst(array('id' => $photo->album_id)); if ($album->owner == $this->current_user->getId()) { $photo->setAttributes($this->params['photo']); + // check for old album. cases: 1 just update info, 2 moving to another album if ($this->Request->isPost() && $photo->save()){ - if ($photo->is_cover == 1) { - $album = $this->PhotoappAlbum->findFirst(array('id' => $photo->album_id)); - $album->img = $photo->img; - $album->save(); - } // set cover if needed $this->redirectTo(array('action' => 'view', 'id' => $album->id)); } } @@ -185,9 +188,7 @@ $album = $this->PhotoappAlbum->find($this->params['id']); if( empty($album->img)) { - $photo->is_cover = 1; $album->img = $photo->img; - $photo->is_cover = 1; $photo->save(); } //$album->photos_count += 1; Modified: app/installers/photoapp/album_installer.php =================================================================== --- app/installers/photoapp/album_installer.php 2008-05-21 18:34:38 UTC (rev 216) +++ app/installers/photoapp/album_installer.php 2008-05-23 16:24:56 UTC (rev 217) @@ -23,7 +23,6 @@ "CREATE TABLE `photoapp_photos` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, `album_id` int(11) NOT NULL , - `is_cover` int(1) UNSIGNED NOT NULL DEFAULT '0', `name` char(100) NOT NULL DEFAULT '', `caption` char(255) NOT NULL DEFAULT '', `created_at` datetime NOT NULL , Modified: app/models/photoapp_photo.php =================================================================== --- app/models/photoapp_photo.php 2008-05-21 18:34:38 UTC (rev 216) +++ app/models/photoapp_photo.php 2008-05-23 16:24:56 UTC (rev 217) @@ -12,11 +12,9 @@ }*/ function beforeDestroy() { - - if ($this->is_cover) { - $this->album->load(); - $this->album->img = ""; - $this->album->save(); + if ($album_cover = $this->album->findFirst("img = '" . $this->img . "'")) { + $album_cover->img = ""; + $album_cover->save(); } $path = str_replace("@" , "/", $this->img); Modified: app/views/photoapp/album/edit_photo.tpl =================================================================== --- app/views/photoapp/album/edit_photo.tpl 2008-05-21 18:34:38 UTC (rev 216) +++ app/views/photoapp/album/edit_photo.tpl 2008-05-23 16:24:56 UTC (rev 217) @@ -7,6 +7,7 @@ <div class="uploaded_container"> <?= $form_tag_helper->start_form_tag(array('action'=>'edit_photo', 'id' => $photo->getId())) ?> <?= $form_helper->hidden_field('photo', 'action_edit', array('value' => 'do_edit'))?> + <?= $form_helper->hidden_field('photo_old', 'album_id', array('value' => $photo->get('album_id')))?> <div class="edit_container"> <div class="photo_comment"> @@ -27,12 +28,6 @@ </div> </div><div class="clearfix"></div> - <div class="form_create_row"> - <label >_{Cover}:</label> - <div class="form_create_col"> - <?= $form_helper->check_box('photo', 'is_cover') ?> - </div> - </div><div class="clearfix"></div> <div class="form_create_row"> <label >_{Move to}:</label> Modified: timesheet/eerunov.txt =================================================================== --- timesheet/eerunov.txt 2008-05-21 18:34:38 UTC (rev 216) +++ timesheet/eerunov.txt 2008-05-23 16:24:56 UTC (rev 217) @@ -15,3 +15,4 @@ 2008-05-15,10:00,11:00,photoapp,RT:2,"edit photo" 2008-05-20,18:00,19:00,photoapp,RT:2,"edit photo - save cover to album,trouble in destroyPhoto when it is cover" 2008-05-21,18:30,21:20,photoapp,RT:2,"cover + triggers for photos_count in album" +2008-05-23,17:00,18:30,phoyoapp,RT:2,"remove is_cover in model" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-21 18:34:34
|
Revision: 216 http://isocial.svn.sourceforge.net/isocial/?rev=216&view=rev Author: fsnobody Date: 2008-05-21 11:34:38 -0700 (Wed, 21 May 2008) Log Message: ----------- in triggers leave only counters Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/installers/photoapp/album_installer.php timesheet/eerunov.txt Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-21 17:24:33 UTC (rev 215) +++ app/controllers/photoapp/album_controller.php 2008-05-21 18:34:38 UTC (rev 216) @@ -30,6 +30,7 @@ $photo->setAttributes($this->params['photo']); if ($this->Request->isPost() && $photo->save()){ if ($photo->is_cover == 1) { + $album = $this->PhotoappAlbum->findFirst(array('id' => $photo->album_id)); $album->img = $photo->img; $album->save(); } // set cover if needed @@ -186,6 +187,8 @@ if( empty($album->img)) { $photo->is_cover = 1; $album->img = $photo->img; + $photo->is_cover = 1; + $photo->save(); } //$album->photos_count += 1; $album->save(); Modified: app/installers/photoapp/album_installer.php =================================================================== --- app/installers/photoapp/album_installer.php 2008-05-21 17:24:33 UTC (rev 215) +++ app/installers/photoapp/album_installer.php 2008-05-21 18:34:38 UTC (rev 216) @@ -46,7 +46,19 @@ END; "); + $this->execute( + "CREATE TRIGGER papp_photo_update AFTER UPDATE ON photoapp_photos + FOR EACH ROW BEGIN + IF OLD.album_id != NEW.album_id THEN + UPDATE `photoapp_albums` SET photos_count = photos_count - 1 WHERE id = OLD.album_id; + UPDATE `photoapp_albums` SET photos_count = photos_count + 1 WHERE id = NEW.album_id; + END IF; + + END; + "); + + } Modified: timesheet/eerunov.txt =================================================================== --- timesheet/eerunov.txt 2008-05-21 17:24:33 UTC (rev 215) +++ timesheet/eerunov.txt 2008-05-21 18:34:38 UTC (rev 216) @@ -13,4 +13,5 @@ 2008-05-13,07:00,09:10,photoapp,RT:2,"photo list + delete" 2008-05-14,09:00,11:00.photoapp,RT:2,"change img storage + design edit photo v1" 2008-05-15,10:00,11:00,photoapp,RT:2,"edit photo" -2008-05-20,18:00,19:00,photoaoo,RT:2,"edit photo - save cover to album,trouble in destroyPhoto when it is cover" +2008-05-20,18:00,19:00,photoapp,RT:2,"edit photo - save cover to album,trouble in destroyPhoto when it is cover" +2008-05-21,18:30,21:20,photoapp,RT:2,"cover + triggers for photos_count in album" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-21 17:41:39
|
Revision: 215 http://isocial.svn.sourceforge.net/isocial/?rev=215&view=rev Author: fsnobody Date: 2008-05-21 10:24:33 -0700 (Wed, 21 May 2008) Log Message: ----------- add, delete photo -> album photos_count set from triggers Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/installers/photoapp/album_installer.php app/installers/user_installer.php app/models/photoapp_photo.php Removed Paths: ------------- app/installers/photoapp/photo_installer.php Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-21 09:03:08 UTC (rev 214) +++ app/controllers/photoapp/album_controller.php 2008-05-21 17:24:33 UTC (rev 215) @@ -58,12 +58,12 @@ //$this->debug($this->params); $photo = $this->PhotoappPhoto->findFirst(array('id' => $this->params['id'])); if ($photo) { - $album = $this->PhotoappAlbum->findFirst(array('id' => $photo->album_id)); - if ($album && $album->owner == $this->current_user->getId()) { - if ($photo->destroyAll("id = " . $photo->id)) { - $album->photos_count = $album->photos_count - 1; - $album->save(); - $this->redirectTo(array('action' => 'view', 'id' => $album->id)); + $photo->album->load(); + if ($photo->album->getId() && $photo->album->owner == $this->current_user->getId()) { + if ($photo->destroy()) { + //$photo->album->photos_count = $photo->album->photos_count - 1; + //$photo->album->save(); + $this->redirectTo(array('action' => 'view', 'id' => $photo->album->id)); } else { $this->importErrors( $this->PhotoappPhoto->getErrors() ); } @@ -177,16 +177,17 @@ $copy_from = $_FILES['album']['tmp_name'][$field]; if (move_uploaded_file($copy_from, $copy_to)) { $album = $this->PhotoappAlbum->find($this->params['id']); - $photo = new PhotoappPhoto (); $photo->img = $this->current_user->getId() . "@" . $photo_name; $photo->album_id = $album->getId(); + $photo->save(); + + $album = $this->PhotoappAlbum->find($this->params['id']); if( empty($album->img)) { $photo->is_cover = 1; $album->img = $photo->img; } - $photo->save(); - $album->photos_count += 1; + //$album->photos_count += 1; $album->save(); } } Modified: app/installers/photoapp/album_installer.php =================================================================== --- app/installers/photoapp/album_installer.php 2008-05-21 09:03:08 UTC (rev 214) +++ app/installers/photoapp/album_installer.php 2008-05-21 17:24:33 UTC (rev 215) @@ -19,10 +19,41 @@ ) ENGINE=InnoDB"); + $this->execute( + "CREATE TABLE `photoapp_photos` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `album_id` int(11) NOT NULL , + `is_cover` int(1) UNSIGNED NOT NULL DEFAULT '0', + `name` char(100) NOT NULL DEFAULT '', + `caption` char(255) NOT NULL DEFAULT '', + `created_at` datetime NOT NULL , + `img` char(255) NOT NULL DEFAULT '' + + ) ENGINE=InnoDB"); + + + $this->execute( + "CREATE TRIGGER papp_photo_insert AFTER INSERT ON photoapp_photos + FOR EACH ROW BEGIN + UPDATE `photoapp_albums` SET photos_count = photos_count + 1 WHERE id = NEW.album_id; + END; + "); + + $this->execute( + "CREATE TRIGGER papp_photo_delete AFTER DELETE ON photoapp_photos + FOR EACH ROW BEGIN + UPDATE `photoapp_albums` SET photos_count = photos_count - 1 WHERE id = OLD.album_id; + END; + "); + + } + + function down_1() { + $this->dropTable('photoapp_photos'); $this->dropTable('photoapp_albums'); } } Deleted: app/installers/photoapp/photo_installer.php =================================================================== --- app/installers/photoapp/photo_installer.php 2008-05-21 09:03:08 UTC (rev 214) +++ app/installers/photoapp/photo_installer.php 2008-05-21 17:24:33 UTC (rev 215) @@ -1,29 +0,0 @@ -<?php -class PhotoInstaller extends AkInstaller -{ - var $module = 'photoapp'; - - function up_1() - { - - $this->execute( - "CREATE TABLE `photoapp_photos` ( - `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `album_id` int(11) NOT NULL , - `is_cover` int(1) UNSIGNED NOT NULL DEFAULT '0', - `name` char(100) NOT NULL DEFAULT '', - `caption` char(255) NOT NULL DEFAULT '', - `created_at` datetime NOT NULL , - `img` char(255) NOT NULL DEFAULT '' - - ) ENGINE=InnoDB"); - - } - - function down_1() - { - $this->dropTable('photoapp_photos'); - } -} - -?> \ No newline at end of file Modified: app/installers/user_installer.php =================================================================== --- app/installers/user_installer.php 2008-05-21 09:03:08 UTC (rev 214) +++ app/installers/user_installer.php 2008-05-21 17:24:33 UTC (rev 215) @@ -23,7 +23,7 @@ `created_at` datetime NOT NULL, FOREIGN KEY (user_id) REFERENCES users(id), INDEX user_idx (user_id) - ) ENGINE=innoDB"); + ) ENGINE=InnoDB"); $this->execute( "CREATE TABLE `friends` ( Modified: app/models/photoapp_photo.php =================================================================== --- app/models/photoapp_photo.php 2008-05-21 09:03:08 UTC (rev 214) +++ app/models/photoapp_photo.php 2008-05-21 17:24:33 UTC (rev 215) @@ -4,12 +4,18 @@ { var $belongs_to = array('album' => array('class_name' => 'PhotoappAlbum', 'primary_key_name' => 'album_id') ); + /*function __constructor() { + echo 1; + die(); + $album = new PhotoappAlbum(); + return parent::__constructor(); + }*/ + function beforeDestroy() { if ($this->is_cover) { $this->album->load(); - - $this->album->img = "xxx"; + $this->album->img = ""; $this->album->save(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-05-21 09:03:03
|
Revision: 214 http://isocial.svn.sourceforge.net/isocial/?rev=214&view=rev Author: aguidrevitch Date: 2008-05-21 02:03:08 -0700 (Wed, 21 May 2008) Log Message: ----------- some extra akelos fixes Modified Paths: -------------- akelos.diff Modified: akelos.diff =================================================================== --- akelos.diff 2008-05-20 17:38:44 UTC (rev 213) +++ akelos.diff 2008-05-21 09:03:08 UTC (rev 214) @@ -1,6 +1,6 @@ Index: lib/Ak.php =================================================================== ---- lib/Ak.php (revision 578) +--- lib/Ak.php (revision 581) +++ lib/Ak.php (working copy) @@ -183,6 +183,11 @@ return @$string[$try_whith_lang]; @@ -25,9 +25,9 @@ } Index: lib/AkActionController.php =================================================================== ---- lib/AkActionController.php (revision 578) +--- lib/AkActionController.php (revision 581) +++ lib/AkActionController.php (working copy) -@@ -749,7 +749,14 @@ +@@ -750,7 +750,14 @@ */ function t($string, $array = null) { @@ -43,7 +43,7 @@ } -@@ -1949,6 +1956,9 @@ +@@ -1950,6 +1957,9 @@ { if(method_exists(&$this, $action)){ call_user_func_array(array(&$this, $action), @(array)$this->passed_args); @@ -53,9 +53,32 @@ } } +Index: lib/AkInstaller.php +=================================================================== +--- lib/AkInstaller.php (revision 581) ++++ lib/AkInstaller.php (working copy) +@@ -356,11 +356,13 @@ + + function dropTable($table_name, $options = array()) + { +- $result = $this->tableExists($table_name) ? $this->db->execute('DROP TABLE '.$table_name) : true; +- if($result){ +- unset($this->available_tables[array_search($table_name, $this->available_tables)]); +- if(!empty($options['sequence'])){ +- $this->dropSequence($table_name); ++ if($this->tableExists($table_name)){ ++ $result = $this->db->execute('DROP TABLE '.$table_name); ++ if ($result) { ++ unset($this->available_tables[array_search($table_name, $this->available_tables)]); ++ if(!empty($options['sequence'])){ ++ $this->dropSequence($table_name); ++ } + } + } + } Index: lib/AkActionView/helpers/text_helper.php =================================================================== ---- lib/AkActionView/helpers/text_helper.php (revision 578) +--- lib/AkActionView/helpers/text_helper.php (revision 581) +++ lib/AkActionView/helpers/text_helper.php (working copy) @@ -518,8 +518,18 @@ */ @@ -80,7 +103,7 @@ /** Index: lib/AkActiveRecord.php =================================================================== ---- lib/AkActiveRecord.php (revision 578) +--- lib/AkActiveRecord.php (revision 581) +++ lib/AkActiveRecord.php (working copy) @@ -5012,6 +5012,7 @@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-20 17:38:42
|
Revision: 213 http://isocial.svn.sourceforge.net/isocial/?rev=213&view=rev Author: fsnobody Date: 2008-05-20 10:38:44 -0700 (Tue, 20 May 2008) Log Message: ----------- cover manage Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/models/photoapp_photo.php app/views/photoapp/album/index.tpl timesheet/eerunov.txt Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-18 18:09:46 UTC (rev 212) +++ app/controllers/photoapp/album_controller.php 2008-05-20 17:38:44 UTC (rev 213) @@ -29,6 +29,10 @@ if ($album->owner == $this->current_user->getId()) { $photo->setAttributes($this->params['photo']); if ($this->Request->isPost() && $photo->save()){ + if ($photo->is_cover == 1) { + $album->img = $photo->img; + $album->save(); + } // set cover if needed $this->redirectTo(array('action' => 'view', 'id' => $album->id)); } } @@ -137,10 +141,17 @@ if (!empty($this->params['album']) ){ // delete $album = $this->PhotoappAlbum->find($this->params['id']); - if ($album->get('owner') == $this->current_user->getId() && $this->Request->isPost()) { - if( $this->PhotoappPhoto->destroyAll("album_id = " . $this->params['id']) && $this->PhotoappAlbum->destroyAll("id = " . $this->params['id'])) { + if ($album && $album->get('owner') == $this->current_user->getId() && $this->Request->isPost()) { + + $photos = $this->PhotoappPhoto->find('all', array('conditions' => array('album_id = ' . $this->params['id']))); + if ($photos) { + $this->PhotoappPhoto->destroyAll("album_id = " . $this->params['id']); // delete photos in album + } + if( $this->PhotoappAlbum->destroyAll("id = " . $this->params['id'])) { $this->redirectTo(array('action' => 'index')); return; + } else { + $this->importErrors( $this->PhotoappAlbum->getErrors() ); } } } else if (!empty($this->params['id']) && $this->PhotoappAlbum->find($this->params['id'])) { Modified: app/models/photoapp_photo.php =================================================================== --- app/models/photoapp_photo.php 2008-05-18 18:09:46 UTC (rev 212) +++ app/models/photoapp_photo.php 2008-05-20 17:38:44 UTC (rev 213) @@ -5,7 +5,14 @@ var $belongs_to = array('album' => array('class_name' => 'PhotoappAlbum', 'primary_key_name' => 'album_id') ); function beforeDestroy() { - + + if ($this->is_cover) { + $this->album->load(); + + $this->album->img = "xxx"; + $this->album->save(); + } + $path = str_replace("@" , "/", $this->img); $file = AK_PUBLIC_DIR . "/images/uploaded/" . $path; `rm -f $file`; @@ -14,4 +21,4 @@ } -?> +?> \ No newline at end of file Modified: app/views/photoapp/album/index.tpl =================================================================== --- app/views/photoapp/album/index.tpl 2008-05-18 18:09:46 UTC (rev 212) +++ app/views/photoapp/album/index.tpl 2008-05-20 17:38:44 UTC (rev 213) @@ -26,7 +26,7 @@ <div class="container"> {loop my_albums} <div class="album"> - <div class="img"><? if ($my_album->get('img')) {?><img src="/preview/index/100x100/<?= $my_album->get('img')?>" /><? + <div class="img"><? if ($my_album->get('img') != '' || $my_album->get('img')) {?><img src="/preview/index/100x100/<?= $my_album->get('img')?>" /><? } else {?>No Cover choosed<? } ?></div> Modified: timesheet/eerunov.txt =================================================================== --- timesheet/eerunov.txt 2008-05-18 18:09:46 UTC (rev 212) +++ timesheet/eerunov.txt 2008-05-20 17:38:44 UTC (rev 213) @@ -13,3 +13,4 @@ 2008-05-13,07:00,09:10,photoapp,RT:2,"photo list + delete" 2008-05-14,09:00,11:00.photoapp,RT:2,"change img storage + design edit photo v1" 2008-05-15,10:00,11:00,photoapp,RT:2,"edit photo" +2008-05-20,18:00,19:00,photoaoo,RT:2,"edit photo - save cover to album,trouble in destroyPhoto when it is cover" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-05-18 18:09:47
|
Revision: 212 http://isocial.svn.sourceforge.net/isocial/?rev=212&view=rev Author: aguidrevitch Date: 2008-05-18 11:09:46 -0700 (Sun, 18 May 2008) Log Message: ----------- Contact, Relationships and Personal tabs in profile implemented Modified Paths: -------------- app/controllers/profile_controller.php app/installers/russian_installer.php app/installers/user_installer.php app/locales/layout/ru.php app/locales/profile/ru.php app/models/basic_profile.php app/models/user.php app/views/groupapp/group/_customize.tpl app/views/profile/contact.tpl app/views/profile/personal.tpl app/views/profile/relationships.tpl public/stylesheets/common/Form.css timesheet/aguidrevitch.txt Added Paths: ----------- app/models/im_profile.php app/models/marital_status.php app/models/personal_profile.php app/models/relationship_profile.php public/images/delete.png Removed Paths: ------------- app/locales/dialog/ Modified: app/controllers/profile_controller.php =================================================================== --- app/controllers/profile_controller.php 2008-05-17 08:40:36 UTC (rev 211) +++ app/controllers/profile_controller.php 2008-05-18 18:09:46 UTC (rev 212) @@ -2,7 +2,7 @@ class ProfileController extends ApplicationController { - var $models = array('User', 'BasicProfile', 'Sex', 'Country', 'Region', 'City', 'PoliticalView', 'ReligiousView'); + var $models = array('User', 'Sex', 'Country', 'Region', 'City', 'PoliticalView', 'ReligiousView', 'MaritalStatus'); function index () { $this->redirectTo(array('action' => 'show')); @@ -90,9 +90,23 @@ } function relationships () { + $this->relationship_profile = $this->current_user->relationship_profile->load(); + if ($this->Request->isPost() && !empty($this->params['relationship_profile'])) { + $this->relationship_profile->setAttributes($this->params['relationship_profile']); + if ($this->relationship_profile->save()) { + $this->redirectTo(array('action' => 'relationships')); + } + } } function personal () { + $this->personal_profile = $this->current_user->personal_profile->load(); + if ($this->Request->isPost() && !empty($this->params['personal_profile'])) { + $this->personal_profile->setAttributes($this->params['personal_profile']); + if ($this->personal_profile->save()) { + $this->redirectTo(array('action' => 'personal')); + } + } } function groups () { Modified: app/installers/russian_installer.php =================================================================== --- app/installers/russian_installer.php 2008-05-17 08:40:36 UTC (rev 211) +++ app/installers/russian_installer.php 2008-05-18 18:09:46 UTC (rev 212) @@ -18,6 +18,14 @@ $this->execute("UPDATE political_views set {$locale}_name ='Безразличные' WHERE id = 6"); $this->execute("UPDATE political_views set {$locale}_name ='Философские' WHERE id = 7"); + $this->execute("ALTER TABLE marital_statuses ADD COLUMN {$locale}_name char(30) NOT NULL AFTER en_name"); + $this->execute("UPDATE marital_statuses set {$locale}_name ='Одинок(-а)' WHERE id = 1"); + $this->execute("UPDATE marital_statuses set {$locale}_name ='Есть друг/подруга' WHERE id = 2"); + $this->execute("UPDATE marital_statuses set {$locale}_name ='Обручен(-a)' WHERE id = 3"); + $this->execute("UPDATE marital_statuses set {$locale}_name ='Женат/Замужем' WHERE id = 4"); + $this->execute("UPDATE marital_statuses set {$locale}_name ='Сложно объяснить' WHERE id = 5"); + $this->execute("UPDATE marital_statuses set {$locale}_name ='В открытых взаимоотношениях' WHERE id = 6"); + } function down_1() Modified: app/installers/user_installer.php =================================================================== --- app/installers/user_installer.php 2008-05-17 08:40:36 UTC (rev 211) +++ app/installers/user_installer.php 2008-05-18 18:09:46 UTC (rev 212) @@ -106,7 +106,7 @@ $this->execute( "CREATE TRIGGER c_delete AFTER DELETE ON city_votes FOR EACH ROW BEGIN - UPDATE `cities` SET votes = votes - 1 WHERE id = NEW.city_id; + UPDATE `cities` SET votes = votes - 1 WHERE id = OLD.city_id; END; "); @@ -219,15 +219,69 @@ FOREIGN KEY (user_id) REFERENCES users(id), INDEX user_idx (user_id) ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `marital_statuses` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `en_name` char(30) + ) ENGINE=InnoDB"); + + $this->execute("INSERT INTO marital_statuses (id, en_name) VALUES (1, 'Single')"); + $this->execute("INSERT INTO marital_statuses (id, en_name) VALUES (2, 'In a relationship')"); + $this->execute("INSERT INTO marital_statuses (id, en_name) VALUES (3, 'Engaged')"); + $this->execute("INSERT INTO marital_statuses (id, en_name) VALUES (4, 'Married')"); + $this->execute("INSERT INTO marital_statuses (id, en_name) VALUES (5, 'It\'s complicated')"); + $this->execute("INSERT INTO marital_statuses (id, en_name) VALUES (6, 'In an open relationship')"); + + $this->execute( + "CREATE TABLE `relationship_profiles` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `marital_status_id` int(11) NOT NULL, + + `interested_in_men` bool, + `interested_in_women` bool, + `looking_for_friendship` bool, + `looking_for_dating` bool, + `looking_for_relationship` bool, + `looking_for_networking` bool, + + `created_at` datetime NOT NULL, + `updated_at` datetime NOT NULL, + FOREIGN KEY (user_id) REFERENCES users(id), + FOREIGN KEY (marital_status_id) REFERENCES marital_statuses(id), + INDEX user_idx (user_id) + ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `personal_profiles` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `activities` text, + `interests` text, + `music` text, + `tv_shows` text, + `movies` text, + `books` text, + `quotes` text, + `about` text, + `created_at` datetime NOT NULL, + `updated_at` datetime NOT NULL, + FOREIGN KEY (user_id) REFERENCES users(id), + INDEX user_idx (user_id) + ) ENGINE=InnoDB"); } function down_1() { + + $this->transactionComplete(); + $this->dropTable('personal_profiles'); + $this->dropTable('marital_statuses'); + $this->dropTable('relationship_profiles'); $this->dropTable('im_profiles'); $this->dropTable('contact_profiles'); $this->dropTable('basic_profiles'); - // triggers should be dropped automatically - // http://dev.mysql.com/doc/refman/5.1/en/drop-trigger.html $this->dropTable('religious_view_votes'); $this->dropTable('religious_views'); $this->dropTable('political_views'); @@ -241,6 +295,20 @@ $this->dropTable('confirmations'); $this->dropTable('users'); } + + function dropTable($table_name, $options = array()) + { + if($this->tableExists($table_name)){ + $result = $this->db->execute('DROP TABLE '.$table_name); + if ($result) { + unset($this->available_tables[array_search($table_name, $this->available_tables)]); + if(!empty($options['sequence'])){ + $this->dropSequence($table_name); + } + } + } + } + } ?> Modified: app/locales/layout/ru.php =================================================================== --- app/locales/layout/ru.php 2008-05-17 08:40:36 UTC (rev 211) +++ app/locales/layout/ru.php 2008-05-18 18:09:46 UTC (rev 212) @@ -30,7 +30,23 @@ $dictionary['GroupApp'] = 'Группы'; $dictionary['EventApp'] = 'События'; +$dictionary['Add another screen name'] = 'Добавить ещё один'; +$dictionary['Add New City'] = 'Добавить новый город'; +$dictionary['Select Country:'] = 'Выберите страну:'; +$dictionary['City Name'] = 'Город'; +$dictionary['Country'] = 'Страна'; +$dictionary['Region'] = 'Область'; +$dictionary['Who can see this?'] = 'Кто может видеть?'; +$dictionary['Everyone'] = 'Все'; +$dictionary['Friends of Friends'] = 'Друзья друзей'; +$dictionary['Only Friends'] = 'Только друзья'; +$dictionary['Only Me'] = 'Никто'; +$dictionary['Email field'] = 'Email адрес'; +$dictionary['Mobile Phone field'] = 'Номер мобильного телефона'; +$dictionary['Land Phone field'] = 'Номер домашнего телефона'; +$dictionary['Address field'] = 'Домашний адрес'; +$dictionary['Website field'] = 'URL веб сайта'; ?> Modified: app/locales/profile/ru.php =================================================================== --- app/locales/profile/ru.php 2008-05-17 08:40:36 UTC (rev 211) +++ app/locales/profile/ru.php 2008-05-18 18:09:46 UTC (rev 212) @@ -26,18 +26,25 @@ $dictionary['Only my friends'] = 'Только для друзей'; $dictionary['Emails'] = 'Адреса Email'; -$dictionary['IM Screen Name(s)'] = 'IM'; +$dictionary['IM Screen Name(s)'] = 'Службы мгновенных сообщений'; $dictionary['Mobile phone'] = 'Мобильный номер'; $dictionary['Land phone'] = 'Домашний номер'; $dictionary['City'] = 'Город'; $dictionary['Address'] = 'Адрес'; $dictionary['Website'] = 'Веб сайт'; -$dictionary['Relationship status'] = 'Семейное положение'; +$dictionary['Relationship Status'] = 'Семейное положение'; $dictionary['Select Status:'] = 'Выберите положение:'; $dictionary['Former Name'] = 'Девичья фамилия'; +$dictionary['<strong>Note</strong>: Please enter a full name. Former Name is only used to help people find you in search and will not show up in your profile.'] = '<strong>Обратите внимание</strong>: Введите это поле если вы меняли фамилию. Девичья фамилия не видна в вашем профайле, однако используется при поиске.'; $dictionary['Interested In'] = 'Ищу'; +$dictionary['Men'] = 'Мужчину'; +$dictionary['Women'] = 'Женщину'; $dictionary['Looking for'] = 'Для'; +$dictionary['Friendship'] = 'Дружбы'; +$dictionary['Dating'] = 'Знакомства'; +$dictionary['A Relationship'] = 'Серьёзных отношений'; +$dictionary['Networking'] = 'Налаживания связей'; $dictionary['Activities'] = 'Род занятий'; $dictionary['Interests'] = 'Интересы'; Modified: app/models/basic_profile.php =================================================================== --- app/models/basic_profile.php 2008-05-17 08:40:36 UTC (rev 211) +++ app/models/basic_profile.php 2008-05-18 18:09:46 UTC (rev 212) @@ -2,7 +2,7 @@ class BasicProfile extends ActiveRecord { - var $belongs_to = array('User', 'City', 'PoliticalView', 'ReligiousView'); + var $belongs_to = array('User', 'City', 'PoliticalView', 'ReligiousView', 'Sex'); } ?> Added: app/models/im_profile.php =================================================================== --- app/models/im_profile.php (rev 0) +++ app/models/im_profile.php 2008-05-18 18:09:46 UTC (rev 212) @@ -0,0 +1,8 @@ +<?php + +class ImProfile extends ActiveRecord +{ + var $belongs_to = array('User'); +} + +?> Added: app/models/marital_status.php =================================================================== --- app/models/marital_status.php (rev 0) +++ app/models/marital_status.php 2008-05-18 18:09:46 UTC (rev 212) @@ -0,0 +1,7 @@ +<?php + +class MaritalStatus extends ActiveRecord +{ +} + +?> Added: app/models/personal_profile.php =================================================================== --- app/models/personal_profile.php (rev 0) +++ app/models/personal_profile.php 2008-05-18 18:09:46 UTC (rev 212) @@ -0,0 +1,8 @@ +<?php + +class PersonalProfile extends ActiveRecord +{ + var $belongs_to = array('User'); +} + +?> Added: app/models/relationship_profile.php =================================================================== --- app/models/relationship_profile.php (rev 0) +++ app/models/relationship_profile.php 2008-05-18 18:09:46 UTC (rev 212) @@ -0,0 +1,8 @@ +<?php + +class RelationshipProfile extends ActiveRecord +{ + var $belongs_to = array('User'); +} + +?> Modified: app/models/user.php =================================================================== --- app/models/user.php 2008-05-17 08:40:36 UTC (rev 211) +++ app/models/user.php 2008-05-18 18:09:46 UTC (rev 212) @@ -14,7 +14,7 @@ 'foreign_key' => 'user_id'), ); - var $has_one = array('BasicProfile', 'ContactProfile'); + var $has_one = array('BasicProfile', 'ContactProfile', 'RelationshipProfile', 'PersonalProfile'); function login($email, $password) { return $this->findFirst(array( 'email' => $email, 'password' => md5($password) )); Modified: app/views/groupapp/group/_customize.tpl =================================================================== --- app/views/groupapp/group/_customize.tpl 2008-05-17 08:40:36 UTC (rev 211) +++ app/views/groupapp/group/_customize.tpl 2008-05-18 18:09:46 UTC (rev 212) @@ -15,7 +15,7 @@ <div class="formrow"> <label>_{Options}:</label> <div class="formcol"> - <label class="checkbox"><?= $form_helper->check_box('group', 'show_related_groups', array('class' => 'checkboxinput')) ?> _{Show related groups}.</label> + <label class="checkbox"><?= $form_helper->check_box('group', 'show_related_groups', array('class' => 'checkboxinput')) ?>_{Show related groups}.</label> </div> <div class="clearfix"></div> </div> @@ -23,7 +23,7 @@ <div class="formrow"> <label> </label> <div class="formcol"> - <label class="checkbox"><?= $form_helper->check_box('group', 'show_discussion_board', array('class' => 'checkboxinput')) ?> _{Enable discussion board}.</label> + <label class="checkbox"><?= $form_helper->check_box('group', 'show_discussion_board', array('class' => 'checkboxinput')) ?>_{Enable discussion board}.</label> </div> <div class="clearfix"></div> </div> @@ -31,7 +31,7 @@ <div class="formrow"> <label> </label> <div class="formcol"> - <label class="checkbox"><?= $form_helper->check_box('group', 'show_wall', array('class' => 'checkboxinput')) ?> _{Enable the Wall}.</label> + <label class="checkbox"><?= $form_helper->check_box('group', 'show_wall', array('class' => 'checkboxinput')) ?>_{Enable the Wall}.</label> </div> <div class="clearfix"></div> </div> @@ -39,7 +39,7 @@ <div class="formrow"> <label> </label> <div class="formcol"> - <label class="checkbox"><?= $form_helper->check_box('group', 'show_photos', array('class' => 'checkboxinput')) ?> _{Enable photos}.</label> + <label class="checkbox"><?= $form_helper->check_box('group', 'show_photos', array('class' => 'checkboxinput')) ?>_{Enable photos}.</label> </div> <div class="clearfix"></div> </div> @@ -47,8 +47,8 @@ <label> </label> <div class="formcol"> <div class="formblock border"> - <label class="radiobutton"><?= $form_helper->radio_button('group', 'photo_member', '0', array('checked' => 'checked')) ?> _{Allow all members to upload photos}.</label> - <label class="radiobutton"><?= $form_helper->radio_button('group', 'photo_member', '1') ?> _{Only allow admins to upload photos}.</label> + <label class="radiobutton"><?= $form_helper->radio_button('group', 'photo_member', '0', array('checked' => 'checked', 'class' => 'radioinput')) ?>_{Allow all members to upload photos}.</label> + <label class="radiobutton"><?= $form_helper->radio_button('group', 'photo_member', '1', array('class' => 'radioinput')) ?>_{Only allow admins to upload photos}.</label> <div class="clearfix"></div> </div> </div> @@ -58,7 +58,7 @@ <div class="formrow"> <label> </label> <div class="formcol"> - <label class="checkbox"><?= $form_helper->check_box('group', 'show_videos', array('class' => 'checkboxinput')) ?> _{Enable videos}.</label> + <label class="checkbox"><?= $form_helper->check_box('group', 'show_videos', array('class' => 'checkboxinput')) ?>_{Enable videos}.</label> </div> <div class="clearfix"></div> </div> @@ -66,8 +66,8 @@ <label> </label> <div class="formcol"> <div class="formblock border"> - <label class="radiobutton"><?= $form_helper->radio_button('group', 'video_member', '0', array('checked' => 'checked')) ?> _{Allow all members to upload videos}.</label> - <label class="radiobutton"><?= $form_helper->radio_button('group', 'video_member', '1') ?> _{Only allow admins to upload videos}.</label> + <label class="radiobutton"><?= $form_helper->radio_button('group', 'video_member', '0', array('checked' => 'checked', 'class' => 'radioinput')) ?>_{Allow all members to upload videos}.</label> + <label class="radiobutton"><?= $form_helper->radio_button('group', 'video_member', '1', array('class' => 'radioinput')) ?>_{Only allow admins to upload videos}.</label> <div class="clearfix"></div> </div> </div> @@ -77,7 +77,7 @@ <div class="formrow"> <label>_{Access}:</label> <div class="formcol"> - <label class="radiobutton"><?= $form_helper->radio_button('group', 'access', '0', array('checked' => 'checked')) ?> _{This group is open}.</label> + <label class="radiobutton"><?= $form_helper->radio_button('group', 'access', '0', array('checked' => 'checked', 'class' => 'radioinput')) ?>_{This group is open}.</label> </div> <div class="clearfix"></div> </div> @@ -94,7 +94,7 @@ <div class="formrow"> <label> </label> <div class="formcol"> - <label class="radiobutton"><?= $form_helper->radio_button('group', 'access', '1') ?> _{This group is closed}.</label> + <label class="radiobutton"><?= $form_helper->radio_button('group', 'access', '1', array('class' => 'radioinput')) ?>_{This group is closed}.</label> </div> <div class="clearfix"></div> </div> @@ -111,7 +111,7 @@ <div class="formrow"> <label> </label> <div class="formcol"> - <label class="radiobutton"><?= $form_helper->radio_button('group', 'access', '2') ?> _{This group is secret}.</label> + <label class="radiobutton"><?= $form_helper->radio_button('group', 'access', '2', array('class' => 'radioinput')) ?>_{This group is secret}.</label> </div> <div class="clearfix"></div> </div> @@ -128,7 +128,7 @@ <div class="formrow"> <label>_{Publicize}:</label> <div class="formcol"> - <label class="checkbox"><?= $form_helper->check_box('group', 'show_in_search', array('class' => 'checkboxinput', 'checked' => 'checked')) ?> _{Show this group in search results}.</label> + <label class="checkbox"><?= $form_helper->check_box('group', 'show_in_search', array('class' => 'checkboxinput', 'checked' => 'checked')) ?>_{Show this group in search results}.</label> </div> <div class="clearfix"></div> </div> Modified: app/views/profile/contact.tpl =================================================================== --- app/views/profile/contact.tpl 2008-05-17 08:40:36 UTC (rev 211) +++ app/views/profile/contact.tpl 2008-05-18 18:09:46 UTC (rev 212) @@ -89,7 +89,7 @@ <label></label> <div class="formcol"> <div class="middle"> - <a href="#" onclick='add_im()'>Add another screen name</a> + <a href="#" onclick='add_im()'>_{Add another screen name}</a> </div> </div> </div> Modified: app/views/profile/personal.tpl =================================================================== --- app/views/profile/personal.tpl 2008-05-17 08:40:36 UTC (rev 211) +++ app/views/profile/personal.tpl 2008-05-18 18:09:46 UTC (rev 212) @@ -6,42 +6,42 @@ <div class="editform"> <div class="formrow"> <label>_{Activities}:</label> - <?= $form_helper->text_area('personal', 'activities')?> + <?= $form_helper->text_area('personal_profile', 'activities')?> </div> <div class="formrow"> <label>_{Interests}:</label> - <?= $form_helper->text_area('personal', 'interests')?> + <?= $form_helper->text_area('personal_profile', 'interests')?> </div> <div class="formrow"> <label>_{Favorite Music}:</label> - <?= $form_helper->text_area('personal', 'music')?> + <?= $form_helper->text_area('personal_profile', 'music')?> </div> <div class="formrow"> <label>_{Favorite TV Shows}:</label> - <?= $form_helper->text_area('personal', 'tv_shows')?> + <?= $form_helper->text_area('personal_profile', 'tv_shows')?> </div> <div class="formrow"> <label>_{Favorite Movies}:</label> - <?= $form_helper->text_area('personal', 'movies')?> + <?= $form_helper->text_area('personal_profile', 'movies')?> </div> <div class="formrow"> <label>_{Favorite Books}:</label> - <?= $form_helper->text_area('personal', 'books')?> + <?= $form_helper->text_area('personal_profile', 'books')?> </div> <div class="formrow"> <label>_{Favorite Quotes}:</label> - <?= $form_helper->text_area('personal', 'quotes')?> + <?= $form_helper->text_area('personal_profile', 'quotes')?> </div> <div class="formrow"> <label>_{About me}:</label> - <?= $form_helper->text_area('personal', 'about')?> + <?= $form_helper->text_area('personal_profile', 'about')?> </div> <div class="formrow"> Modified: app/views/profile/relationships.tpl =================================================================== --- app/views/profile/relationships.tpl 2008-05-17 08:40:36 UTC (rev 211) +++ app/views/profile/relationships.tpl 2008-05-18 18:09:46 UTC (rev 212) @@ -7,16 +7,22 @@ <div class="formrow"> <label>_{Relationship Status}:</label> <div class="formcol"> - <?= $form_options_helper->select('relationship', 'status', array('Single', 'In a relationship', 'Engaged', 'Married', 'It\'s complicated', 'In an open relationship'), array(), array('prompt' => $controller->t('Select Status:')) )?> + <?= $form_options_helper->select('relationship_profile', 'marital_status_id', $MaritalStatus->collect($MaritalStatus->find(), 'name', 'id'), array(), array('prompt' => $controller->t('Select Status:')) )?> </div> </div> + <? + $current_user->basic_profile->load(); + $current_user->basic_profile->sex->load(); + if ($current_user->basic_profile->sex->getId() == 2) { + ?> <div class="formrow"> <label>_{Former Name}:</label> <div class="formcol"> - <?= $form_helper->text_field('relationship', 'former_name', array('class' => 'textinput') )?> + <?= $form_helper->text_field('relationship_profile', 'former_name', array('class' => 'textinput') )?> </div> </div> + <div class="formrow"> <label></label> <div class="formcol"> @@ -25,28 +31,54 @@ </div> </div> </div> + <? + } + ?> <div class="formrow"> <label>_{Interested In}:</label> <div class="formcol"> - <label class="checkbox"><?= $form_helper->check_box('relationship', 'interested_in_men', array('class' => 'checkboxinput')) ?> Men</label> - <label class="checkbox"><?= $form_helper->check_box('relationship', 'interested_in_women', array('class' => 'checkboxinput')) ?> Women</label> + <label class="checkbox"><?= $form_helper->check_box('relationship_profile', 'interested_in_men', array('class' => 'checkboxinput')) ?>_{Men}</label> </div> </div> <div class="formrow"> + <label></label> + <div class="formcol"> + <label class="checkbox"><?= $form_helper->check_box('relationship_profile', 'interested_in_women', array('class' => 'checkboxinput')) ?>_{Women}</label> + </div> + </div> + + <div class="formrow"> <label>_{Looking for}:</label> <div class="formcol"> - <label class="checkbox"><?= $form_helper->check_box('relationship', 'looking_for_friendship', array('class' => 'checkboxinput')) ?> Friendship</label> - <label class="checkbox"><?= $form_helper->check_box('relationship', 'looking_for_dating', array('class' => 'checkboxinput')) ?> Dating</label> - <label class="checkbox"><?= $form_helper->check_box('relationship', 'looking_for_relationship', array('class' => 'checkboxinput')) ?> A Relationship</label> - <label class="checkbox"><?= $form_helper->check_box('relationship', 'looking_for_networking', array('class' => 'checkboxinput')) ?> Networking</label> + <label class="checkbox"><?= $form_helper->check_box('relationship_profile', 'looking_for_friendship', array('class' => 'checkboxinput')) ?>_{Friendship}</label> </div> </div> + <div class="formrow"> + <label></label> + <div class="formcol"> + <label class="checkbox"><?= $form_helper->check_box('relationship_profile', 'looking_for_dating', array('class' => 'checkboxinput')) ?>_{Dating}</label> + </div> + </div> <div class="formrow"> <label></label> + <div class="formcol"> + <label class="checkbox"><?= $form_helper->check_box('relationship_profile', 'looking_for_relationship', array('class' => 'checkboxinput')) ?>_{A Relationship}</label> + </div> + </div> + + <div class="formrow"> + <label></label> + <div class="formcol"> + <label class="checkbox"><?= $form_helper->check_box('relationship_profile', 'looking_for_networking', array('class' => 'checkboxinput')) ?>_{Networking}</label> + </div> + </div> + + <div class="formrow"> + <label></label> <input class="submitinput" type="submit" value="_{Save Changes}"> <input class="cancelinput" type="button" value="_{Cancel}"> </div> Added: public/images/delete.png =================================================================== (Binary files differ) Property changes on: public/images/delete.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: public/stylesheets/common/Form.css =================================================================== --- public/stylesheets/common/Form.css 2008-05-17 08:40:36 UTC (rev 211) +++ public/stylesheets/common/Form.css 2008-05-18 18:09:46 UTC (rev 212) @@ -45,6 +45,7 @@ width: 400px; } + .formrow label.radiobutton { font-weight: normal; color: #000000; @@ -53,6 +54,10 @@ width: 400px; } +.formrow label.checkbox .checkboxinput, .formrow label.radiobutton .radioinput { + margin-right: 6px; +} + .formrow label.required { line-height: 10px; } Modified: timesheet/aguidrevitch.txt =================================================================== --- timesheet/aguidrevitch.txt 2008-05-17 08:40:36 UTC (rev 211) +++ timesheet/aguidrevitch.txt 2008-05-18 18:09:46 UTC (rev 212) @@ -10,3 +10,4 @@ 2008-05-13,20:40,21:20,main,RT:1,"fixing IE6 compatibility issues for dialog, minor fixes to city dialog" 2008-05-14,19:10,22:00,main,RT:1,"instant messagers profile" 2008-05-15,20:40,22:10,main,RT:1,"instant messagers profile implemented" +2008-05-18,18:00,21:10,main,RT:1,"relationships and personal tabs implemented" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-05-17 08:40:29
|
Revision: 211 http://isocial.svn.sourceforge.net/isocial/?rev=211&view=rev Author: dim0s77 Date: 2008-05-17 01:40:36 -0700 (Sat, 17 May 2008) Log Message: ----------- discussion board: 'reply to post' implementation ended Modified Paths: -------------- app/controllers/groupapp/board_controller.php app/views/groupapp/board/_head.tpl app/views/groupapp/board/reply_to_post.tpl app/views/groupapp/board/reply_to_topic.tpl app/views/groupapp/board/show_topic.tpl app/views/groupapp/board/start_topic.tpl public/stylesheets/groupapp/Board.css timesheet/dim0s77.txt Modified: app/controllers/groupapp/board_controller.php =================================================================== --- app/controllers/groupapp/board_controller.php 2008-05-16 06:28:55 UTC (rev 210) +++ app/controllers/groupapp/board_controller.php 2008-05-17 08:40:36 UTC (rev 211) @@ -33,7 +33,8 @@ $topics[$message->topic_id]['last'] = $message; } } - $this->group = $group; + $this->group_id = $group->getId(); + $this->group_name = $group->name; $this->topics = $topics; } } @@ -53,7 +54,9 @@ $group = $this->GroupappGroup->find( $messages[0]->group_id ); if (($group && $group->access == 1) || $member) { $this->messages = $messages; - $this->group = $group; + $this->group_id = $group->getId(); + $this->group_name = $group->name; + $this->topic_id = $messages[0]->topic_id; } else { $this->addError('_common', 'Access denied', 'Group id closed. You can\'t to see this topic'); } @@ -90,8 +93,11 @@ } $this->addError('_common', 'Sending message error', 'please, try again'); } else if (!empty($this->params['id'])) { - if ( $this->group = $this->GroupappGroup->find( $this->params['id'] ) ) { - $this->topic = $this->group->message->build(); + if ( $group = $this->GroupappGroup->find( $this->params['id'] ) ) { + $this->topic = $group->message->build(); + $this->group_id = $group->getId(); + $this->group_name = $group->name; + $this->topic_id = $this->topic->getId(); } } else { $this->addError('_common', 'Start topic error', 'please, specify group'); @@ -130,7 +136,9 @@ $group = $this->GroupappGroup->find( $messages[0]->group_id ); if (($group && $group->access == 1) || $member) { $this->messages = $messages; - $this->group = $group; + $this->group_id = $group->getId(); + $this->group_name = $group->name; + $this->topic_id = $messages[0]->topic_id; } else { $this->addError('_common', 'Access denied', 'Group id closed. You can\'t reply to this topic'); } @@ -141,13 +149,22 @@ } function reply_to_post () { - if (!empty($this->params['id'])) { - $messages = $this->GroupappMessage->find('all', - array( - 'conditions' => array("group_id = ?", $this->params['id']), - 'include' => 'user' - ) - ); + if (!empty($this->params['topic'])) { + if ( $this->group = $this->GroupappGroup->find( $this->params['topic']['group_id'] ) ) { + $member = $this->GroupappMember->findFirst(array( 'group_id' => $this->group->getId(), + 'user_id' => $this->current_user->getId() + )); + if ($member) { + $message = $member->message->build(); + $message->setAttributes($this->params['topic']); + if ($message->save()) { + $this->redirectTo(array('action' => 'show_topic', 'id' => $message->topic_id)); + return; + } + } + } + $this->addError('_common', 'Sending message error', 'please, try again'); + } else if (!empty($this->params['id'])) { $message = $this->GroupappMessage->findFirst( array( 'conditions' => array("id = ?", $this->params['id']), Modified: app/views/groupapp/board/_head.tpl =================================================================== --- app/views/groupapp/board/_head.tpl 2008-05-16 06:28:55 UTC (rev 210) +++ app/views/groupapp/board/_head.tpl 2008-05-17 08:40:36 UTC (rev 211) @@ -4,10 +4,10 @@ </div> <div class="info"> <div class="header"> - <div class="name groupapp">{group.name?}: _{Discussions}</div> + <div class="name groupapp">{group_name?}: _{Discussions}</div> </div> <div class="clearfix"></div> - <div class="subheader"><a href="/groupapp/group/show_group/{group.id?}">_{Back to group} {group.name?}</a></div> + <div class="subheader"><a href="/groupapp/group/show_group/{group.id?}">_{Back to group} {group_name?}</a></div> </div> </div> <div class="clearfix"></div> Modified: app/views/groupapp/board/reply_to_post.tpl =================================================================== --- app/views/groupapp/board/reply_to_post.tpl 2008-05-16 06:28:55 UTC (rev 210) +++ app/views/groupapp/board/reply_to_post.tpl 2008-05-17 08:40:36 UTC (rev 211) @@ -1,23 +1,63 @@ <?= $controller->renderPartial("head") ?> +{?message_to_reply} + <?= $controller->renderErrors() ?> -<form action="/groupapp/board/reply_to_post" method="post"> +<div class="submenu"> + <div class="menu_block"> + <div class="header">_{Topic}: <a href="/groupapp/board/show_topic/{message_to_reply.topic_id}">{message_to_reply.subject?}</a></div> + </div> +</div> +<div class="clearfix"></div> + +<div class="messages_list"> + <div class="row first"> + <div class="actions"> + </div> + + <div class="avatar"> + <a href="/profile/show/{message_to_reply.user_id?}"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a> + </div> + + <div class="message"> + <div class="head"> + <span class="sender"> + <? if ($current_user->getId() == $message_to_reply->user_id) { ?><span class="current_user">_{You}</span> + <? } else { ?><a href="/profile/show/{message_to_reply.user_id?}"><span class="other_user">{message_to_reply.user.name?}</span></a><? } ?> + </span> + _{wrote} + <div class="subtext">{message_to_reply.created_at?}</div> + </div> + <div class="body">{message_to_reply.body?}</div> + </div> + <div class="clearfix"></div> + + </div> +</div> +<div class="clearfix"></div> + +<div class="board_from_background"> +<form action="/groupapp/board/reply_to_topic/{message_to_reply.topic_id?}" method="post"> <div class="editform"> <div class="formrow"> - <label>_{Topic}:</label> - <?= $form_helper->text_field('topic', 'subject', array('class' => 'textinput'))?> - </div> - <div class="formrow"> - <label>_{Post}:</label> + <label> </label><span class="label">_{Your reply}</span><br> <?= $form_helper->text_area('topic', 'body', array('class' => 'textinput'))?> </div> <div class="formrow"> <label> <?= $form_helper->hidden_field('topic', 'group_id', array('value' => $message_to_reply->group_id))?> + <?= $form_helper->hidden_field('topic', 'topic_id', array('value' => $message_to_reply->topic_id))?> + <?= $form_helper->hidden_field('topic', 'subject', array('value' => $message_to_reply->subject))?> + <?= $form_helper->hidden_field('topic', 'reply_message_id', array('value' => $message_to_reply->getId()))?> </label> - <input class="submitinput" type="submit" value="_{Post}"> + <input class="submitinput" type="submit" value="_{Post reply}"> <input class="cancelinput" type="button" value="_{Cancel}"> </div> </div> </form> +</div> +<div class="clearfix"></div> +{else} +<?= $controller->renderErrors() ?> +{end} Modified: app/views/groupapp/board/reply_to_topic.tpl =================================================================== --- app/views/groupapp/board/reply_to_topic.tpl 2008-05-16 06:28:55 UTC (rev 210) +++ app/views/groupapp/board/reply_to_topic.tpl 2008-05-17 08:40:36 UTC (rev 211) @@ -1,6 +1,9 @@ <?= $controller->renderPartial("head") ?> {?messages} + +<?= $controller->renderErrors() ?> + <div class="submenu"> <div class="menu_block"> <div class="header">_{Topic}: <a href="/groupapp/board/show_topic/{messages-0.topic_id}">{messages-0.subject?}</a></div> @@ -8,8 +11,7 @@ </div> <div class="clearfix"></div> -<?= $controller->renderErrors() ?> - +<div class="board_from_background"> <form action="/groupapp/board/reply_to_topic/{messages-0.topic_id?}" method="post"> <div class="editform"> <div class="formrow"> @@ -27,6 +29,7 @@ </div> </div> </form> +</div> <div class="clearfix"></div> {else} <?= $controller->renderErrors() ?> Modified: app/views/groupapp/board/show_topic.tpl =================================================================== --- app/views/groupapp/board/show_topic.tpl 2008-05-16 06:28:55 UTC (rev 210) +++ app/views/groupapp/board/show_topic.tpl 2008-05-17 08:40:36 UTC (rev 211) @@ -17,7 +17,6 @@ <?= $controller->renderErrors() ?> <div class="messages_list"> - <div class="info"> </div> {loop messages} <div class="row"> Modified: app/views/groupapp/board/start_topic.tpl =================================================================== --- app/views/groupapp/board/start_topic.tpl 2008-05-16 06:28:55 UTC (rev 210) +++ app/views/groupapp/board/start_topic.tpl 2008-05-17 08:40:36 UTC (rev 211) @@ -2,7 +2,8 @@ <?= $controller->renderErrors() ?> -<form action="/groupapp/board/start_topic/{group.id?}" method="post"> +<div class="board_from_background"> +<form action="/groupapp/board/start_topic/{group_id?}" method="post"> <div class="editform"> <div class="formrow"> <label>_{Topic}:</label> @@ -14,10 +15,12 @@ </div> <div class="formrow"> <label> - <?= $form_helper->hidden_field('topic', 'group_id', array('value' => $group->getId()))?> + <?= $form_helper->hidden_field('topic', 'group_id', array('value' => $group_id))?> </label> <input class="submitinput" type="submit" value="_{Create new Topic}"> <input class="cancelinput" type="button" value="_{Cancel}"> </div> </div> </form> +</div> +<div class="clearfix"></div> Modified: public/stylesheets/groupapp/Board.css =================================================================== --- public/stylesheets/groupapp/Board.css 2008-05-16 06:28:55 UTC (rev 210) +++ public/stylesheets/groupapp/Board.css 2008-05-17 08:40:36 UTC (rev 211) @@ -1,3 +1,7 @@ +.board_from_background { + background: #f7f7f7; +} + .nodiscus { font-size: 12px; text-align: center; @@ -9,16 +13,15 @@ } .messages_list { - padding-top: 10px; float: left; background: #ffffff; width: 100%; } .messages_list .info { - padding: 0px 10px 5px 20px; - margin-bottom: 5px; + padding: 5px 10px 5px 20px; text-align: right; + border-bottom: solid 1px #dddddd; } .messages_list .info .left { @@ -27,7 +30,6 @@ } .messages_list .container { - border-top: solid 1px #dddddd; background: #f7f7f7; padding: 10px; } @@ -58,7 +60,7 @@ } .messages_list .row { - border-top: 1px solid #cccccc; + border-bottom: 1px solid #cccccc; display: block; padding: 10px; } @@ -96,14 +98,14 @@ background: #f7f7f7; } +.messages_list .row .message .body { + background: #ffffff; + padding: 10px 3px 10px 3px; +} + .message .head .sender .current_user { } .message .head .sender .other_user { font-weight: bold; } - -.messages_list .row .message .body { - background: #ffffff; - padding: 10px 3px 10px 3px; -} \ No newline at end of file Modified: timesheet/dim0s77.txt =================================================================== --- timesheet/dim0s77.txt 2008-05-16 06:28:55 UTC (rev 210) +++ timesheet/dim0s77.txt 2008-05-17 08:40:36 UTC (rev 211) @@ -23,3 +23,5 @@ 2008-05-15,10:20,12:20,groupapp,RT:3,"discussion board: topics list" 2008-05-15,18:35,21:15,groupapp,RT:3,"discussion board: reply to topic" 2008-05-15,21:15,22:00,groupapp,RT:3,"discussion board: reply to post" + +2008-05-17,10:50,11:40,groupapp,RT:3,"discussion board: reply to post" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-16 06:28:49
|
Revision: 210 http://isocial.svn.sourceforge.net/isocial/?rev=210&view=rev Author: fsnobody Date: 2008-05-15 23:28:55 -0700 (Thu, 15 May 2008) Log Message: ----------- fix getId in templates, delete photo with img Modified Paths: -------------- app/models/photoapp_photo.php app/views/photoapp/album/_edit_menu.tpl app/views/photoapp/album/edit_photo.tpl app/views/photoapp/album/index.tpl app/views/photoapp/album/uploaded.tpl app/views/photoapp/album/view.tpl Modified: app/models/photoapp_photo.php =================================================================== --- app/models/photoapp_photo.php 2008-05-15 19:05:14 UTC (rev 209) +++ app/models/photoapp_photo.php 2008-05-16 06:28:55 UTC (rev 210) @@ -4,6 +4,14 @@ { var $belongs_to = array('album' => array('class_name' => 'PhotoappAlbum', 'primary_key_name' => 'album_id') ); + function beforeDestroy() { + + $path = str_replace("@" , "/", $this->img); + $file = AK_PUBLIC_DIR . "/images/uploaded/" . $path; + `rm -f $file`; + return parent::beforeDestroy(); + } + } ?> Modified: app/views/photoapp/album/_edit_menu.tpl =================================================================== --- app/views/photoapp/album/_edit_menu.tpl 2008-05-15 19:05:14 UTC (rev 209) +++ app/views/photoapp/album/_edit_menu.tpl 2008-05-16 06:28:55 UTC (rev 210) @@ -1,11 +1,11 @@ <div class="tabs"> <div class="left"> <ul class="toggle_tabs"> - <li class="first"><a href="/photoapp/album/add_photo/<?= $album->get('id')?>" class="<?= $controller->getActionName() == 'add_photo' ? 'selected' : '' ?>">_{Add Photos}</a></li><? - ?><li class="first"><a href="/photoapp/album/view/<?= $album->get('id')?>" class="<?= in_array($controller->getActionName(),array( 'edit_photo', 'view')) ? 'selected' : '' ?>">_{View}</a></li><? - ?><li class="first"><a href="/photoapp/album/uploaded/<?= $album->get('id')?>" class="<?= $controller->getActionName() == 'uploaded' ? 'selected' : '' ?>">_{Edit uploaded}</a></li><? - ?><li><a href="/photoapp/album/edit/<?= $album->get('id')?>" class="last <?= $controller->getActionName() == 'edit' ? 'selected' : '' ?>">_{Edit Info}</a></li><? - ?><li><a href="/photoapp/album/delete/<?= $album->get('id')?>" class="last <?= $controller->getActionName() == 'delete' ? 'selected' : '' ?>">_{Delete}</a></li> + <li class="first"><a href="/photoapp/album/add_photo/<?= $album->getId()?>" class="<?= $controller->getActionName() == 'add_photo' ? 'selected' : '' ?>">_{Add Photos}</a></li><? + ?><li class="first"><a href="/photoapp/album/view/<?= $album->getId()?>" class="<?= in_array($controller->getActionName(),array( 'edit_photo', 'view')) ? 'selected' : '' ?>">_{View}</a></li><? + ?><li class="first"><a href="/photoapp/album/uploaded/<?= $album->getId()?>" class="<?= $controller->getActionName() == 'uploaded' ? 'selected' : '' ?>">_{Edit uploaded}</a></li><? + ?><li><a href="/photoapp/album/edit/<?= $album->getId()?>" class="last <?= $controller->getActionName() == 'edit' ? 'selected' : '' ?>">_{Edit Info}</a></li><? + ?><li><a href="/photoapp/album/delete/<?= $album->getId()?>" class="last <?= $controller->getActionName() == 'delete' ? 'selected' : '' ?>">_{Delete}</a></li> </ul> </div> <div class="right"> Modified: app/views/photoapp/album/edit_photo.tpl =================================================================== --- app/views/photoapp/album/edit_photo.tpl 2008-05-15 19:05:14 UTC (rev 209) +++ app/views/photoapp/album/edit_photo.tpl 2008-05-16 06:28:55 UTC (rev 210) @@ -5,7 +5,7 @@ <?= $controller->renderErrors() ?> <div class="uploaded_container"> - <?= $form_tag_helper->start_form_tag(array('action'=>'edit_photo', 'id' => $photo->get('id'))) ?> + <?= $form_tag_helper->start_form_tag(array('action'=>'edit_photo', 'id' => $photo->getId())) ?> <?= $form_helper->hidden_field('photo', 'action_edit', array('value' => 'do_edit'))?> <div class="edit_container"> Modified: app/views/photoapp/album/index.tpl =================================================================== --- app/views/photoapp/album/index.tpl 2008-05-15 19:05:14 UTC (rev 209) +++ app/views/photoapp/album/index.tpl 2008-05-16 06:28:55 UTC (rev 210) @@ -31,16 +31,16 @@ } ?></div> <div class="info"> - <div class="name_album"><a href="/photoapp/album/view/<?= $my_album->get('id')?>"><?= $my_album->get('name') ?></a></div> + <div class="name_album"><a href="/photoapp/album/view/<?= $my_album->getId()?>"><?= $my_album->get('name') ?></a></div> <div class="photos_count">_{photos}: <?= $my_album->get('photos_count')?> </div> <div class="description">_{Description}: <?= $my_album->get('description')?></div> <div class="photos_count">_{Created}: <?= $my_album->get('created_at')?></div> </div> <div class="links"> <ul class="actions_list"> - <li><a href="/photoapp/album/add_photo/<?= $my_album->get('id')?>">_{Edit Album}</a></li> - <li><a href="/photoapp/album/view/<?= $my_album->get('id')?>">_{View Album}</a></li> - <li><a href="/photoapp/album/delete/<?= $my_album->get('id')?>">_{Delete Album}</a></li> + <li><a href="/photoapp/album/add_photo/<?= $my_album->getId()?>">_{Edit Album}</a></li> + <li><a href="/photoapp/album/view/<?= $my_album->getId()?>">_{View Album}</a></li> + <li><a href="/photoapp/album/delete/<?= $my_album->getId()?>">_{Delete Album}</a></li> </ul> </div> </div> Modified: app/views/photoapp/album/uploaded.tpl =================================================================== --- app/views/photoapp/album/uploaded.tpl 2008-05-15 19:05:14 UTC (rev 209) +++ app/views/photoapp/album/uploaded.tpl 2008-05-16 06:28:55 UTC (rev 210) @@ -25,7 +25,7 @@ <div class="form_create_row"> <label >_{Name}:</label> <div class="form_create_col"> - <?= $form_helper->text_field('photo[' . $uploaded_photo->get('id') . ']', 'name', array('class' => 'text_input small')) ?> + <?= $form_helper->text_field('photo[' . $uploaded_photo->getId() . ']', 'name', array('class' => 'text_input small')) ?> </div> </div> <div class="clearfix"></div> @@ -33,7 +33,7 @@ <div class="form_create_row"> <label >_{Description}:</label> <div class="form_create_col"> - <?= $form_helper->text_area('photo[' . $uploaded_photo->get('id') . ']', 'caption', array('rows' => '5', 'class' => 'small')) ?> + <?= $form_helper->text_area('photo[' . $uploaded_photo->getId() . ']', 'caption', array('rows' => '5', 'class' => 'small')) ?> </div> </div> <div class="clearfix"></div> Modified: app/views/photoapp/album/view.tpl =================================================================== --- app/views/photoapp/album/view.tpl 2008-05-15 19:05:14 UTC (rev 209) +++ app/views/photoapp/album/view.tpl 2008-05-16 06:28:55 UTC (rev 210) @@ -21,8 +21,8 @@ </div> <div class="links"> <ul class="actions_list"> - <li><a href="/photoapp/album/edit_photo/<?= $photo->get('id')?>">_{Edit Photo}</a></li> - <li><a href="/photoapp/album/delete_photo/<?= $photo->get('id')?>">_{Delete Photo}</a></li> + <li><a href="/photoapp/album/edit_photo/<?= $photo->getId()?>">_{Edit Photo}</a></li> + <li><a href="/photoapp/album/delete_photo/<?= $photo->getId()?>">_{Delete Photo}</a></li> </ul> </div> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-05-15 19:05:14
|
Revision: 209 http://isocial.svn.sourceforge.net/isocial/?rev=209&view=rev Author: aguidrevitch Date: 2008-05-15 12:05:14 -0700 (Thu, 15 May 2008) Log Message: ----------- instant messengers profile support added Modified Paths: -------------- app/controllers/profile_controller.php app/installers/user_installer.php app/models/user.php app/views/profile/contact.tpl timesheet/aguidrevitch.txt Modified: app/controllers/profile_controller.php =================================================================== --- app/controllers/profile_controller.php 2008-05-15 19:04:44 UTC (rev 208) +++ app/controllers/profile_controller.php 2008-05-15 19:05:14 UTC (rev 209) @@ -48,7 +48,9 @@ function contact () { $this->contact_profile = $this->current_user->contact_profile->load(); - $this->imcontact_profile = $this->current_user->contact_profile->load(); + $this->im_profiles = $this->current_user->im_profile->load(); + + //var_dump($this->im_profiles); if ($this->Request->isPost() && !empty($this->params['contact_profile'])) { $this->contact_profile->setAttributes($this->params['contact_profile']); if ($this->contact_profile->save()) { @@ -57,6 +59,31 @@ $this->current_user->save(); } // saving IM info + if (!empty($this->params['im']) && is_array($this->params['im'])) { + if (!empty($this->params['delete_im'])) { + foreach ($this->params['delete_im'] as $id) { + $im_profile = $this->current_user->im_profile->find($id); + $im_profile->destroy(); + } + } + foreach ($this->params['im'] as $im) { + if ($im['im_id'] && $im['im_type']) { + unset($im_profile); + + if ($im['id']) { + $im_profile = $this->current_user->im_profile->find($im['id']); + } + + if (empty($im_profile) || $im_profile == false) { + $im_profile = $this->current_user->im_profile->build(); + } + + $im_profile->setAttributes($im); + $im_profile->save(); + } + } + } + $this->redirectTo(array('action' => 'contact')); } } Modified: app/installers/user_installer.php =================================================================== --- app/installers/user_installer.php 2008-05-15 19:04:44 UTC (rev 208) +++ app/installers/user_installer.php 2008-05-15 19:05:14 UTC (rev 209) @@ -187,34 +187,8 @@ INDEX user_idx (user_id) ) ENGINE=InnoDB"); - $this->execute( - "CREATE TABLE `ims` ( - `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `name` char(100) NOT NULL DEFAULT '' - ) ENGINE=InnoDB"); - - $this->execute("INSERT INTO ims (id, name) VALUES (0, 'ICQ')"); - $this->execute("INSERT INTO ims (id, name) VALUES (0, 'Mail.ru Agent')"); - $this->execute("INSERT INTO ims (id, name) VALUES (0, 'Skype')"); - $this->execute("INSERT INTO ims (id, name) VALUES (0, 'Windows Live')"); - $this->execute("INSERT INTO ims (id, name) VALUES (0, 'Google Talk')"); - $this->execute("INSERT INTO ims (id, name) VALUES (0, 'Yahoo')"); - $this->execute("INSERT INTO ims (id, name) VALUES (0, 'AIM')"); - $this->execute("INSERT INTO ims (id, name) VALUES (0, 'Jabber')"); - $this->execute("INSERT INTO ims (id, name) VALUES (0, 'Gadu-Gadu')"); $this->execute( - "CREATE TABLE `im_profiles` ( - `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `im_id` int(11), - `value` varchar(50), - FOREIGN KEY (user_id) REFERENCES users(id), - FOREIGN KEY (im_id) REFERENCES ims(id), - INDEX user_idx (user_id) - ) ENGINE=InnoDB"); - - $this->execute( "CREATE TABLE `contact_profiles` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, `user_id` int(11) NOT NULL, @@ -236,14 +210,21 @@ INDEX user_idx (user_id) ) ENGINE=InnoDB"); + $this->execute( + "CREATE TABLE `im_profiles` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `im_id` varchar(50), + `im_type` varchar(50), + FOREIGN KEY (user_id) REFERENCES users(id), + INDEX user_idx (user_id) + ) ENGINE=InnoDB"); } function down_1() { - $this->dropTable('contact_profiles'); $this->dropTable('im_profiles'); - $this->dropTable('ims'); - $this->dropTable('email_profiles'); + $this->dropTable('contact_profiles'); $this->dropTable('basic_profiles'); // triggers should be dropped automatically // http://dev.mysql.com/doc/refman/5.1/en/drop-trigger.html Modified: app/models/user.php =================================================================== --- app/models/user.php 2008-05-15 19:04:44 UTC (rev 208) +++ app/models/user.php 2008-05-15 19:05:14 UTC (rev 209) @@ -10,6 +10,8 @@ 'order' => 'created_at desc', 'foreign_key' => 'recipient_id', 'conditions' => 'is_recipient_del = 0'), + 'im_profiles' => array('class_name' => 'ImProfile', + 'foreign_key' => 'user_id'), ); var $has_one = array('BasicProfile', 'ContactProfile'); Modified: app/views/profile/contact.tpl =================================================================== --- app/views/profile/contact.tpl 2008-05-15 19:04:44 UTC (rev 208) +++ app/views/profile/contact.tpl 2008-05-15 19:05:14 UTC (rev 209) @@ -24,17 +24,62 @@ <label>_{IM Screen Name(s)}:</label> <div class="formcol"> <div class="middle"> - <?= $form_helper->text_field('contact_profile', 'im', array('class' => 'mediumtextinput') )?> - <select class="imselect"> - <option>AIM</option> - <option>Google talk</option> - <option>Skype</option> - <option>Windows Live</option> - <option>Yahoo</option> - <option>Gadu-Gadu</option> - <option>ICQ</option> - </select> - </div> + <div id="im" class="im" style="display: none"> + <input type="hidden"> + <input type="text" class="mediumtextinput"> + <select class="imselect"> + <option>AIM</option> + <option>Google talk</option> + <option>Skype</option> + <option>Windows Live</option> + <option>Yahoo</option> + <option>Gadu-Gadu</option> + <option>ICQ</option> + </select> + <div class="delete"></div> + <div class="clearfix"></div> + </div> + </div> + <script text="textjavascript"> + var imcount = 0; + + function add_im ( id, im_id, im_type) { + + if (imcount >= 10) + return; + + var im = Element.extend($('im').cloneNode(true)); + + im.childElements()[0].writeAttribute('name', 'im['+imcount+'][id]'); + im.childElements()[1].writeAttribute('name', 'im['+imcount+'][im_id]'); + im.childElements()[2].writeAttribute('name', 'im['+imcount+'][im_type]'); + + im.childElements()[0].setValue(id); + im.childElements()[1].setValue(im_id); + im.childElements()[2].setValue(im_type); + im.childElements()[3].observe("click", function (event) { + if (imcount > 1) { + if (id) + $(im.parentNode).insert(new Element('input', { type: 'hidden', name: 'delete_im[]', value: id })); + im.remove(); + imcount--; + } + }); + + $($('im').parentNode).insert(im); + im.show(); + + imcount++; + } + <? + if (!empty($im_profiles)) { + foreach ($im_profiles as $im) { + echo "add_im('" . $im->id . "', '" . addslashes($im->im_id) . "', '" . addslashes($im->im_type) . "');\n"; + } + } + ?> + add_im(); + </script> <div class="third"> <?= $access_field_helper->access_field('contact_profile', 'im_access', array('title' => 'Instant Messenger')); ?> </div> @@ -44,7 +89,7 @@ <label></label> <div class="formcol"> <div class="middle"> - <a href="#">Add another screen name</a> + <a href="#" onclick='add_im()'>Add another screen name</a> </div> </div> </div> Modified: timesheet/aguidrevitch.txt =================================================================== --- timesheet/aguidrevitch.txt 2008-05-15 19:04:44 UTC (rev 208) +++ timesheet/aguidrevitch.txt 2008-05-15 19:05:14 UTC (rev 209) @@ -7,3 +7,6 @@ 2008-05-13,10:10,13:10,main,RT:1,"rewriting dialogs" 2008-05-13,13:10,13:30,main,RT:1,"helping dimos with models" 2008-05-13,14:20,17:30,main,RT:1,"improving city selector" +2008-05-13,20:40,21:20,main,RT:1,"fixing IE6 compatibility issues for dialog, minor fixes to city dialog" +2008-05-14,19:10,22:00,main,RT:1,"instant messagers profile" +2008-05-15,20:40,22:10,main,RT:1,"instant messagers profile implemented" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-05-15 19:05:04
|
Revision: 208 http://isocial.svn.sourceforge.net/isocial/?rev=208&view=rev Author: dim0s77 Date: 2008-05-15 12:04:44 -0700 (Thu, 15 May 2008) Log Message: ----------- discussion board: 'reply to post' implementation started Modified Paths: -------------- app/controllers/groupapp/board_controller.php app/views/groupapp/board/_menu.tpl app/views/groupapp/board/reply_to_post.tpl timesheet/dim0s77.txt Modified: app/controllers/groupapp/board_controller.php =================================================================== --- app/controllers/groupapp/board_controller.php 2008-05-15 18:20:44 UTC (rev 207) +++ app/controllers/groupapp/board_controller.php 2008-05-15 19:04:44 UTC (rev 208) @@ -142,7 +142,35 @@ function reply_to_post () { if (!empty($this->params['id'])) { + $messages = $this->GroupappMessage->find('all', + array( + 'conditions' => array("group_id = ?", $this->params['id']), + 'include' => 'user' + ) + ); + $message = $this->GroupappMessage->findFirst( + array( + 'conditions' => array("id = ?", $this->params['id']), + 'include' => 'user' + ) + ); + if ($message) { + $member = $this->GroupappMember->findFirst(array( 'group_id' => $message->group_id, + 'user_id' => $this->current_user->getId() + )); + $group = $this->GroupappGroup->find( $message->group_id ); + if (($group && $group->access == 1) || $member) { + $this->message_to_reply = $message; + $this->group_id = $group->getId(); + $this->group_name = $group->name; + $this->topic_id = $message->topic_id; + } else { + $this->addError('_common', 'Access denied', 'Group id closed. You can\'t reply to this message'); + } + return; + } } + $this->addError('_common', 'Topic not found', 'This topic is not founded'); } } Modified: app/views/groupapp/board/_menu.tpl =================================================================== --- app/views/groupapp/board/_menu.tpl 2008-05-15 18:20:44 UTC (rev 207) +++ app/views/groupapp/board/_menu.tpl 2008-05-15 19:04:44 UTC (rev 208) @@ -1,19 +1,22 @@ <div class="tabs"> <div class="left"> <ul class="toggle_tabs"> - <li class="first"><a href="/groupapp/board/{group.id?}" class="<?= $controller->getActionName() == 'index' ? 'selected' : '' ?>">_{Discussion Board}</a></li><? + <li class="first"><a href="/groupapp/board/{group_id?}" class="<?= $controller->getActionName() == 'index' ? 'selected' : '' ?>">_{Discussion Board}</a></li><? if ($controller->getActionName() == 'show_topic' || - $controller->getActionName() == 'reply_to_topic' - ) { ?><li><a href="/groupapp/board/show_topic/{messages-0.topic_id?}" class="<?= $controller->getActionName() == 'show_topic' ? 'last selected' : '' ?>" >_{Topic View}</a></li><? } ?><? + $controller->getActionName() == 'reply_to_topic' || + $controller->getActionName() == 'reply_to_post' + ) { ?><li><a href="/groupapp/board/show_topic/{topic_id?}" class="<?= $controller->getActionName() == 'show_topic' ? 'last selected' : '' ?>" >_{Topic View}</a></li><? } ?><? if ($controller->getActionName() == 'reply_to_topic') { ?> - <li><a href="/groupapp/board/reply_to_topic/{messages-0.topic_id?}" class="last selected">_{Post Reply}</a></li> + <li><a href="/groupapp/board/reply_to_topic/{topic_id?}" class="last selected">_{Post Reply}</a></li> <? } + else if ($controller->getActionName() == 'reply_to_post') { ?> + <li><a href="/groupapp/board/reply_to_post/{message_to_reply.id?}" class="last selected">_{Post Reply}</a></li> <? } ?> </ul> </div> <div class="right"> <ul class="toggle_tabs"> <? if ($controller->getActionName() != 'reply_to_topic' && $controller->getActionName() != 'reply_to_post') { ?> - <li class="first last"><a href="/groupapp/board/start_topic/{group.id?}" class="<?= $controller->getActionName() == 'start_topic' ? 'selected' : '' ?>">_{Start New Topic}</a></li> + <li class="first last"><a href="/groupapp/board/start_topic/{group_id?}" class="<?= $controller->getActionName() == 'start_topic' ? 'selected' : '' ?>">_{Start New Topic}</a></li> <? } ?> </ul> </div> Modified: app/views/groupapp/board/reply_to_post.tpl =================================================================== --- app/views/groupapp/board/reply_to_post.tpl 2008-05-15 18:20:44 UTC (rev 207) +++ app/views/groupapp/board/reply_to_post.tpl 2008-05-15 19:04:44 UTC (rev 208) @@ -14,10 +14,7 @@ </div> <div class="formrow"> <label> - <!-- <?= $form_helper->hidden_field('topic', 'group_id', array('value' => $group->getId()))?> --> - <!-- {?topic.group_id}<input id="topic_group_id" name="topic[group_id]" type="hidden" value="{topic.group_id?}" />{end} --> - <!-- {?topic.topic_id}<input id="topic_topic_id" name="topic[topic_id]" type="hidden" value="{topic.topic_id?}" />{end} --> - <!-- {?topic.reply_message_id}<input id="topic_reply_topic_id" name="topic[reply_message_id]" type="hidden" value="{topic.reply_message_id?}" />{end} --> + <?= $form_helper->hidden_field('topic', 'group_id', array('value' => $message_to_reply->group_id))?> </label> <input class="submitinput" type="submit" value="_{Post}"> <input class="cancelinput" type="button" value="_{Cancel}"> Modified: timesheet/dim0s77.txt =================================================================== --- timesheet/dim0s77.txt 2008-05-15 18:20:44 UTC (rev 207) +++ timesheet/dim0s77.txt 2008-05-15 19:04:44 UTC (rev 208) @@ -22,3 +22,4 @@ 2008-05-15,10:20,12:20,groupapp,RT:3,"discussion board: topics list" 2008-05-15,18:35,21:15,groupapp,RT:3,"discussion board: reply to topic" +2008-05-15,21:15,22:00,groupapp,RT:3,"discussion board: reply to post" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-05-15 18:21:20
|
Revision: 207 http://isocial.svn.sourceforge.net/isocial/?rev=207&view=rev Author: dim0s77 Date: 2008-05-15 11:20:44 -0700 (Thu, 15 May 2008) Log Message: ----------- discussion board: 'reply to topic' implemented Modified Paths: -------------- app/controllers/groupapp/board_controller.php app/locales/groupapp/board/ru.php app/views/groupapp/board/_menu.tpl app/views/groupapp/board/reply_to_post.tpl app/views/groupapp/board/reply_to_topic.tpl app/views/groupapp/board/show_topic.tpl app/views/groupapp/board/start_topic.tpl public/stylesheets/common/Form.css timesheet/dim0s77.txt Modified: app/controllers/groupapp/board_controller.php =================================================================== --- app/controllers/groupapp/board_controller.php 2008-05-15 17:15:37 UTC (rev 206) +++ app/controllers/groupapp/board_controller.php 2008-05-15 18:20:44 UTC (rev 207) @@ -12,8 +12,9 @@ 'include' => 'user' ) ); - $group = $this->GroupappGroup->findFirst(array( 'id = ?' => $this->params['id'] )); + $group = $this->GroupappGroup->find( $this->params['id'] ); $topics = array(); + $persons = array(); if(!empty($messages)) { foreach ($messages as $message_loop_key => $message) { if (!isset($topics[$message->topic_id])) { @@ -49,9 +50,10 @@ $member = $this->GroupappMember->findFirst(array( 'group_id' => $messages[0]->group_id, 'user_id' => $this->current_user->getId() )); - $group = $this->GroupappGroup->findFirst(array( 'id' => $messages[0]->group_id )); + $group = $this->GroupappGroup->find( $messages[0]->group_id ); if (($group && $group->access == 1) || $member) { $this->messages = $messages; + $this->group = $group; } else { $this->addError('_common', 'Access denied', 'Group id closed. You can\'t to see this topic'); } @@ -65,8 +67,8 @@ if (!empty($this->params['topic']) && !empty($this->params['topic']['group_id']) && !empty($this->params['topic']['body'])) { - if ( $group = $this->GroupappGroup->findFirst(array( 'id' => $this->params['topic']['group_id'] )) ) { - $member = $this->GroupappMember->findFirst(array( 'group_id' => $group->getId(), + if ( $this->group = $this->GroupappGroup->find( $this->params['topic']['group_id'] ) ) { + $member = $this->GroupappMember->findFirst(array( 'group_id' => $this->group->getId(), 'user_id' => $this->current_user->getId() )); if ($member) { @@ -88,8 +90,8 @@ } $this->addError('_common', 'Sending message error', 'please, try again'); } else if (!empty($this->params['id'])) { - if ( $group = $this->GroupappGroup->findFirst(array( 'id' => $this->params['id'] )) ) { - $this->topic = $group->message->build(); + if ( $this->group = $this->GroupappGroup->find( $this->params['id'] ) ) { + $this->topic = $this->group->message->build(); } } else { $this->addError('_common', 'Start topic error', 'please, specify group'); @@ -98,8 +100,44 @@ function reply_to_topic () { - if (!empty($this->params['id'])) { + if (!empty($this->params['topic']) && + !empty($this->params['topic']['group_id']) && + !empty($this->params['topic']['topic_id']) && + !empty($this->params['topic']['body'])) { + if ( $this->group = $this->GroupappGroup->find( $this->params['topic']['group_id'] ) ) { + $member = $this->GroupappMember->findFirst(array( 'group_id' => $this->group->getId(), + 'user_id' => $this->current_user->getId() + )); + if ($member) { + $message = $member->message->build(); + $message->setAttributes($this->params['topic']); + if ($message->save()) { + $this->redirectTo(array('action' => 'show_topic', 'id' => $message->topic_id)); + return; + } + } + } + $this->addError('_common', 'Sending message error', 'please, try again'); + } else if (!empty($this->params['id'])) { + $messages = $this->GroupappMessage->find('all', array( + 'conditions' => array("topic_id = ?", $this->params['id']) + ) + ); + if ($messages) { + $member = $this->GroupappMember->findFirst(array( 'group_id' => $messages[0]->group_id, + 'user_id' => $this->current_user->getId() + )); + $group = $this->GroupappGroup->find( $messages[0]->group_id ); + if (($group && $group->access == 1) || $member) { + $this->messages = $messages; + $this->group = $group; + } else { + $this->addError('_common', 'Access denied', 'Group id closed. You can\'t reply to this topic'); + } + return; + } } + $this->addError('_common', 'Topic not found', 'This topic is not founded'); } function reply_to_post () { Modified: app/locales/groupapp/board/ru.php =================================================================== --- app/locales/groupapp/board/ru.php 2008-05-15 17:15:37 UTC (rev 206) +++ app/locales/groupapp/board/ru.php 2008-05-15 18:20:44 UTC (rev 207) @@ -38,9 +38,12 @@ $dictionary['wrote'] = 'по теме'; $dictionary['replied to post'] = 'в ответ на сообщение'; $dictionary['Reply'] = 'Ответить'; +$dictionary['Post'] = 'Сообщение'; +$dictionary['Post reply'] = 'Ответить'; +$dictionary['Post Reply'] = 'Послать ответ'; +$dictionary['Your reply'] = 'Ваш ответ'; $dictionary['to Your Post'] = 'себе'; $dictionary['replies'] = 'ответов'; -$dictionary['Post'] = 'Сообщение'; $dictionary['Mark as Irrelevant'] = 'Пометить как неуместное'; $dictionary['Delete Post'] = 'Удалить сообщение'; $dictionary['Report'] = 'Пожаловаться'; Modified: app/views/groupapp/board/_menu.tpl =================================================================== --- app/views/groupapp/board/_menu.tpl 2008-05-15 17:15:37 UTC (rev 206) +++ app/views/groupapp/board/_menu.tpl 2008-05-15 18:20:44 UTC (rev 207) @@ -1,13 +1,20 @@ <div class="tabs"> <div class="left"> <ul class="toggle_tabs"> - <li class="first"><a href="/groupapp/board" class="<?= $controller->getActionName() == 'index' ? 'selected' : '' ?>">_{Discussion Board}</a></li><? - if ($controller->getActionName() == 'show_topic') { ?><li><a href="/groupapp/board/show_topic/{topic.id?}" class="last selected">_{Topic View}</a></li><? } ?> + <li class="first"><a href="/groupapp/board/{group.id?}" class="<?= $controller->getActionName() == 'index' ? 'selected' : '' ?>">_{Discussion Board}</a></li><? + if ($controller->getActionName() == 'show_topic' || + $controller->getActionName() == 'reply_to_topic' + ) { ?><li><a href="/groupapp/board/show_topic/{messages-0.topic_id?}" class="<?= $controller->getActionName() == 'show_topic' ? 'last selected' : '' ?>" >_{Topic View}</a></li><? } ?><? + if ($controller->getActionName() == 'reply_to_topic') { ?> + <li><a href="/groupapp/board/reply_to_topic/{messages-0.topic_id?}" class="last selected">_{Post Reply}</a></li> + <? } ?> </ul> </div> <div class="right"> <ul class="toggle_tabs"> - <li class="first last"><a href="/groupapp/board/start_topic" class="<?= $controller->getActionName() == 'start_topic' ? 'selected' : '' ?>">_{Start New Topic}</a></li> +<? if ($controller->getActionName() != 'reply_to_topic' && $controller->getActionName() != 'reply_to_post') { ?> + <li class="first last"><a href="/groupapp/board/start_topic/{group.id?}" class="<?= $controller->getActionName() == 'start_topic' ? 'selected' : '' ?>">_{Start New Topic}</a></li> +<? } ?> </ul> </div> </div> Modified: app/views/groupapp/board/reply_to_post.tpl =================================================================== --- app/views/groupapp/board/reply_to_post.tpl 2008-05-15 17:15:37 UTC (rev 206) +++ app/views/groupapp/board/reply_to_post.tpl 2008-05-15 18:20:44 UTC (rev 207) @@ -14,9 +14,10 @@ </div> <div class="formrow"> <label> - {?topic.group_id}<input id="topic_group_id" name="topic[group_id]" type="hidden" value="{topic.group_id?}" />{end} - {?topic.topic_id}<input id="topic_topic_id" name="topic[topic_id]" type="hidden" value="{topic.topic_id?}" />{end} - {?topic.reply_message_id}<input id="topic_reply_topic_id" name="topic[reply_message_id]" type="hidden" value="{topic.reply_message_id?}" />{end} + <!-- <?= $form_helper->hidden_field('topic', 'group_id', array('value' => $group->getId()))?> --> + <!-- {?topic.group_id}<input id="topic_group_id" name="topic[group_id]" type="hidden" value="{topic.group_id?}" />{end} --> + <!-- {?topic.topic_id}<input id="topic_topic_id" name="topic[topic_id]" type="hidden" value="{topic.topic_id?}" />{end} --> + <!-- {?topic.reply_message_id}<input id="topic_reply_topic_id" name="topic[reply_message_id]" type="hidden" value="{topic.reply_message_id?}" />{end} --> </label> <input class="submitinput" type="submit" value="_{Post}"> <input class="cancelinput" type="button" value="_{Cancel}"> Modified: app/views/groupapp/board/reply_to_topic.tpl =================================================================== --- app/views/groupapp/board/reply_to_topic.tpl 2008-05-15 17:15:37 UTC (rev 206) +++ app/views/groupapp/board/reply_to_topic.tpl 2008-05-15 18:20:44 UTC (rev 207) @@ -1,25 +1,33 @@ <?= $controller->renderPartial("head") ?> +{?messages} +<div class="submenu"> + <div class="menu_block"> + <div class="header">_{Topic}: <a href="/groupapp/board/show_topic/{messages-0.topic_id}">{messages-0.subject?}</a></div> + </div> +</div> +<div class="clearfix"></div> + <?= $controller->renderErrors() ?> -<form action="/groupapp/board/reply_to_topic" method="post"> +<form action="/groupapp/board/reply_to_topic/{messages-0.topic_id?}" method="post"> <div class="editform"> <div class="formrow"> - <label>_{Topic}:</label> - <?= $form_helper->text_field('topic', 'subject', array('class' => 'textinput'))?> - </div> - <div class="formrow"> - <label>_{Post}:</label> + <label> </label><span class="label">_{Your reply}</span><br> <?= $form_helper->text_area('topic', 'body', array('class' => 'textinput'))?> </div> <div class="formrow"> <label> - {?topic.group_id}<input id="topic_group_id" name="topic[group_id]" type="hidden" value="{topic.group_id?}" />{end} - {?topic.topic_id}<input id="topic_topic_id" name="topic[topic_id]" type="hidden" value="{topic.topic_id?}" />{end} - {?topic.reply_message_id}<input id="topic_reply_message_id" name="topic[reply_message_id]" type="hidden" value="{topic.reply_message_id?}" />{end} + <?= $form_helper->hidden_field('topic', 'group_id', array('value' => $messages[0]->group_id))?> + <?= $form_helper->hidden_field('topic', 'topic_id', array('value' => $messages[0]->topic_id))?> + <?= $form_helper->hidden_field('topic', 'subject', array('value' => $messages[0]->subject))?> </label> - <input class="submitinput" type="submit" value="_{Post}"> + <input class="submitinput" type="submit" value="_{Post reply}"> <input class="cancelinput" type="button" value="_{Cancel}"> </div> </div> </form> +<div class="clearfix"></div> +{else} +<?= $controller->renderErrors() ?> +{end} Modified: app/views/groupapp/board/show_topic.tpl =================================================================== --- app/views/groupapp/board/show_topic.tpl 2008-05-15 17:15:37 UTC (rev 206) +++ app/views/groupapp/board/show_topic.tpl 2008-05-15 18:20:44 UTC (rev 207) @@ -4,7 +4,7 @@ <div class="submenu"> <div class="menu_block"> - <div class="header">_{Topic}: {messages-0.subject?}</div> + <div class="header">_{Topic}: <a href="/groupapp/board/show_topic/{messages-0.topic_id}">{messages-0.subject?}</a></div> </div> <div class="menu_block right"> @@ -35,7 +35,7 @@ <div class="avatar"> <a href="/profile/show/{message.user_id?}"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a> <div class="subtext">#{message_loop_counter}</div> - <input id="message_id{message.id?}" name="message_id{message.id?}" type="hidden" value="{message_loop_counter}" /> + <?= $form_helper->hidden_field('message_id', $message->id, array('value' => $message_loop_counter))?> </div> <div class="message"> @@ -45,7 +45,7 @@ <? } else { ?><a href="/profile/show/{message.user_id?}"><span class="other_user">{message.user.name?}</span></a><? } ?> </span> {?message.reply_message_id} - <span>_{replied to post} #<script>document.write($('message_id{message.reply_message_id?}').readAttribute('value'));</script></span> + <span>_{replied to post} #<script>document.write($('message_id_<?= $message->reply_message_id ?>').readAttribute('value'));</script></span> {else}_{wrote}{end} <div class="subtext">{message.created_at?}</div> </div> Modified: app/views/groupapp/board/start_topic.tpl =================================================================== --- app/views/groupapp/board/start_topic.tpl 2008-05-15 17:15:37 UTC (rev 206) +++ app/views/groupapp/board/start_topic.tpl 2008-05-15 18:20:44 UTC (rev 207) @@ -2,7 +2,7 @@ <?= $controller->renderErrors() ?> -<form action="/groupapp/board/start_topic" method="post"> +<form action="/groupapp/board/start_topic/{group.id?}" method="post"> <div class="editform"> <div class="formrow"> <label>_{Topic}:</label> @@ -14,7 +14,7 @@ </div> <div class="formrow"> <label> - {?topic.group_id}<input id="topic_group_id" name="topic[group_id]" type="hidden" value="{topic.group_id?}" />{end} + <?= $form_helper->hidden_field('topic', 'group_id', array('value' => $group->getId()))?> </label> <input class="submitinput" type="submit" value="_{Create new Topic}"> <input class="cancelinput" type="button" value="_{Cancel}"> Modified: public/stylesheets/common/Form.css =================================================================== --- public/stylesheets/common/Form.css 2008-05-15 17:15:37 UTC (rev 206) +++ public/stylesheets/common/Form.css 2008-05-15 18:20:44 UTC (rev 207) @@ -14,6 +14,12 @@ line-height: 16px; } +.editform .formrow .label { + font-weight: bold; + color: #666666; + padding: 3px 10px 3px 0px; +} + .formrow label { font-weight: bold; color: #666666; Modified: timesheet/dim0s77.txt =================================================================== --- timesheet/dim0s77.txt 2008-05-15 17:15:37 UTC (rev 206) +++ timesheet/dim0s77.txt 2008-05-15 18:20:44 UTC (rev 207) @@ -21,3 +21,4 @@ 2008-05-14,15:00,16:35,groupapp,RT:3,"discussions for group (replying to topic)" 2008-05-15,10:20,12:20,groupapp,RT:3,"discussion board: topics list" +2008-05-15,18:35,21:15,groupapp,RT:3,"discussion board: reply to topic" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-15 17:15:41
|
Revision: 206 http://isocial.svn.sourceforge.net/isocial/?rev=206&view=rev Author: fsnobody Date: 2008-05-15 10:15:37 -0700 (Thu, 15 May 2008) Log Message: ----------- fix config hardcode Modified Paths: -------------- app/controllers/photoapp/album_controller.php Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-15 16:42:23 UTC (rev 205) +++ app/controllers/photoapp/album_controller.php 2008-05-15 17:15:37 UTC (rev 206) @@ -77,7 +77,10 @@ $photo->setAttributes($v); $photo->save(); } - $this->redirectTo(array('action' => 'index')); + //$this->redirectTo(array('action' => 'index')); + + + $this->redirectTo(array('action' => 'view', 'id' => $photo->album_id)); } else { if (!empty($this->params['id']) && $this->PhotoappAlbum->find($this->params['id'])) { // pre delete @@ -154,7 +157,7 @@ if ($_FILES['album']['error'][$field] == 0 ) { // copy file; save photo $photo_name = microtime(true) . ".jpeg"; - $user_path = PROJECT_DIR . "public/images/uploaded/" . $this->current_user->getId(); + $user_path = AK_PUBLIC_DIR. "/images/uploaded/" . $this->current_user->getId(); if(!file_exists($user_path)) { `mkdir $user_path`; `chmod 777 $user_path`; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-05-15 16:42:29
|
Revision: 205 http://isocial.svn.sourceforge.net/isocial/?rev=205&view=rev Author: fsnobody Date: 2008-05-15 09:42:23 -0700 (Thu, 15 May 2008) Log Message: ----------- edit photo Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/views/photoapp/album/_edit_menu.tpl app/views/photoapp/album/edit_photo.tpl public/stylesheets/photoapp/Album.css timesheet/eerunov.txt Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-15 14:38:24 UTC (rev 204) +++ app/controllers/photoapp/album_controller.php 2008-05-15 16:42:23 UTC (rev 205) @@ -22,7 +22,20 @@ } function edit_photo () { - if (!empty($this->params['id']) && $this->PhotoappPhoto->find($this->params['id'])) { + if (!empty($this->params['photo']) && $this->params['photo']['action_edit'] == 'do_edit'){ + $photo = $this->PhotoappPhoto->findFirst(array('id' => $this->params['id'])); + if ($photo) { + $album = $this->PhotoappAlbum->findFirst(array('id' => $photo->album_id)); + if ($album->owner == $this->current_user->getId()) { + $photo->setAttributes($this->params['photo']); + if ($this->Request->isPost() && $photo->save()){ + $this->redirectTo(array('action' => 'view', 'id' => $album->id)); + } + } + } else { + $this->importErrors( $this->PhotoappPhoto->getErrors() ); + } + } else if (!empty($this->params['id']) && $this->PhotoappPhoto->find($this->params['id'])) { $this->photo = $this->PhotoappPhoto->find($this->params['id']); $this->album = $this->PhotoappAlbum->find($this->photo->album_id); $this->albums = $this->PhotoappAlbum->find('all', array('conditions' => array('owner = ' . $this->current_user->getId()))); Modified: app/views/photoapp/album/_edit_menu.tpl =================================================================== --- app/views/photoapp/album/_edit_menu.tpl 2008-05-15 14:38:24 UTC (rev 204) +++ app/views/photoapp/album/_edit_menu.tpl 2008-05-15 16:42:23 UTC (rev 205) @@ -1,11 +1,11 @@ <div class="tabs"> <div class="left"> <ul class="toggle_tabs"> - <li class="first"><a href="/photoapp/album/add_photo/{id}" class="<?= $controller->getActionName() == 'add_photo' ? 'selected' : '' ?>">_{Add Photos}</a></li><? - ?><li class="first"><a href="/photoapp/album/view/{id}" class="<?= $controller->getActionName() == 'view' ? 'selected' : '' ?>">_{View}</a></li><? - ?><li class="first"><a href="/photoapp/album/uploaded/{id}" class="<?= $controller->getActionName() == 'uploaded' ? 'selected' : '' ?>">_{Edit uploaded}</a></li><? - ?><li><a href="/photoapp/album/edit/{id}" class="last <?= $controller->getActionName() == 'edit' ? 'selected' : '' ?>">_{Edit Info}</a></li><? - ?><li><a href="/photoapp/album/delete/{id}" class="last <?= $controller->getActionName() == 'delete' ? 'selected' : '' ?>">_{Delete}</a></li> + <li class="first"><a href="/photoapp/album/add_photo/<?= $album->get('id')?>" class="<?= $controller->getActionName() == 'add_photo' ? 'selected' : '' ?>">_{Add Photos}</a></li><? + ?><li class="first"><a href="/photoapp/album/view/<?= $album->get('id')?>" class="<?= in_array($controller->getActionName(),array( 'edit_photo', 'view')) ? 'selected' : '' ?>">_{View}</a></li><? + ?><li class="first"><a href="/photoapp/album/uploaded/<?= $album->get('id')?>" class="<?= $controller->getActionName() == 'uploaded' ? 'selected' : '' ?>">_{Edit uploaded}</a></li><? + ?><li><a href="/photoapp/album/edit/<?= $album->get('id')?>" class="last <?= $controller->getActionName() == 'edit' ? 'selected' : '' ?>">_{Edit Info}</a></li><? + ?><li><a href="/photoapp/album/delete/<?= $album->get('id')?>" class="last <?= $controller->getActionName() == 'delete' ? 'selected' : '' ?>">_{Delete}</a></li> </ul> </div> <div class="right"> Modified: app/views/photoapp/album/edit_photo.tpl =================================================================== --- app/views/photoapp/album/edit_photo.tpl 2008-05-15 14:38:24 UTC (rev 204) +++ app/views/photoapp/album/edit_photo.tpl 2008-05-15 16:42:23 UTC (rev 205) @@ -5,12 +5,12 @@ <?= $controller->renderErrors() ?> <div class="uploaded_container"> - <?= $form_tag_helper->start_form_tag(array('action'=>'edit_photo', 'id' => $photo->get('get'))) ?> + <?= $form_tag_helper->start_form_tag(array('action'=>'edit_photo', 'id' => $photo->get('id'))) ?> <?= $form_helper->hidden_field('photo', 'action_edit', array('value' => 'do_edit'))?> <div class="edit_container"> <div class="photo_comment"> - <div class="img_medium"><img src="/preview/index/300x270/<?= $photo->get('img')?>" /></div> + <div class="img_medium"><img src="/preview/index/620x500/<?= $photo->get('img')?>" /></div> <div class="data_medium"> <div class="form_create_row"> Modified: public/stylesheets/photoapp/Album.css =================================================================== --- public/stylesheets/photoapp/Album.css 2008-05-15 14:38:24 UTC (rev 204) +++ public/stylesheets/photoapp/Album.css 2008-05-15 16:42:23 UTC (rev 205) @@ -191,16 +191,16 @@ .photo_comment .img_medium { float: left; - width: 320px; - height: 270px; + width: 620px; text-align: center; - padding-top: 10px; + padding: 10px 0px; } .photo_comment .data_medium { float: left; - width: 300px; + width: 320px; height: 270px; + padding: 0px 100px; } .photo_view .img { Modified: timesheet/eerunov.txt =================================================================== --- timesheet/eerunov.txt 2008-05-15 14:38:24 UTC (rev 204) +++ timesheet/eerunov.txt 2008-05-15 16:42:23 UTC (rev 205) @@ -12,3 +12,4 @@ 2008-05-12,09:00,11:00,photoapp,RT:2,"comment uploaded + cover onoad" 2008-05-13,07:00,09:10,photoapp,RT:2,"photo list + delete" 2008-05-14,09:00,11:00.photoapp,RT:2,"change img storage + design edit photo v1" +2008-05-15,10:00,11:00,photoapp,RT:2,"edit photo" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |