File indexing completed on 2025-06-01 05:33:59

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 <?php if (!count($this->paginator)): ?>
0024     Keine Projekte vorhanden.
0025     <?php
0026 else:
0027     $lfdNr = 0;
0028     ?>
0029     <div id="infomsg" style="" class="ui-state-highlight ui-corner-all"></div>
0030     <div id="dialog" style="display: none;"></div>
0031     <div class="row">
0032         <div id="title" class="title head">Titel</div>
0033         <div id="member" class="status head" style="width: 100px;">Initiator</div>
0034         <div id="status" class="status head" style="width: 75px;">Zielbetrag</div>
0035         <div id="status" class="status head" style="width: 75px;">Dauer</div>
0036         <div id="status" class="status head" style="width: 75px;">Start</div>
0037         <div id="status" class="status head" style="width: 75px;">Restlaufzeit</div>
0038         <div id="status" class="status head" style="width: 75px;">Summe</div>
0039         <br style="clear: both;"/>
0040     </div>
0041 
0042     <?php foreach ($this->paginator as $item):
0043     $lfdNr++;
0044     ?>
0045     <div id="row<?= $item->project_id; ?>" class="row">
0046         <div id="title<?= $item->project_id; ?>"
0047              class="title data <?= $this->evenOdd($lfdNr); ?>"><?= stripslashes($item->title); ?></div>
0048         <div id="count<?= $item->project_id; ?>" class="status data <?= $this->evenOdd($lfdNr); ?>"
0049              style="width: 100px;"><?= $item->username; ?></div>
0050         <div id="status<?= $item->project_id; ?>" class="status data <?= $this->evenOdd($lfdNr); ?>"
0051              style="width: 65px; text-align: right; padding-right: 15px;"><?= $item->fund_sum ?> &euro;</div>
0052         <div id="status<?= $item->project_id; ?>" class="status data <?= $this->evenOdd($lfdNr); ?>"
0053              style="width: 75px;"><?= $item->duration ?></div>
0054         <div id="status<?= $item->project_id; ?>" class="status data <?= $this->evenOdd($lfdNr); ?>"
0055              style="width: 75px;"><?= $item->start_date ?></div>
0056         <div id="status<?= $item->project_id; ?>" class="status data <?= $this->evenOdd($lfdNr); ?>"
0057              style="width: 75px;">
0058             <?php if ($item->leftDays > 1): ?>
0059                 <?= $item->leftDays; ?> <?= $item->leftTime; ?>
0060             <?php else: ?>
0061                 <?php if ($item->leftTime > 0): ?>
0062                     noch <?= $item->leftTime; ?>
0063                 <?php else: ?>
0064                     Beendet
0065                 <?php endif; ?>
0066             <?php endif; ?>
0067         </div>
0068         <div id="status<?= $item->project_id; ?>" class="status data <?= $this->evenOdd($lfdNr); ?>"
0069              style="width: 65px; text-align: right; padding-right: 15px;"><?= ($item->collectAmount) ? $item->collectAmount : "0"; ?> &euro;</div>
0070         <a href="#" id="details_<?= $item->project_id; ?>"
0071            class="ui-state-default ui-corner-all button_normal showDetails">Details anschauen</a>
0072         <br style="clear: both;"/>
0073     </div>
0074     <div class="datatable_detailsarea details_<?= $item->project_id; ?>" style="width:500px;">
0075         <div class="dataDetailsContent fleft" style="width:350px;">
0076             <strong>Titel:</strong><br/><?= $item->title; ?><br/>
0077             <br/><br/>
0078             Erstellt am: <?= $item->created_at; ?><br/>
0079             Zuletzt geändert: <?= $item->changed_at; ?><br/>
0080         </div>
0081         <div class="dataDetailsButtons fleft">
0082             <a href="/backend/project/edit/id/<?= $item->project_id; ?>"
0083                class="ui-state-default ui-corner-all button_normal">Bearbeiten</a><br/><br/>
0084 
0085             <a href="#" id="delete_<?= $item->project_id; ?>"
0086                class="ui-state-default ui-corner-all button_normal delete">Löschen</a><br/><br/>
0087             <a href="/backend/fundstep/index/id/<?= $item->project_id; ?>"
0088                class="ui-state-default ui-corner-all button_normal">Vergütungen</a><br/><br/>
0089             <a href="/backend/project/backer/id/<?= $item->project_id; ?>"
0090                class="ui-state-default ui-corner-all button_normal">Unterstützer</a>
0091         </div>
0092         <div class="clear"></div>
0093     </div>
0094 <?php endforeach; ?>
0095 
0096     <br/><?php echo $this->paginator; ?><br/>
0097 <?php endif; ?>
0098 <br/><br/>
0099 <a href="/backend/project/add" class="ui-state-default ui-corner-all button_normal">Projekt anlegen</a><br/><br/>
0100 <!--
0101 <a href='/backend/project/categoryadd' class="ui-state-default ui-corner-all button_normal" id="4">Projekt-Kategorie hinzufügen</a>
0102 <a href='/backend/project' class="ui-state-default ui-corner-all button_normal" id="4">Zurück</a><br/><br/>
0103 -->
0104 <div class="legendArea">
0105 
0106 </div>
0107 
0108 <script type="text/javascript">
0109     $(document).ready(function () {
0110 
0111         $(".showDetails").click(function () {
0112             var elementId = $(this).attr("id");
0113 
0114             $(".datatable_detailsarea." + elementId).slideToggle();
0115         });
0116 
0117         $(".activate").click(function () {
0118             var itemId = $(this).attr("id");
0119             var tmp = itemId.split("_");
0120             itemId = tmp[1];
0121 
0122             var clickElement = $(this);
0123 
0124             $.post('/backend/project/setstatuscategory/', {id: itemId, status: 1}, function (response) {
0125                 if (response) {
0126                     $("#infomsg").html("Kategorie erfolgreich aktiviert");
0127                 } else {
0128                     $("#infomsg").html("Konnte Kategorie nicht aktivieren");
0129                 }
0130 
0131                 $("#infomsg").fadeIn("normal");
0132                 $(clickElement).hide();
0133                 $("#deactivate_" + itemId).show();
0134 
0135                 $("#infomsg").fadeOut(4000);
0136                 $("#status" + itemId).html("Ja");
0137             });
0138         });
0139 
0140         $(".deactivate").click(function () {
0141             var itemId = $(this).attr("id");
0142             var tmp = itemId.split("_");
0143             itemId = tmp[1];
0144 
0145             var clickElement = $(this);
0146 
0147             $.post('/backend/project/setstatuscategory/', {id: itemId, status: 0}, function (response) {
0148                 if (response) {
0149                     $("#infomsg").html("Kategorie erfolgreich deaktiviert");
0150                 } else {
0151                     $("#infomsg").html("Konnte Kategorie nicht deaktivieren");
0152                 }
0153 
0154                 $("#infomsg").fadeIn("normal");
0155                 $(clickElement).hide();
0156 
0157                 $("#activate_" + itemId).show();
0158                 $("#infomsg").fadeOut(4000);
0159                 $("#status" + itemId).html("");
0160             });
0161         });
0162 
0163         $(".delete").click(function () {
0164             var clickelement = $(this);
0165             var itemId = $(this).attr("id");
0166             var tmp = itemId.split("_");
0167             itemId = tmp[1];
0168 
0169 
0170             $("#dialog").html("Möchten Sie diese Kategorie wirklich löschen?");
0171 
0172             $("#dialog").dialog(
0173                 {
0174                     title: "Kategorie löschen",
0175                     modal: true,
0176                     resizable: false,
0177                     buttons: {
0178                         "Nein": function () {
0179                             $("#dialog").dialog('close');
0180                         }, "Ja": function () {
0181                             $(this).dialog('close');
0182                             var url = "/backend/project/deletecategory/id/" + itemId;
0183 
0184                             $.post(url, function (data) {
0185                                 $('#infomsg').html("Kategorie gelöscht");
0186                                 $('#infomsg').show();
0187                                 $("#infomsg").fadeOut(4000);
0188                                 //$('.date #'+elementid).hide();
0189                                 $("#row" + itemId).remove();
0190                                 $(".details_" + itemId).remove();
0191                             });
0192                         }
0193                     }
0194                 });
0195 
0196 
0197             $("#dialog").dialog('open');
0198 
0199         });
0200     });
0201 
0202 </script>