Skip to content

Commit

Permalink
first commit of civi auctions
Browse files Browse the repository at this point in the history
  • Loading branch information
Donald Lobo committed Jan 14, 2009
1 parent aa0fb20 commit 5713179
Show file tree
Hide file tree
Showing 9 changed files with 607 additions and 4 deletions.
102 changes: 102 additions & 0 deletions CRM/Auction/Info.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<?php

/*
+--------------------------------------------------------------------+
| CiviCRM version 2.3 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2009 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| CiviCRM is free software; you can copy, modify, and distribute it |
| under the terms of the GNU Affero General Public License |
| Version 3, 19 November 2007. |
| |
| CiviCRM is distributed in the hope that it will be useful, but |
| WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| See the GNU Affero General Public License for more details. |
| |
| You should have received a copy of the GNU Affero General Public |
| License along with this program; if not, contact CiviCRM LLC |
| at info[AT]civicrm[DOT]org. If you have questions about the |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/

require_once 'CRM/Core/Component/Info.php';

/**
* This class introduces component to the system and provides all the
* information about it. It needs to extend CRM_Core_Component_Info
* abstract class.
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2009
* $Id$
* */
class CRM_Auction_Info extends CRM_Core_Component_Info
{

// docs inherited from interface
protected $keyword = 'auction';

// docs inherited from interface
public function getInfo()
{
return array( 'name' => 'CiviAuction',
'translatedName' => ts('CiviAuction'),
'title' => ts('CiviCRM Auctions'),
'search' => 0,
'showActivitiesInCore' => 0
);
}


// docs inherited from interface
public function getPermissions()
{
return array( 'access CiviAuction',
'add auction items',
'approve auction items',
'bid on auction items', );
}

// docs inherited from interface
public function getUserDashboardElement()
{
return array( 'name' => ts( 'Auctions' ),
'title' => ts( 'Your Winning Auction Item(s)' ),
'perm' => array( 'bid on auction items' ),
'weight' => 20 );
}

// docs inherited from interface
public function registerTab()
{
return array( 'title' => ts( 'Auctions' ),
'id' => 'auction',
'url' => 'auction',
'weight' => 40 );
}

// docs inherited from interface
public function registerAdvancedSearchPane()
{
return array( 'title' => ts( 'Auctions' ),
'weight' => 40 );
}

// docs inherited from interface
public function getActivityTypes()
{
$types = array();
return $types;
}





}
74 changes: 74 additions & 0 deletions CRM/Auction/xml/Menu/Auction.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="iso-8859-1" ?>

<menu>
<item>
<path>civicrm/auction</path>
<title>CiviAuction</title>
<page_callback>CRM_Auction_Page_DashBoard</page_callback>
<access_arguments>access CiviAuction</access_arguments>
<page_type>1</page_type>
<weight>1000</weight>
<component>CiviAuction</component>
</item>
<item>
<path>civicrm/auction/info</path>
<page_callback>CRM_Auction_Page_AuctionInfo</page_callback>
<title>Auction Information</title>
<access_callback>1</access_callback>
<is_public>true</is_public>
</item>
<item>
<path>civicrm/auction/item</path>
<title>Auction Item</title>
<page_callback>CRM_Auction_Page_Item</page_callback>
<access_callback>1</access_callback>
<is_public>true</is_public>
<is_ssl>true</is_ssl>
</item>
<item>
<path>civicrm/admin/auction</path>
<title>Manage Auctions</title>
<page_callback>CRM_Auction_Page_Manage</page_callback>
<desc>Create and edit auction configuration including times.</desc>
<access_arguments>access CiviAuction</access_arguments>
<adminGroup>CiviAuction</adminGroup>
<icon>admin/small/auction_manage.png</icon>
<weight>370</weight>
</item>
<item>
<path>civicrm/admin/options/auction_type</path>
<title>Auction Types</title>
<page_callback>CRM_Admin_Page_Options</page_callback>
<desc>Use Auction Types to categorize your auction items.</desc>
<path_arguments>group=auction_type</path_arguments>
<access_arguments>administer CiviCRM,access CiviAuction</access_arguments>
<adminGroup>CiviAuction</adminGroup>
<icon>admin/small/auction_type.png</icon>
<weight>375</weight>
</item>
<item>
<path>civicrm/auction/search</path>
<title>Find Auction Items</title>
<page_callback>CRM_Auction_Controller_Search</page_callback>
<access_arguments>access CiviAuction</access_arguments>
<page_type>1</page_type>
<weight>1010</weight>
</item>
<item>
<path>civicrm/auction/manage</path>
<title>Manage Auctions</title>
<page_callback>CRM_Auction_Page_Manage</page_callback>
<access_arguments>access CiviAuction</access_arguments>
<page_type>1</page_type>
<weight>1020</weight>
</item>
<item>
<path>civicrm/auction/add</path>
<path_arguments>action=add</path_arguments>
<title>New Auction</title>
<page_callback>CRM_Auction_Page_ManageAuction</page_callback>
<access_arguments>access CiviAuction</access_arguments>
<page_type>1</page_type>
<weight>1030</weight>
</item>
</menu>
115 changes: 115 additions & 0 deletions xml/schema/Auction/Auction.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="iso-8859-1" ?>

