r252703 - in Products.mediaEvent/trunk: . Products/mediaEvent/content Products/mediaEvent/profiles/default docs

"David Jonas Castanheira" <svn-changes-z4DKO/[email protected]> Thu, 12 Dec 2013 11:14:26 +0000 (UTC)
Newsgroups gmane.comp.web.zope.plone.collective.cvs
Message-ID <[email protected]>
Author: davidjonas
Date: Thu Dec 12 11:14:25 2013
New Revision: 252703

Modified:
   Products.mediaEvent/trunk/Products/mediaEvent/content/mediaevent.py
   Products.mediaEvent/trunk/Products/mediaEvent/profiles/default/metadata.xml
   Products.mediaEvent/trunk/docs/HISTORY.txt
   Products.mediaEvent/trunk/setup.py
Log:
Added a new notes field

Modified: Products.mediaEvent/trunk/Products/mediaEvent/content/mediaevent.py
==============================================================================
--- Products.mediaEvent/trunk/Products/mediaEvent/content/mediaevent.py	(original)
+++ Products.mediaEvent/trunk/Products/mediaEvent/content/mediaevent.py	Thu Dec 12 11:14:25 2013
@@ -4,7 +4,7 @@
 
 from Products.Archetypes import atapi
 from Products.ATContentTypes.content import folder
-from Products.ATContentTypes.content import event
+from plone.app.event.at import content  as event
 from Products.ATContentTypes.content import document
 from Products.ATContentTypes.content import schemata
 from Products.Archetypes.atapi import DateTimeField
@@ -13,44 +13,22 @@
 from Products.CMFCore.permissions import ModifyPortalContent, View
 from Products.Archetypes.atapi import CalendarWidget
 from Products.Archetypes.atapi import StringWidget
+from Products.Archetypes.atapi import TextAreaWidget
 from Products.Archetypes.atapi import BooleanWidget
 from Products.ATContentTypes import ATCTMessageFactory as _
+from Products.DataGridField import DataGridField, DataGridWidget
+from Products.DataGridField.Column import Column
 from DateTime.DateTime import *
+from plone.app.event.at.interfaces import IATEvent, IATEventRecurrence
 
 # -*- Message Factory Imported Here -*-
 
 from Products.mediaEvent.interfaces import IMediaEvent
 from Products.mediaEvent.config import PROJECTNAME
 
