Merge branch '2013.10' into 2014.11
[tine20] / tine20 / ExampleApplication / js / ExampleRecordEditDialog.js
1 /*
2  * Tine 2.0
3  * 
4  * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
5  * @author      Cornelius Weiss <c.weiss@metaways.de>
6  * @copyright   Copyright (c) 2007-2012 Metaways Infosystems GmbH (http://www.metaways.de)
7  */
8 Ext.ns('Tine.ExampleApplication');
9
10 /**
11  * @namespace   Tine.ExampleApplication
12  * @class       Tine.ExampleApplication.ExampleRecordEditDialog
13  * @extends     Tine.widgets.dialog.EditDialog
14  * 
15  * <p>ExampleRecord Compose Dialog</p>
16  * <p></p>
17  * 
18  *  @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
19  * @author      Cornelius Weiss <c.weiss@metaways.de>
20  * @copyright   Copyright (c) 2007-2008 Metaways Infosystems GmbH (http://www.metaways.de)
21  * 
22  * @param       {Object} config
23  * @constructor
24  * Create a new Tine.ExampleApplication.ExampleRecordEditDialog
25  */
26 Tine.ExampleApplication.ExampleRecordEditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
27     /**
28      * @private
29      */
30     tbarItems: [{xtype: 'widget-activitiesaddbutton'}],
31     windowHeight: 470,
32     windowWidth: 800,
33     
34     /**
35      * returns dialog
36      * 
37      * NOTE: when this method gets called, all initalisation is done.
38      * 
39      * @return {Object}
40      * @private
41      */
42     getFormItems: function() {
43         return {
44             xtype: 'tabpanel',
45             border: false,
46             plain:true,
47             activeTab: 0,
48             border: false,
49             items:[{
50                 title: this.app.i18n._('ExampleRecord'),
51                 autoScroll: true,
52                 border: false,
53                 frame: true,
54                 layout: 'border',
55                 items: [{
56                     region: 'center',
57                     xtype: 'columnform',
58                     labelAlign: 'top',
59                     formDefaults: {
60                         xtype:'textfield',
61                         anchor: '100%',
62                         labelSeparator: '',
63                         columnWidth: .333
64                     },
65                     items: [[{
66                         columnWidth: 1,
67                         fieldLabel: this.app.i18n._('Name'),
68                         name: 'name',
69                         allowBlank: false
70                         }], [new Tine.Tinebase.widgets.keyfield.ComboBox({
71                             app: 'ExampleApplication',
72                             keyFieldName: 'exampleStatus',
73                             fieldLabel: this.app.i18n._('Status'),
74                             name: 'status',
75                             columnWidth: 0.5
76                         })]
77                     ] 
78                 }, {
79                     // activities and tags
80                     layout: 'accordion',
81                     animate: true,
82                     region: 'east',
83                     width: 210,
84                     split: true,
85                     collapsible: true,
86                     collapseMode: 'mini',
87                     header: false,
88                     margins: '0 5 0 5',
89                     border: true,
90                     items: [
91                     new Tine.widgets.activities.ActivitiesPanel({
92                         app: 'ExampleApplication',
93                         showAddNoteForm: false,
94                         border: false,
95                         bodyStyle: 'border:1px solid #B5B8C8;'
96                     }),
97                     new Tine.widgets.tags.TagPanel({
98                         app: 'ExampleApplication',
99                         border: false,
100                         bodyStyle: 'border:1px solid #B5B8C8;'
101                     })]
102                 }]
103             }, new Tine.widgets.activities.ActivitiesTabPanel({
104                 app: this.appName,
105                 record_id: this.record.id,
106                 record_model: this.appName + '_Model_' + this.recordClass.getMeta('modelName')
107             })]
108         };
109     }
110 });