<table>
<base>CRM/Auction</base>
<class>Auction</class>
<name>civicrm_auction</name>
<add>2.3</add>
<field>
<name>id</name>
<type>int unsigned</type>
<required>true</required>
<comment>Auction ID</comment>
<add>2.3</add>
</field>
<primaryKey>
<name>id</name>
<autoincrement>true</autoincrement>
</primaryKey>
<field>
<name>title</name>
<uniqueName>auction_title</uniqueName>
<type>varchar</type>
<import>true</import>
<title>Auction Title</title>
<length>255</length>
<localizable>true</localizable>
<comment>Auction Title (e.g. Fall Auction Dinner)</comment>
<add>2.3</add>
</field>
<field>
<name>description</name>
<type>text</type>
<uniqueName>auction_description</uniqueName>
<title>Auction Description</title>
<htmlType>textarea</htmlType>
<rows>8</rows>
<cols>60</cols>
<localizable>true</localizable>
<comment>Full description of auction. Text and html allowed.</comment>
<add>2.3</add>
</field>
<field>
<name>start_date</name>
<type>datetime</type>
<uniqueName>auction_start_date</uniqueName>
<title>Auction Start Date</title>
<comment>Date and time the auction starts.</comment>
<add>2.3</add>
</field>
<field>
<name>end_date</name>
<type>datetime</type>
<uniqueName>auction_end_date</uniqueName>
<title>Auction End Date</title>
<comment>Date and time the auction ends. May be NULL if no defined end date/time</comment>
<add>2.3</add>
</field>
<field>
<name>item_start_date</name>
<type>datetime</type>
<title>Item registration Start Date</title>
<comment>Date and time that users can add item.</comment>
<add>2.3</add>
</field>
<field>
<name>item_end_date</name>
<type>datetime</type>
<title>Item registration End Date</title>
<comment>Date and time that item registration ends. May be NULL if no defined end date/time</comment>
<add>2.3</add>
</field>
<field>
<name>is_item_approval</name>
<type>boolean</type>
<title>Do items need to be approved?</title>
<default>0</default>
<comment>If true all items needs to be approved before appearing on the auction pages.</comment>
<add>2.3</add>
</field>
<field>
<name>is_item_groups</name>
<type>boolean</type>
<title>Can items be grouped?</title>
<default>0</default>
<comment>If true multiple items can be consolidated into one item group.</comment>
<add>2.3</add>
</field>
<field>
<name>max_items</name>
<type>int unsigned</type>
<title>Max Auction items</title>
<default>NULL</default>
<comment>Maximum number of items that can be added to the auction.</comment>
<add>2.3</add>
</field>
<field>
<name>event_id</name>
<type>int unsigned</type>
<comment>Event this auction is linked to</comment>
<add>2.3</add>
</field>
<foreignKey>
<name>event_id</name>
<table>civicrm_event</table>
<key>id</key>
<onDelete>SET NULL</onDelete>
</foreignKey>
<field>
<name>is_active</name>
<type>boolean</type>
<default>0</default>
<comment>Is this Auction enabled or disabled/cancelled?</comment>
<add>2.3</add>
</field>
</table>
87 changes: 87 additions & 0 deletions xml/schema/Auction/Bid.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="iso-8859-1" ?>

<table>
<base>CRM/Auction</base>
<class>Bid</class>
<name>civicrm_auction_bid</name>
<comment>auction item bids.</comment>
<add>2.3</add>
<field>
<name>id</name>
<type>int unsigned</type>
<required>true</required>
<comment>primary key</comment>
<add>2.3</add>
</field>
<primaryKey>
<name>id</name>
<autoincrement>true</autoincrement>
</primaryKey>
<field>
<name>contact_id</name>
<type>int unsigned</type>
<required>true</required>
<comment>FK to civicrm_contact, who bid on this item</comment>
<add>2.3</add>
</field>
<foreignKey>
<name>contact_id</name>
<table>civicrm_contact</table>
<key>id</key>
<add>2.3</add>
<onDelete>CASCADE</onDelete>
</foreignKey>
<field>
<name>auction_item_id</name>
<type>int unsigned</type>
<required>true</required>
<comment>FK to civicrm_auction_item</comment>
<add>2.3</add>
</field>
<foreignKey>
<name>auction_item_id</name>
<table>civicrm_auction_item</table>
<key>id</key>
<add>2.3</add>
<onDelete>CASCADE</onDelete>
</foreignKey>
<field>
<name>bid_value</name>
<title>Price</title>
<type>decimal</type>
<comment>Amount bid per item.</comment>
<add>2.3</add>
</field>
<field>
<name>quantity</name>
<type>int unsigned</type>
<comment>Number of items bid on.</comment>
<add>2.3</add>
</field>
<field>
<name>bid_date</name>
<type>datetime</type>
<comment>Date and time the bid was made.</comment>
<add>2.3</add>
</field>
<field>
<name>is_active</name>
<type>boolean</type>
<default>0</default>
<comment>Is this bid active or disabled/cancelled?</comment>
<add>2.3</add>
</field>
<field>
<name>is_winner</name>
<type>boolean</type>
<default>0</default>
<comment>Is this bid the winning bid</comment>
<add>2.3</add>
</field>
<field>
<name>quantity_won</name>
<type>int unsigned</type>
<comment>Number of items this bid won.</comment>
<add>2.3</add>
</field>
</table>
Loading

0 comments on commit 5713179

Please sign in to comment.