<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="layout" content="main" />
    <title>Start</title>
    <nav:resources override="true"/>
    <resource:tabView skin="tabviewCustom" />
    <resource:dateChooser />
</head>
    <body>
        <div class="nav">
            <nav:renderSubItems group="nav"/>
        </div>
        <div class="body">
            <g:render template="/shared/messages" />
            <g:hasErrors bean="${appCore}">
                <div class="errors">
                    <g:renderErrors bean="${appCore}" as="list" />
                </div>
            </g:hasErrors>

            <richui:tabView id="tabView">

                <richui:tabLabels>
                    <richui:tabLabel selected="${showTab.quickLinks}" title="Quick Links" />
                    <richui:tabLabel selected="${showTab.reports}" title="Reports" />
                    <richui:tabLabel selected="${showTab.Options}" title="Options" />
                    <richui:tabLabel selected="${showTab.about}" title="About" />
                </richui:tabLabels>

                <richui:tabContents>

<!-- Tasks tab -->
                    <richui:tabContent>
                        <br />
                        <br />
                        <div class="dialog">
                            <table>
                                <tbody>

                                    <tr class="prop">
                                        <td valign="top" class="name">
                                            <label>My Tasks:</label>
                                        </td>
                                        <td valign="top" class="value">
                                            <g:link controller="taskDetailed"
                                                            action="search"
                                                            params="[quickSearch: 'myTodays']">
                                                            Today
                                            </g:link>
                                        </td>
                                    </tr>
            
                                    <tr class="prop">
                                        <td valign="top" class="name">
                                            <label>All Tasks:</label>
                                        </td>
                                        <td valign="top" class="value">
                                            <g:link controller="taskDetailed" 
                                                            action="search"
                                                            params="[quickSearch: 'pastWeek']">
                                                            Past Week
                                            </g:link>
                                            <br />
                                            <g:link controller="taskDetailed" 
                                                            action="searchCalendar"
                                                            params="[quickSearch: 'searchPlannersRange']">
                                                            Calendar
                                            </g:link>
                                        </td>
                                    </tr>

<!--                                    More Quick Links:
                                    Open Tasks
                                    Closed Tasks
                                    Tasks I lead.
                                    Week calender
                                    Recent
                                    Today's Entries
                                    My Entries.
                                    Date ranges-->

                                </tbody>
                            </table>
                        </div> <!--End dialog-->
                    </richui:tabContent>
<!-- End Tasks tab -->