-MediaEventSchema = folder.ATFolderSchema.copy() + document.ATDocumentSchema.copy() + atapi.Schema((
+MediaEventSchema = folder.ATFolderSchema.copy() + event.ATEventSchema.copy() + atapi.Schema((
 
     # -*- Your Archetypes field definitions here ... -*-
-    DateTimeField('startDate',
-        required=True,
-        searchable=False,
-        accessor='start',
-        write_permission = ModifyPortalContent,
-        default_method = 'getDefaultTime',
-        languageIndependent=True,
-        widget = CalendarWidget(
-              description= '',
-              label=_(u'label_event_start', default=u'Event Starts'),
-              starting_year = 1999
-              )),
-
-    DateTimeField('endDate',
-        required=True,
-        searchable=False,
-        accessor='end',
-        write_permission = ModifyPortalContent,
-        default_method = 'getDefaultTime',
-        languageIndependent=True,
-        widget = CalendarWidget(
-              description = '',
-              label = _(u'label_event_end', default=u'Event Ends'),
-              starting_year = 1999
-              )),
-    
      StringField('exceptions',
         searchable=False,
         write_permission = ModifyPortalContent,
@@ -95,6 +73,17 @@
             label = _(u'label_event_booking', default=u'Booking code / link'),
             default = "",
             )),
+      
+      StringField('notes',
+        searchable=False,
+        required=True,
+        write_permission = ModifyPortalContent,
+        widget = TextAreaWidget(
+            description = 'Include location, capacity, comp allocation requests, an account code & details of split (where relevant), and how people can attend (eg. is it drop-in, free but booking essential, standard ticketing?). Also essential that you give booker info on content/age restrictions/standing/strobes etc.',
+            label = _(u'label_event_notes', default=u'Notes')
+            )),
+      
+      
 ))
 
 # Set storage on fields copied from ATFolderSchema, making sure
@@ -103,15 +92,20 @@
 MediaEventSchema['title'].storage = atapi.AnnotationStorage()
 MediaEventSchema['description'].storage = atapi.AnnotationStorage() 
 MediaEventSchema['text'].storage = atapi.AnnotationStorage()
-MediaEventSchema['startDate'].storage = atapi.AnnotationStorage()
-MediaEventSchema['endDate'].storage = atapi.AnnotationStorage()
 MediaEventSchema['exceptions'].storage = atapi.AnnotationStorage()
 MediaEventSchema['location'].storage = atapi.AnnotationStorage()
+MediaEventSchema['startDate'].storage = atapi.AnnotationStorage()
+MediaEventSchema['endDate'].storage = atapi.AnnotationStorage()
+MediaEventSchema['notes'].storage = atapi.AnnotationStorage()
+
 
 MediaEventSchema.moveField('startDate', before='text')
 MediaEventSchema.moveField('endDate', before='text')
+MediaEventSchema.moveField('wholeDay', after='endDate')
+MediaEventSchema.moveField('recurrence', after='wholeDay')
 MediaEventSchema.moveField('exceptions', before='text')
 
+
 schemata.finalizeATCTSchema(
     MediaEventSchema,
     folderish=True,
@@ -119,25 +113,31 @@
 )
 
 
-class MediaEvent(folder.ATFolder):
+class MediaEvent(folder.ATFolder, event.ATEvent):
     """Event type that has a folderish behaviour to store media related to the event."""
     implements(IMediaEvent)
 
     meta_type = "MediaEvent"
     schema = MediaEventSchema
     schema['relatedItems'].widget.visible['edit'] = 'visible'
-
+    schema['attendees'].widget.visible['edit'] = 'hidden'
+    schema['contactName'].widget.visible['edit'] = 'hidden'
+    schema['contactEmail'].widget.visible['edit'] = 'hidden'
+    schema['contactPhone'].widget.visible['edit'] = 'hidden'
+    schema['eventUrl'].widget.visible['edit'] = 'hidden'
+    #TODO: Set default timezone and hide the widget
+    #schema['timezone'].widget.visible['edit'] = 'hidden'
 
     title = atapi.ATFieldProperty('title')
     description = atapi.ATFieldProperty('description')
     text = atapi.ATFieldProperty('text')
-    startDate = atapi.ATFieldProperty('startDate')
-    endDate = atapi.ATFieldProperty('endDate')
     exceptions = atapi.ATFieldProperty('exceptions')
     location = atapi.ATFieldProperty('location')
+    notes = atapi.ATFieldProperty('notes')
+    
     
     def getDefaultTime(self):
-        return DateTime()
+            return DateTime()
 
     # -*- Your ATSchema to Python Property Bridges Here ... -*-
 

Modified: Products.mediaEvent/trunk/Products/mediaEvent/profiles/default/metadata.xml
==============================================================================
--- Products.mediaEvent/trunk/Products/mediaEvent/profiles/default/metadata.xml	(original)
+++ Products.mediaEvent/trunk/Products/mediaEvent/profiles/default/metadata.xml	Thu Dec 12 11:14:25 2013
@@ -1,4 +1,4 @@
 <?xml version="1.0"?>
 <metadata>
-  <version>0.7</version>
+  <version>0.8</version>
 </metadata>

Modified: Products.mediaEvent/trunk/docs/HISTORY.txt
==============================================================================
--- Products.mediaEvent/trunk/docs/HISTORY.txt	(original)
+++ Products.mediaEvent/trunk/docs/HISTORY.txt	Thu Dec 12 11:14:25 2013
@@ -1,5 +1,9 @@
 Changelog
 =========
+0.8 (2013-12-12)
+---------------------
+- Added a private notes field. 
+
 0.7 (2013-01-30)
 ---------------------
 - Better descriptions and default values.

Modified: Products.mediaEvent/trunk/setup.py
==============================================================================
--- Products.mediaEvent/trunk/setup.py	(original)
+++ Products.mediaEvent/trunk/setup.py	Thu Dec 12 11:14:25 2013
@@ -9,7 +9,7 @@
 def read(*rnames):
     return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
 
-version = '0.7'
+version = '0.8'
 
 long_description = (
     read('README.txt')

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk