Problems, need help? Have a tip or advice? Post it here.
70 posts Page 1 of 7
Previous 1, 2, 3, 4, 5 ... 7 Next
Im having a edit page on front end and have here a repeatble function like this.

Code: Select all
    <cms:repeatable name='timebruk' >
        <cms:editable name="fullname"
        label="Velg ansatt"
        data-bind=""opt_values='list_users.html'
        dynamic='opt_values'
        type='dropdown'       
    />
    <cms:editable type='text' name='timer' label='Antall timer' />
    <cms:editable type='text' name='month' label='Måned' />
    </cms:repeatable>


But the design is bad and the BUTTON add row is not working.

Any work around here to make the Editable fetch the Repeatble function from adim section.

Attachments

I think you'll find the following thread useful - viewtopic.php?p=17291#p17291
Today i have added the CALENDAR function and added some design and it became nice.

But im having a problem when adding EVENTS.

I added 3 events with different DATES.

When viewing the CALENDAR all event are saved on current date.

I used the CODE from the CORE-CONSEPT

http://docs.couchcms.com/concepts/events-calendar.html

Maybe someone have some idea why this is happening!?

Attachments

Maybe someone have some idea why this is happening!?

Difficult to say without taking a look at your code.
Could you please post it here?
Code: Select all
<?php require_once( '../admin/cms.php' );
include 'header.php';
?>

<cms:template title='Ferie Kalender' hidden='0' access_level='7' clonable='1' >

    <!-- this is secured page. login first to access it -->
    <cms:if k_logged_out >
        <cms:redirect "<cms:login_link />" />
    </cms:if>

    <cms:editable name='desc' label='Description' type='textarea' />
    <cms:editable name='location' label='Location' type='text' />

    <cms:editable name="start_time" label="Time From (24 Hrs)"
                  opt_values=' Unspecified |
                  00:00 | 00:30 | 01:00 | 01:30 | 02:00 | 02:30 | 03:00 | 03:30 |
                  04:00 | 04:30 | 05:00 | 05:30 | 06:00 | 06:30 | 07:00 | 07:30 |
                  08:00 | 08:30 | 09:00 | 09:30 | 10:00 | 10:30 | 11:00 | 11:30 |
                  12:00 | 12:30 | 13:00 | 13:30 | 14:00 | 14:30 | 15:00 | 15:30 |
                  16:00 | 16:30 | 17:00 | 17:30 | 18:00 | 18:30 | 19:00 | 19:30 |
                  20:00 | 20:30 | 21:00 | 21:30 | 22:00 | 22:30 | 23:00 | 23:30 |'
                  type='dropdown'
                  />

    <cms:editable name="end_time" label="Time Until (24 Hrs)"
                  opt_values=' Unspecified |
                  00:00 | 00:30 | 01:00 | 01:30 | 02:00 | 02:30 | 03:00 | 03:30 |
                  04:00 | 04:30 | 05:00 | 05:30 | 06:00 | 06:30 | 07:00 | 07:30 |
                  08:00 | 08:30 | 09:00 | 09:30 | 10:00 | 10:30 | 11:00 | 11:30 |
                  12:00 | 12:30 | 13:00 | 13:30 | 14:00 | 14:30 | 15:00 | 15:30 |
                  16:00 | 16:30 | 17:00 | 17:30 | 18:00 | 18:30 | 19:00 | 19:30 |
                  20:00 | 20:30 | 21:00 | 21:30 | 22:00 | 22:30 | 23:00 | 23:30 |'
                  type='dropdown'
                  />

    <cms:editable name='end_date'
                  label='Event End Date (if multi-days event)'
                  desc='Enter date in yyyy-mm-dd format e.g. 2010-12-31'
                  type='text'
                  validator='regex=/(?:19|20)\d\d-(?:0[1-9]|1[012])-(?:0[1-9]|[12][0-9]|3[01])/'
                  separator='#'
                  validator_msg='regex=Incorrect date format'
                  />

</cms:template>
<div class="container body">
    <div class="main_container">
        <div class="col-md-3 left_col">