<!-- Reports tab -->
                    <richui:tabContent>
                        <br />
                        <br />
                        <div class="dialog">
                            <table>
                                <tbody>

                                    <tr class="prop">
                                        <td valign="top" class="name">
                                            <label>Frequently Used:</label>
                                        </td>
                                        <td valign="top" class="value">
                                            <g:jasperReport controller="report"
                                                                            action="reactiveRatio"
                                                                            jasper="reactiveRatio"
                                                                            name="Reactive Ratio"
                                                                            format="PDF, XLS">
                                                <richui:dateChooser name="startDate" id="reactiveRatio_startDate" format="dd-MM-yyyy" value="${new Date()-7}" />
                                                to
                                                <richui:dateChooser name="endDate" id="reactiveRatio_endDate" format="dd-MM-yyyy" value="${new Date()}" />
                                            </g:jasperReport>
                                            <br />
                                            <g:jasperReport controller="report"
                                                                            action="immediateCallouts"
                                                                            jasper="immediateCallouts"
                                                                            name="Immediate Callouts"
                                                                            format="PDF, XLS">
                                                <richui:dateChooser name="startDate" id="immediateCallouts_startDate" format="dd-MM-yyyy" value="${new Date()-7}" />
                                                to
                                                <richui:dateChooser name="endDate" id="immediateCallouts_endDate" format="dd-MM-yyyy" value="${new Date()}" />
                                            </g:jasperReport>
                                            <br />
                                            <g:jasperReport controller="report"
                                                                            action="stockTakeOverview"
                                                                            jasper="stockTakeOverview"
                                                                            name="Stock Take (Overview)"
                                                                            format="PDF, XLS">
                                                <g:helpBalloon class="helpballoon" code="report.stock.take.overview" />
                                            </g:jasperReport>
                                            <br />
                                            <g:jasperReport controller="report"
                                                                            action="stockTakeByLocation"
                                                                            jasper="stockTakeByLocation"
                                                                            name="Stock Take (By Location)"
                                                                            format="PDF, XLS">
                                                <g:textField name="locationString" value="e.g: A1%, C55" />
                                                <g:helpBalloon class="helpballoon" code="report.stock.take.by.location" />
                                            </g:jasperReport>
                                            <br />
                                            <g:jasperReport controller="report"
                                                                            action="templatePortrait"
                                                                            jasper="templatePortrait"
                                                                            name="Template (Portrait)"
                                                                            format="PDF, XLS">
                                                <g:link controller="report" action="downloadTemplate" params="[fileName: 'templatePortrait.jrxml']">
                                                    Download
                                                </g:link>
                                            </g:jasperReport>
                                            <br />
                                            <g:jasperReport controller="report"
                                                                            action="templateLandscape"
                                                                            jasper="templateLandscape"
                                                                            name="Template (Landscape)"
                                                                            format="PDF, XLS">
                                                <g:link controller="report" action="downloadTemplate" params="[fileName: 'templateLandscape.jrxml']">
                                                    Download
                                                </g:link>
                                            </g:jasperReport>
                                            <br />
                                        </td>
                                    </tr>

                                    <tr class="prop">
                                        <td valign="top" class="name">
                                            <label>Assets:</label>
                                        </td>
                                        <td valign="top" class="value">
                                            <g:link controller="report" action="equipmentRegisterOhsGsp">
                                                Equipment Register (OH&amp;S)
                                            </g:link>
                                            <br />
                                            <br />
                                            <g:link controller="report" action="regulatoryRequirementsGsp">
                                                <img  src="${resource(dir:'images/skin',file:'script_lightning.png')}" alt="Regulatory Requirement" title="Regulatory Requirement" />
                                                Regulatory Requirements
                                            </g:link>
                                            <br />
                                            <br />
                                            <g:link controller="report" action="mandatoryRequirementsGsp">
                                                <img  src="${resource(dir:'images/skin',file:'script.png')}" alt="Mandatory Requirement" title="Mandatory Requirement" />
                                                Mandatory Requirements
                                            </g:link>
                                            <br />
                                            <br />
                                            <g:jasperReport controller="report"
                                                                            action="equipmentRegisterFinancial"
                                                                            jasper="equipmentRegisterFinancial"
                                                                            name="Equipment Register (Financial)"
                                                                            format="PDF, XLS">
                                                <g:select optionKey="id"
                                                                    from="${sections}"
                                                                    name="section.id">
                                                </g:select>
                                            </g:jasperReport>
                                            <br />
                                            <g:jasperReport controller="report"
                                                                            action="assetRegister"
                                                                            jasper="assetRegister"
                                                                            name="Asset Register"
                                                                            format="PDF, XLS">
                                                <g:select optionKey="id"
                                                                    from="${sections}"
                                                                    name="section.id">
                                                </g:select>
                                            </g:jasperReport>
                                            <br />
                                            <g:jasperReport controller="report"
                                                                            action="assetDetail"
                                                                            jasper="assetDetail"
                                                                            name="Asset Detail"
                                                                            format="PDF, XLS">
                                                <g:select optionKey="id"
                                                                    from="${sections}"
                                                                    name="section.id"
                                                                    noSelection="['all':/${g.message(code:'default.all.select.text')}/]">
                                                </g:select>
                                            </g:jasperReport>
                                            <br />
                                    </tr>

                                    <tr class="prop">
                                        <td valign="top" class="name">
                                            <label>Inventory:</label>
                                        </td>
                                        <td valign="top" class="value">
                                                <g:link controller="report" action="inventoryValueOverviewGsp">
                                                    Total Value (Overview)
                                                </g:link>
                                                <br />
                                                <br />
                                                <g:link controller="report" action="inventoryValueDetailedGsp">
                                                    Detailed Value
                                                </g:link>
                                        </td>
                                    </tr>

                                </tbody>
                            </table>
                        </div> <!--End dialog-->
                    </richui:tabContent>
<!-- End Reports tab  -->

<!-- Options tab -->
                    <richui:tabContent>
                        <br />
                        <br />
                        <div class="dialog">
                            <table>
                                <tbody>

                                    <tr class="prop">
                                        <td valign="top" class="name">
                                            <label>Change:</label>
                                        </td>
                                        <td valign="top" class="value">
                                            <a href="${createLink(action:'changePassword')}"> Password</a>
                                            <br />
                                            <a href="${createLink(action:'changeSessionTimeout')}">Session Timeout</a>
                                        </td>
                                    </tr>

                                </tbody>
                            </table>
                        </div> <!--End dialog-->
                    </richui:tabContent>
<!-- End Options tab -->

<!-- About tab -->
                    <richui:tabContent>
                        <g:render template="/about" />
                    </richui:tabContent>
<!-- End About tab -->

                </richui:tabContents>
            </richui:tabView>

        </div> <!--End body-->
    </body>
</html>
