Example #1
0
        public function view() {
			Loader::helper('overlay')->init(false);
			$gathering = Gathering::getByID($this->gaID);
			if (is_object($gathering)) {
				$list = new GatheringItemList($gathering);
				$list->sortByDateDescending();
				$this->set('gathering', $gathering);
				$this->set('itemList', $list);
			}
		}
 public function view()
 {
     $r = ResponseAssetGroup::get();
     $r->requireAsset('core/gathering');
     Loader::helper('overlay')->init(false);
     $gathering = Gathering::getByID($this->gaID);
     if (is_object($gathering)) {
         $list = new GatheringItemList($gathering);
         $list->sortByDateDescending();
         $this->set('gathering', $gathering);
         $this->set('itemList', $list);
     }
 }
Example #3
0
 public function __construct(Gathering $ag)
 {
     $this->setQuery('select gaiID from GatheringItems');
     $this->filter('gaID', $ag->getGatheringID());
     $this->filter('gaiIsDeleted', 0);
 }
Example #4
0
<?php

defined('C5_EXECUTE') or die("Access Denied.");
$nh = Loader::helper('validation/numbers');
if ($_POST['gaID'] && $nh->integer($_POST['gaID'])) {
    $gathering = Gathering::getByID($_POST['gaID']);
    if (is_object($gathering) && Loader::helper('validation/token')->validate('get_gathering_items', $_POST['loadToken'])) {
        $showTileControls = $_POST['showTileControls'] && Loader::helper('validation/token')->validate('update_gathering_items', $_POST['editToken']);
        $list = new GatheringItemList($gathering);
        $list->sortByDateDescending();
        $list->setItemsPerPage($_REQUEST['itemsPerPage']);
        $items = $list->getPage($_REQUEST['page']);
        foreach ($items as $item) {
            Loader::element('gathering/tile', array("item" => $item, 'showTileControls' => $showTileControls));
        }
    }
}
Example #5
0
 public function duplicate(Gathering $gathering)
 {
     $db = Database::connection();
     $gaID = $gathering->getGatheringID();
     $db->Execute('insert into GatheringItems (gaID, gasID, gaiDateTimeCreated, gaiPublicDateTime, gaiTitle, gaiKey, gaiSlotWidth, gaiSlotHeight, gaiBatchTimestamp, gaiBatchDisplayOrder)
                     values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', array($gaID, $this->getGatheringDataSourceID(), $this->gaiDateTimeCreated, $this->gaiPublicDateTime, $this->gaiTitle, $this->gaiKey, $this->gaiSlotWidth, $this->gaiSlotHeight, $this->gaiBatchTimestamp, $this->gaiBatchDisplayOrder));
     $this->loadGatheringItemTemplates();
     $gaiID = $db->Insert_ID();
     foreach ($this->templates as $gatTypeID => $gatID) {
         $db->Execute('insert into GatheringItemSelectedTemplates (gaiID, gatTypeID, gatID) values (?, ?, ?)', array($gaiID, $gatTypeID, $gatID));
     }
     $item = GatheringItem::getByID($gaiID);
     $assignments = GatheringItemFeatureAssignment::getList($this);
     foreach ($assignments as $as) {
         $item->copyFeatureAssignment($as);
     }
     return $item;
 }
 public function getGatheringObject()
 {
     $gathering = Gathering::getByID($this->gaID);
     return $gathering;
 }