<?php include ('menu.php'); ?>

            <!-- page content -->
            <div class="right_col" role="main">
                <div class="">
                    <div class="clearfix"></div>                                       
                    <div class="row">                   
                        <div class="col-md-12 col-sm-12 col-xs-12">
                            <div class="x_panel">
                                <div class="x_title">
                                    <h2>Ferie Kalender</h2>
                                    <ul class="nav navbar-right panel_toolbox">
                                        <li>
                                            <a href="#"><i class="fa fa-chevron-up"></i></a>
                                        </li>
                                        <li class="dropdown">
                                            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>

                                            <ul class="dropdown-menu" role="menu">
                                                <li><a href="ferie-add.php">Registrer ferie</a></li>
                                            </ul>
                                        </li>
                                        <li>
                                            <a href="#" class=""><i onclick="myFunction()" class="fa fa-print"></i></a>
                                            <script>
                                                function myFunction() {
                                                    window.print();
                                                }
                                            </script>
                                        </li>
                                    </ul>

                                    <div class="clearfix"></div>

                                </div>

                                <div class="x_content">   
                                    <div id='calendar'></div>   
                                    <cms:if k_is_page >
                                        <!-- Page View -->
                                        <b>Tittel:</b> <cms:show k_page_title /><br>
                                        <b>Navn:</b> <cms:show fullname /><br>
                                        <b>Beskrivelse:</b> <cms:show desc /><br>
                                        <b>Hvor skal du reise:</b> <cms:show location /><br>
                                        <b>Første ferie dag:</b> <cms:date end_date format='d.m.Y' /><br>
                                        <b>Siste ferie dag:</b> <cms:date last_date format='d.m.Y' /><br>


                                        <cms:else />
                                        <!-- List view -->
                                        <cms:calendar date="<cms:gpc 'cal' />" masterpage=k_template_name show_future_entries='1' >
                                            <div class="fc fc-ltr fc-unthemed">
                                                <div class="fc-toolbar">
                                                    <div class="fc-left">
                                                        <div class="fc-button-group">
                                                            <button type="button" class="fc-prev-button fc-button fc-state-default fc-corner-left">
                                                                <a href="<cms:concat k_page_link '?cal=' k_prev_calendar_date />"><span class="fc-icon fc-icon-left-single-arrow"></span></a></button>
                                                            <button type="button" class="fc-next-button fc-button fc-state-default fc-corner-right">
                                                                <a href="<cms:concat k_page_link '?cal=' k_next_calendar_date />"><span class="fc-icon fc-icon-right-single-arrow"></span></a></button>
                                                        </div>                       
                                                        <button type="button" class="fc-today-button fc-button fc-state-default fc-corner-left fc-corner-right fc-state-disabled" disabled="disabled">I Dag</button>                       
                                                    </div>
                                                    <div class="fc-right">
                                                        <div class="fc-button-group">
                                                            <button type="button" class="fc-month-button fc-button fc-state-default fc-corner-left fc-state-active">måned</button>
                                                            <button type="button" class="fc-agendaWeek-button fc-button fc-state-default">uke</button>
                                                            <button type="button" class="fc-agendaDay-button fc-button fc-state-default fc-corner-right">dag</button>
                                                        </div>
                                                    </div>                       
                                                    <div class="fc-center">   
                                                        <h2><cms:date k_calendar_date format='%B %Y' locale='Norwegian' /></h2>
                                                    </div>
                                                    <div class="fc-clear"></div>
                                                </div>
                                                <div class="fc-view-container">
                                                    <div class="fc-view fc-month-view fc-basic-view">
                                                        <table>
                                                            <thead>
                                                                <tr>
                                                                    <td class="fc-widget-header">
                                                                        <div class="fc-row fc-widget-header">
                                                                            <table>
                                                                                <thead>
                                                                                    <tr><cms:repeat count='7'>
                                                                                    <th class="fc-day-header fc-widget-header fc-sun">

                                                                                    <cms:zebra 'Søndag' 'Mandag' 'Tirsdag' 'Onsdag' 'Torsdag' 'Fredag' 'Lørdag'/>

                                                                                    </th></cms:repeat>
                                                                                </tr>
                                                                                </thead>
                                                                            </table>
                                                                        </div>
                                                                    </td>
                                                                </tr>
                                                            </thead>
                                                            <tbody>
                                                                <tr>
                                                                    <td class="fc-widget-content">
                                                                        <div class="fc-day-grid-container">
                                                                            <div class="fc-day-grid"><cms:weeks>
                                                                                    <div class="fc-row fc-week fc-widget-content" style="height: 123px;">
                                                                                        <div class="fc-bg">
                                                                                            <table>
                                                                                                <tbody>
                                                                                                    <tr>
                                                                                                <cms:days >
                                                                                                    <cms:if k_timeline_position='present'>
                                                                                                        <cms:set tdclass='today' />
                                                                                                        <cms:else />
                                                                                                        <cms:set tdclass='' />
                                                                                                    </cms:if>

                                                                                                    <cms:if k_position='current_month' >
                                                                                                        <cms:if k_count_entries >
                                                                                                            <td class='fc-day fc-widget-content fc-fri fc-today fc-state-highlight'>
                                                                                                                <a href="#"><cms:show k_day /></a>

                                                                                                            <cms:entries limit='3' skip_custom_fields='0'>

                                                                                                                <a href="<cms:show k_page_link />"class="fc-day-grid-event fc-event fc-start fc-end fc-draggable">
                                                                                                                    <div class="fc-content">
                                                                                                                        <span class="fc-time"><cms:show k_page_title /></span>
                                                                                                                        <span class="fc-title"><cms:show fullname /></span>
                                                                                                                    </div>
                                                                                                                </a>

                                                                                                            </cms:entries>

                                                                                                            </td>
                                                                                                            <cms:else />
                                                                                                            <td class="fc-day fc-widget-content fc-sat fc-other-month fc-future" ><cms:show k_day /></td>
                                                                                                        </cms:if>
                                                                                                        <cms:else />
                                                                                                        <td class="fc-day fc-widget-content fc-sat fc-other-month fc-future"><cms:show k_day /></td>
                                                                                                    </cms:if>
                                                                                                </cms:days>                                                                   

                                                                                                </tr>
                                                                                                </tbody>
                                                                                            </table>
                                                                                        </div>                                                   
                                                                                    </div>
                                                                            </div></cms:weeks>
                                                                        </div>
                                                                    </td>
                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                    </div>
                                                </div>

                                        </cms:calendar>
                                    </cms:if>
                                </div>
                            </div>
                        </div>                   

                        <div class="clearfix"></div>

                    </div>

                </div>

            </div>
            <!-- /page content -->
        </div>

    </div>
    <div id="custom_notifications" class="custom-notifications dsp_none">
        <ul class="list-unstyled notifications clearfix" data-tabbed_notifications="notif-group">
        </ul>
        <div class="clearfix"></div>
        <div id="notif-group" class="tabbed_notifications"></div>
    </div>

    <script src="js/bootstrap.min.js"></script>

    <!-- chart js -->
    <script src="js/chartjs/chart.min.js"></script>
    <!-- bootstrap progress js -->
    <script src="js/progressbar/bootstrap-progressbar.min.js"></script>
    <script src="js/nicescroll/jquery.nicescroll.min.js"></script>
    <!-- icheck -->
    <script src="js/icheck/icheck.min.js"></script>
    <script src="js/custom.js"></script>
    <!-- daterangepicker -->
    <script type="text/javascript" src="js/moment.min2.js"></script>
    <script type="text/javascript" src="js/datepicker/daterangepicker.js"></script>
    <!-- input mask -->
    <script src="js/input_mask/jquery.inputmask.js"></script>
    <!-- knob -->
    <script src="js/knob/jquery.knob.min.js"></script>
    <!-- range slider -->
    <script src="js/ion_range/ion.rangeSlider.min.js"></script>
    <!-- color picker -->
    <script src="js/colorpicker/bootstrap-colorpicker.js"></script>
    <script src="js/colorpicker/docs.js"></script>

    <!-- image cropping -->
    <script src="js/cropping/cropper.min.js"></script>
    <script src="js/cropping/main2.js"></script>



    <script type="text/javascript">
                                                $(document).ready(function () {
                                                    $('#f_birthday').daterangepicker({
                                                        singleDatePicker: true,
                                                        calender_style: "picker_4"
                                                    }, function (start, end, label) {
                                                        console.log(start.toISOString(), end.toISOString(), label);
                                                    });
                                                    $('#f_last_time').daterangepicker({
                                                        singleDatePicker: true,
                                                        calender_style: "picker_4"
                                                    }, function (start, end, label) {
                                                        console.log(start.toISOString(), end.toISOString(), label);
                                                    });
                                                    $('#f_start_date').daterangepicker({
                                                        singleDatePicker: true,
                                                        calender_style: "picker_4"
                                                    }, function (start, end, label) {
                                                        console.log(start.toISOString(), end.toISOString(), label);
                                                    });
                                                });
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#reservation').daterangepicker(null, function (start, end, label) {
                console.log(start.toISOString(), end.toISOString(), label);
            });
        });
    </script>
    <!-- /datepicker -->

