File indexing completed on 2025-05-04 05:29:29

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 $loopProductUpdate = 'productUpdate-' . $this->pid . '-' . $this->project_id;
0024 $urlData = new stdClass();
0025 $urlData->project_id = $this->pid;
0026 $urlData->title = $this->title;
0027 $urlParam = array('upid' => $this->project_id);
0028 $statusPayPal = $this->partialLoop()->view->member->paypal_mail;
0029 $cssStyleMessage = empty($statusPayPal) ? ' disabled="disabled"' : '';
0030 $urlPublish = empty($statusPayPal) ? 'javascript:;' : $this->buildProductUrl($this->project_id, 'publish', array('m' => $this->member_id));
0031 $urlPublishTitle = empty($statusPayPal) ? $this->translate('Please add a PayPal Address before publishing a product update.') : '';
0032 $date = $this->humanTiming($this->created_at);
0033 $object_text = (mb_strlen($this->description) < 300) ? $this->description : mb_substr($this->description, 0, 295, 'UTF-8') . ' ... ';
0034 ?>
0035 <div class="product-update" id="<?= $loopProductUpdate ?>">
0036     <h3 class="lightblue product-update-title"><?= $this->title ?></h3>
0037     <span><?= $date['age'] ?> <?= $date['unit'] ?></span>
0038 
0039     <div><?= nl2br(strip_tags($object_text)) ?></div>
0040     <div class="product-buttons pull-left margin-bottom-10">
0041         <a href="<?= $this->buildProductUrl($urlData->project_id, 'update', $urlParam) ?>"><?= $this->translate('Edit') ?></a>
0042         <a href="#modalDelete<?= $loopProductUpdate ?>" data-toggle="modal"><?= $this->translate('Delete') ?></a>
0043         <span id="<?= $loopProductUpdate ?>" class="btn-publish">
0044         <?php if ($this->isProjectActive($this->status)) : ?>
0045             <a id="publish-product" <?= $cssStyleMessage ?>
0046                href="<?= $urlPublish ?>"
0047                data-target="#<?= $loopProductUpdate ?>.btn-publish"
0048                title="<?= $urlPublishTitle ?>"><?= $this->translate('Publish') ?></a>
0049         <?php else : ?>
0050             <a id="publish-product"
0051                href="<?= $this->buildProductUrl($this->project_id, 'unpublish', array('m' => $this->member_id)) ?>"
0052                data-target="#<?= $loopProductUpdate ?>.btn-publish"
0053                title="<?= $urlPublishTitle ?>"><?= $this->translate('Unpublish') ?></a>
0054         <?php endif; ?>
0055         </span>
0056     </div>
0057     <div id="modalDelete<?= $loopProductUpdate ?>" class="modal hide fade">
0058         <!-- dialog contents -->
0059         <div class="modal-body"><?= $this->translate('Do you really want to delete this update?') ?></div>
0060         <!-- dialog buttons -->
0061         <div class="modal-footer"><a
0062                 href="<?= $this->buildProductUrl($this->project_id, 'delete', array('m' => $this->member_id)) ?>"
0063                 role="button" class="btn btn-primary"><?= $this->translate('YES') ?></a> <a href="#" role="button"
0064                                                                                             class="btn btn-primary"
0065                                                                                             data-dismiss="modal"
0066                                                                                             aria-hidden="true"><?= $this->translate('NO') ?></a>
0067         </div>
0068     </div>
0069 </div><!-- /.product-update -->