[Isocial-svn] SF.net SVN: isocial: [263] app
Status: Pre-Alpha
Brought to you by:
aguidrevitch
From: <agu...@us...> - 2008-07-03 19:04:37
|
Revision: 263 http://isocial.svn.sourceforge.net/isocial/?rev=263&view=rev Author: aguidrevitch Date: 2008-07-03 12:04:46 -0700 (Thu, 03 Jul 2008) Log Message: ----------- initial network profile upload Modified Paths: -------------- app/controllers/profile_controller.php app/installers/user_installer.php app/views/profile/_menu.tpl Added Paths: ----------- app/models/network.php app/models/network_profile.php app/views/profile/networks.tpl Removed Paths: ------------- app/views/profile/groups.tpl Modified: app/controllers/profile_controller.php =================================================================== --- app/controllers/profile_controller.php 2008-07-03 17:39:44 UTC (rev 262) +++ app/controllers/profile_controller.php 2008-07-03 19:04:46 UTC (rev 263) @@ -109,7 +109,7 @@ } } - function groups () { + function networks () { } function picture () { Modified: app/installers/user_installer.php =================================================================== --- app/installers/user_installer.php 2008-07-03 17:39:44 UTC (rev 262) +++ app/installers/user_installer.php 2008-07-03 19:04:46 UTC (rev 263) @@ -286,14 +286,21 @@ ) ENGINE=InnoDB"); $this->execute( - "CREATE TABLE `group_profiles` ( + "CREATE TABLE `networks` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `city_id` int(11), + `name` char(255) + FOREIGN KEY (user_id) REFERENCES users(id), + ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `network_profiles` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, `user_id` int(11) NOT NULL, - `group_id` int(11), + `network_id` int(11), `from` datetime, `to` datetime, - `position` char(100), - `concentration` char(100), + `description` char(255), FOREIGN KEY (user_id) REFERENCES users(id), INDEX user_idx (user_id) ) ENGINE=InnoDB"); @@ -303,8 +310,8 @@ { $this->transactionComplete(); - $this->dropTable('group_profiles'); - $this->dropTable('groups'); + $this->dropTable('network_profiles'); + $this->dropTable('networks'); $this->dropTable('personal_profiles'); $this->dropTable('marital_statuses'); $this->dropTable('relationship_profiles'); Added: app/models/network.php =================================================================== --- app/models/network.php (rev 0) +++ app/models/network.php 2008-07-03 19:04:46 UTC (rev 263) @@ -0,0 +1,36 @@ +<?php + +class Network extends VotableActiveRecord +{ + var $belongs_to = array('City'); + var $votes_model = 'NetworkVote'; + var $strtolower = false; + var $_alternate = false; + + function findConditions () { + return array('conditions' => array("country_id = ? AND region_id = ? AND name LIKE ?", $this->country_id, $this->region_id, $this->name)); + } + + function validateOnCreate () { + $this->validatesPresenceOf('name', "Network Name|network name can't be blank"); + $this->validatesPresenceOf('city_id', "City|city can't be blank"); + if (!$this->getErrors()) { + $this->validatesNumericalityOf('city_id', "City: hack attempt detected|city does not exist"); + if (!$this->getErrors()) { + $City = new City(); + $city = $City->find( $this->city_id ); + if (empty($city)) { + $this->addError('city_id', "City: hack attempt detected|city does not exist"); + } + } + } + } + +} + +class NetworkVote extends ActiveRecord +{ + var $primary_key_name = 'network_id'; +} + +?> Added: app/models/network_profile.php =================================================================== --- app/models/network_profile.php (rev 0) +++ app/models/network_profile.php 2008-07-03 19:04:46 UTC (rev 263) @@ -0,0 +1,8 @@ +<?php + +class NetworkProfile extends ActiveRecord +{ + var $belongs_to = array('User', 'Network'); +} + +?> Modified: app/views/profile/_menu.tpl =================================================================== --- app/views/profile/_menu.tpl 2008-07-03 17:39:44 UTC (rev 262) +++ app/views/profile/_menu.tpl 2008-07-03 19:04:46 UTC (rev 263) @@ -6,7 +6,7 @@ ?><li><a href="/profile/contact" class="<?= $controller->getActionName() == 'contact' ? 'selected' : '' ?>">_{Contact}</a></li><? ?><li><a href="/profile/relationships" class="<?= $controller->getActionName() == 'relationships' ? 'selected' : '' ?>">_{Relationships}</a></li><? ?><li><a href="/profile/personal" class="<?= $controller->getActionName() == 'personal' ? 'selected' : '' ?>">_{Personal}</a></li><? - ?><li><a href="/profile/groups" class="<?= $controller->getActionName() == 'groups' ? 'selected' : '' ?>">_{Groups}</a></li><? + ?><li><a href="/profile/networks" class="<?= $controller->getActionName() == 'groups' ? 'selected' : '' ?>">_{Groups}</a></li><? ?><li><a href="/profile/picture" class="last <?= $controller->getActionName() == 'picture' ? 'selected' : '' ?>">_{Picture}</a></li> </ul> </div> Deleted: app/views/profile/groups.tpl =================================================================== --- app/views/profile/groups.tpl 2008-07-03 17:39:44 UTC (rev 262) +++ app/views/profile/groups.tpl 2008-07-03 19:04:46 UTC (rev 263) @@ -1,5 +0,0 @@ -<?= $controller->renderPartial("menu") ?> - -<?= $controller->renderErrors() ?> - -<p class="indent">Coming soon</p> \ No newline at end of file Added: app/views/profile/networks.tpl =================================================================== --- app/views/profile/networks.tpl (rev 0) +++ app/views/profile/networks.tpl 2008-07-03 19:04:46 UTC (rev 263) @@ -0,0 +1,5 @@ +<?= $controller->renderPartial("menu") ?> + +<?= $controller->renderErrors() ?> + +<p class="indent">Coming soon</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |