File indexing completed on 2024-06-23 05:51:18

0001 <?php 
0002 /**
0003  *  ocs-webserver
0004  *
0005  *  Copyright 2016 by pling GmbH.
0006  *
0007  *    This file is part of ocs-webserver.
0008  *
0009  *    This program is free software: you can redistribute it and/or modify
0010  *    it under the terms of the GNU Affero General Public License as
0011  *    published by the Free Software Foundation, either version 3 of the
0012  *    License, or (at your option) any later version.
0013  *
0014  *    This program is distributed in the hope that it will be useful,
0015  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
0016  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017  *    GNU Affero General Public License for more details.
0018  *
0019  *    You should have received a copy of the GNU Affero General Public License
0020  *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
0021  **/
0022 
0023 ?>
0024 
0025 <div class="messages">
0026     <?php foreach (Zend_Controller_Action_HelperBroker::getStaticHelper('flashMessenger')
0027                        ->getCurrentMessages() as $message) : ?>
0028         <p><?php echo $this->escape($message); ?></p>
0029     <?php endforeach; ?>
0030 </div>
0031 <div id="TableContainer"></div>
0032 
0033 
0034 <script type="text/javascript">
0035     $(document).ready(function () {
0036         $('#TableContainer').jtable({
0037             jqueryuiTheme: true,
0038             paging: true,
0039             sorting: true,
0040             defaultSorting: 'order asc',
0041             title: 'Table of Sponsors',
0042             actions: {
0043                 listAction: '/backend/browselisttype/list',
0044                 createAction: '/backend/browselisttype/create',
0045                 updateAction: function (postData) {
0046                     return $.Deferred(function ($dfd) {
0047                         $.ajax({
0048                             url: '/backend/browselisttype/update',
0049                             type: 'POST',
0050                             dataType: 'json',
0051                             data: postData,
0052                             success: function (data) {
0053                                 $dfd.resolve(data);
0054                                 $('#TableContainer').jtable('reload');
0055                             },
0056                             error: function () {
0057                                 $dfd.reject();
0058                             }
0059                         });
0060                     });
0061                 },
0062                 deleteAction: '/backend/browselisttype/delete'
0063             },
0064             fields: {
0065                 browse_list_type_id: {
0066                     key: true,
0067                     create: false,
0068                     edit: false,
0069                     list: true,
0070                     title: 'Id',
0071                     width: '5%',
0072                 },
0073                 name: {
0074                     title: 'Name',
0075                     width: '10%',
0076                     list: true,
0077                     create: true
0078                 },
0079                 desc: {
0080                     title: 'Description',
0081                     width: '20%',
0082                     list: true,
0083                     create: true
0084                 },
0085                 render_page_name: {
0086                     title: 'View-Page',
0087                     width: '20%',
0088                     list: true,
0089                     create: true
0090                 },
0091                 is_active: {
0092                     title: 'Is active',
0093                     width: '5%',
0094                     type: 'checkbox',
0095                     values: { '0': 'No', '1': 'Yes' },
0096                     defaultValue: '1',
0097                 }
0098             }
0099 
0100             
0101         });
0102 
0103         $('#TableContainer').jtable('load');
0104     });
0105 </script>