File indexing completed on 2024-12-29 05:24:41

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 <div class="report-form modal-dialog content-modal">
0024     <div class="modal-content">
0025 
0026         <!-- modal header -->
0027         <div class="modal-header">
0028             <button type="button" class="close report-close" data-dismiss="modal" aria-hidden="true">×</button>
0029             <h3><?= $this->translate('Report This Product') ?></h3>
0030         </div>
0031         <!-- /modal header -->
0032 
0033         <!-- modal body -->
0034 
0035         <?php if ($this->auth->hasIdentity()): ?>
0036             <?php if ($this->form): ?>
0037                 <form class="standard-form form-report partial"
0038                       action="<?= $this->form->getAction(); ?>"
0039                       method="<?= $this->form->getMethod(); ?>"
0040                       data-target="#modal-dialog"
0041                       onsubmit="return false;">
0042                     <div class="modal-body">
0043                         <div class="field">
0044                             <label class="required" for="project_report_category_id">Why do you want to report this
0045                                                                                      project?</label>
0046                             <input type="hidden"
0047                                    name="project_report_category_id"
0048                                    id="project_report_category_id"
0049                                    value="0"
0050                                    label="choose a category"/>
0051 
0052                             <div class="selectbox">
0053                                 <div class="selectbox_select">
0054                                     <span class="selectbox_selected" data-option="0">Choose a Category</span>
0055                                     <a class="selectbox_button"></a>
0056                                 </div>
0057 
0058                                 <div class="selectbox_menu">
0059                                     <div role="listbox">
0060                                         <ul role="option">
0061                                             <li class="selected"><a tabindex="-1" href="#" data-option="0">Choose a
0062                                                                                                            Category</a>
0063                                             </li>
0064                                             <li><a tabindex="-1"
0065                                                    href="#"
0066                                                    title="Project belongs to another person"
0067                                                    data-option="30">Project belongs to another person</a></li>
0068                                             <li><a tabindex="-1"
0069                                                    href="#"
0070                                                    title="Project-content is pornographic"
0071                                                    data-option="32">Project-content is pornographic</a></li>
0072                                             <li><a tabindex="-1" href="#" title="Project is racist" data-option="31">Project
0073                                                                                                                      is
0074                                                                                                                      racist</a>
0075                                             </li>
0076                                         </ul>
0077                                     </div>
0078                                 </div>
0079                             </div>
0080 
0081                         </div>
0082                         <div class="field">
0083                             <?= $this->form->short_text ?>
0084                         </div>
0085                         <div class="field purple italic">
0086                             You can help us if you write a short description of the problem.
0087                         </div>
0088                     </div>
0089                     <div class="modal-footer">
0090                         <div class="center">
0091                             <button type="submit" id="send" name="send" class="btn btn-min-width btn-native">SEND
0092                             </button>
0093                         </div>
0094                     </div>
0095                 </form>
0096             <?php else: ?>
0097                 <div class="modal-body">
0098                     <?= $this->saveText; ?>
0099                 </div>
0100                 <div class="modal-footer w-logo">
0101                     <div class="logo"></div>
0102                 </div>
0103             <?php endif; ?>
0104         <?php else: ?>
0105             <div class="modal-body">
0106                 <?= $this->translate('projects.report.login') ?>
0107             </div>
0108             <div class="modal-footer w-logo">
0109                 <div class="logo"></div>
0110             </div>
0111         <?php endif; ?>
0112 
0113         <!-- modal body -->
0114 
0115     </div>
0116 
0117 </div><!-- /.report -->
0118 <!-- javascripts -->
0119 <script type="text/javascript">
0120     // report form custom select function
0121     $('body').on('click', '.selectbox_select', function () {
0122         $('.report-form').find('.selectbox_menu').show();
0123     });
0124 
0125     $('body').on('click', '.selectbox_menu a', function () {
0126         var thisDataValue = $(this).attr('data-option');
0127         var thisTitle = $(this).attr('title');
0128         $('.report-form').find('#project_report_category_id').attr('value', thisDataValue).attr('label', thisTitle);
0129         $('.report-form').find('.selectbox_selected').text(thisTitle);
0130         $('.report-form').find('.selectbox_menu').hide();
0131     });
0132 
0133     var PartialForms = (function () {
0134         return {
0135             setup: function () {
0136                 $('body').on("submit", 'form.partial', function (event) {
0137                     event.preventDefault();
0138                     event.stopImmediatePropagation();
0139                     var target = $(this).attr("data-target");
0140                     var trigger = $(this).attr("data-trigger");
0141 
0142                     jQuery.ajax({
0143                         data: $(this).serialize(),
0144                         url: this.action,
0145                         type: this.method,
0146                         error: function () {
0147                             $(target).empty().html("<span class='error'>Service is temporarily unavailable. Our engineers are working quickly to resolve this issue. <br/>Find out why you may have encountered this error.</span>");
0148                             return false;
0149                         },
0150                         success: function (results) {
0151                             $(target).empty().html(results);
0152                             $(target).find(trigger).trigger('click');
0153                             return false;
0154                         }
0155                     });
0156 
0157                     return false;
0158                 });
0159             }
0160         }
0161     })();
0162 
0163     PartialForms.setup();
0164 </script>