/*
 * Author       : actoverbooked
 * Generated on : 22-Nov-2009 17:08:32
 * Version      : 3.0
 */
application "Author Connections"
{
    type = public
    allow html = true
    date format = "dd-MMM-yyyy"
    time zone = "America/Los_Angeles"
    section Author_Connections_View
    {
        displayname = "Author Connections View"
        summary  Overbooked_Author_Connections
        {
            displayname = "Overbooked Author Connections"
            show  all  rows  from  Author_Connections_Form 
            (
                Author
                Title
                Date_field as "Date"
                Text as "$"
                ISBN
                Publisher
                Added
                Description
                Genre
                Additional_Information as "Additional Information"
                Contact as "Email"
                web_site as "Web Site"
            )
            filters 
            (
                Date_field
                Added
                Genre
            )
            permission
            (
                add = true
                edit = true
                delete = true
            )
        }

    }

    section Author_Connections_Form
    {
        displayname = "Author Connections Form"
        form  Author_Connections_Form
        {
            displayname  =  "Author Connections Form"
            success message  =  "Author Connection added. Thanks for your interest in Overbooked."
            
            Author
            (
                type  =  textarea
                width  =  5 , 25
                tooltip  =  "Web application"
            )

            Title
            (
                type  =  textarea
                width  =  5 , 25
                tooltip  =  "Web application"
            )

            Date_field
            (
                displayname  =  "Published"
                type  =  date
                tooltip  =  "Web application"
            )

            Text
            (
                displayname  =  "$"
                type  =  text
                width  =  25
                tooltip  =  "Web application"
            )

            ISBN
            (
                type  =  text
                width  =  25
                tooltip  =  "Web application"
            )

            Publisher
            (
                type  =  textarea
                width  =  5 , 25
                tooltip  =  "Web application"
            )

            Added
            (
                displayname  =  "Entry Added"
                type  =  date
                tooltip  =  "Web application"
            )

            Description
            (
                type  =  textarea
                width  =  5 , 25
                tooltip  =  "Web application"
            )

            Genre
            (
                type  =  picklist
                values  =  {"Fiction",   "Nonfiction"}
            )

            Additional_Information
            (
                displayname  =  "Additional Information"
                type  =  textarea
                width  =  5 , 25
                tooltip  =  "Web application"
            )

            Contact
            (
                type  =  email
            )

            web_site
            (
                displayname  =  "Web Site"
                type  =  textarea
            )

            actions
            {
                on add
                {
                    Submit
                    (
                        type  =  submit
                        displayname  =  "Submit"
                        on success
                        {
                            sendmail
                            (
                                To       :  "ann@overbooked.com" 
                                From     :  zoho.adminuserid 
                                Subject  :  "ZOHO Overbooked Author Connections" 
                                Message  :  "" + input.formdata 
                            )
                        }
                    )
                    Reset
                    (
                        type  =  reset
                        displayname  =  "Reset"
                    )
                }
                on edit
                {
                    Update
                    (
                        type  =  submit
                        displayname  =  "Update"
                    )
                    Cancel
                    (
                        type  =  cancel
                        displayname  =  "Cancel"
                    )
                }
            }
        }

    }

}