</body>

</html>
<?php COUCH::invoke(); ?>
New question - Save to FOLDER with DB form

Problem: the form gets saved but NOT to the folder selected from dropdown!

I made a template - hoursheet.php and template hoursheet-new.php

In hours-add.php i have a form with a dropdown showing all the folders made with dynamic folders in admin.

To show folders in dropdown i used this technic:

Code: Select all
        <cms:editable name="month"
                  label="Velg måned"
                  data-bind=""opt_values='my_folder_listing.html'
                  dynamic='opt_values'
                  type='dropdown'       
                  />

And i have this is 'my_folder_listing.html'
Code: Select all
Velg måned=-
<cms:folders masterpage='users/hoursheet-new.php'>
    | <cms:show k_folder_title  /> = <cms:show k_folder_name />
</cms:folders>


And my FORM code in hoursheet-new.php

Code: Select all
    <cms:form
masterpage=k_template_name
mode='create'
enctype='multipart/form-data'
method='post'
anchor='0'
>

<cms:if k_success >

<cms:db_persist_form
_invalidate_cache='0'
_auto_title='1'
/>

<cms:set_flash name='submit_success' value='1' />
<cms:redirect k_page_link />

</cms:if>

<cms:if k_error >
<div class="error">

<div class="alert alert-danger alert-dismissible fade in" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span></button>

<cms:each k_error >
<cms:show item />
</cms:each>
  </div>

</div>
</cms:if>

<label>Navn:</label>
<cms:input name="fullname" type="bound" class="form-control" />
                                        <br />

<label>Dato:</label><br />
<cms:input name="date" type="bound" class="form-control" />
                                        <br />

<label>Måned:</label>
<cms:input name="month" type="bound" class="form-control" />
                                        <br />

<label>Last opp sykemelding</label>
<cms:input name="vedlegg" type="bound" class="form-control" />
                                        <p>Kun Word eller PDF Dokumenter</p>
                                        <br />

<cms:if "<cms:not submit_success />" >
<button type="submit" class="btn btn-primary">Legg til ny</button>
  </cms:if>

  </cms:form>


Someone have any idea why the form dont save to selected FOLDER?
Code: Select all
<cms:input name="k_page_folder_id" type="bound" />


Use the above will create a drop down list of folders to select, binding the input to the system id for folders. This should do what you desire I believe
Image
Bartonsweb wrote:
Code: Select all
<cms:input name="k_page_folder_id" type="bound" />


Use the above will create a drop down list of folders to select, binding the input to the system id for folders. This should do what you desire I believe


Thanks. That works :)
Question about COUNT!

I have in a clonable page a field called 'lenght' and in this field the user can write any number from 1 - 100.

And i wanna count the value from this field 'lenght' in all the pages made now and in the future and display the total number on my dashboard!

Code:

<cms:pages masterpage='users/nytt-fraver.php' >
<div class="count"><cms:show lenght /></div>
</cms:pages>

I appreciate input :)
I load frameworks and write bugs on top of them, after that I rearrange the code so that it looks like a cool product.
Previous 1, 2, 3, 4, 5 ... 7 Next
70 posts Page 1 of 7