summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorSebastian Wagner2011-11-16 13:18:15 +0100
committerSebastian Wagner2011-11-16 13:18:15 +0100
commit19ba0a7718ebc2745eb9b7c04a75f6e3657a1fa8 (patch)
treec8926acb5b0494b29882b552cec3f4ceec9abf81 /application
parentCode Cleaning und verschiedene kleine Korrekturen (diff)
downloadpoolctrl-19ba0a7718ebc2745eb9b7c04a75f6e3657a1fa8.tar.gz
poolctrl-19ba0a7718ebc2745eb9b7c04a75f6e3657a1fa8.tar.xz
poolctrl-19ba0a7718ebc2745eb9b7c04a75f6e3657a1fa8.zip
more clean up
Diffstat (limited to 'application')
-rwxr-xr-xapplication/controllers/EventController.php34
-rwxr-xr-xapplication/controllers/StatisticsController.php2
-rwxr-xr-xapplication/layouts/default.phtml3
-rwxr-xr-xapplication/models/EventMapper.php2
-rwxr-xr-xapplication/models/EventcategoryMapper.php63
-rwxr-xr-xapplication/views/scripts/event/index.phtml5
6 files changed, 70 insertions, 39 deletions
diff --git a/application/controllers/EventController.php b/application/controllers/EventController.php
index 29ffe71..ab6f913 100755
--- a/application/controllers/EventController.php
+++ b/application/controllers/EventController.php
@@ -575,9 +575,9 @@ class EventController extends Zend_Controller_Action
}
/*
- * ------------------------
- * START CALENDAR FUNCTIONS
- * ------------------------
+ * ----------------------------------
+ * START - SPECIAL CALENDAR FUNCTIONS
+ * ----------------------------------
*/
public function getpoollistAction() {
@@ -663,7 +663,6 @@ class EventController extends Zend_Controller_Action
$evt['title'] = $e['title'];
$cfeventswithrepeat[] = $e;
}
- //} $this->_redirect('/event/');
}
// Check for overlap without repeat
@@ -806,9 +805,6 @@ class EventController extends Zend_Controller_Action
if($cfv) {
$cfeventswithoutrepeat[] = $e;
}
-
- //$this->view->events = $events;
- //$this->view->others = $others;
$this->view->overlapswithrepeat = $overlapswithrepeat;
$this->view->cfeventswithrepeat = $cfeventswithrepeat;
$this->view->overlapswithoutrepeat = $overlapswithoutrepeat;
@@ -1324,27 +1320,25 @@ class EventController extends Zend_Controller_Action
}
foreach ($eventList as $event){
- if($event->getPbs_poolID() == $poolID) {
- if($event->getCategory() == 1){$color = 'green' AND $textColor = 'white' AND $category= 'Lecture';}
- else if ($event->getCategory() == 2){$color = 'yellow' AND $textColor = 'black' AND $category = 'Maintenance';}
- else if ($event->getCategory() == 3){$color = 'blue' AND $textColor = 'white' AND $category = 'Boot';}
- else if ($event->getCategory() == 4){$color = 'red' AND $textColor = 'white' AND $category = 'Shutdown';}
- $events[] = array(
+ if($event->getPbs_poolID() == 2) {$textColor = 'black';}
+ else $textColor = 'white';
$events[] = array(
+
+ $events[] = array(
'id' => $event->getID(),
'title' => $event->getTitle(),
'start' => $event->getStart(),
'end' => $event->getEnd(),
- 'category' => $category,
+ 'category' => $this->eventcategoryMapper->getCategoryTitle($event->getCategory()),
'participants' => $event->getParticipants(),
'note' => $event->getNote(),
'poolID' => $event->getPbs_poolID(),
'bootosID' => $event->getPbs_bootosID(),
'allDay' => false,
- 'color' => $color,
+ 'color' => $this->eventcategoryMapper->getCategoryColor($poolID, $event->getCategory()),
'textColor' => $textColor,
- 'borderColor' => $color,
+ 'borderColor' => $this->eventcategoryMapper->getCategoryColor($poolID, $event->getCategory()),
'selected' => false,
'repeat' => $event->getRepeat(),
'opacity' => 1,
@@ -1352,7 +1346,7 @@ class EventController extends Zend_Controller_Action
'running' => $event->getRunning(),
)
);
- }
+ //}
}
echo json_encode($events);
}
@@ -1364,9 +1358,9 @@ class EventController extends Zend_Controller_Action
}
/*
- * ----------------------
- * END CALENDAR FUNCTIONS
- * ----------------------
+ * --------------------------------
+ * END - SPECIAL CALENDAR FUNCTIONS
+ * --------------------------------
*/
diff --git a/application/controllers/StatisticsController.php b/application/controllers/StatisticsController.php
index d840023..868a2a6 100755
--- a/application/controllers/StatisticsController.php
+++ b/application/controllers/StatisticsController.php
@@ -59,7 +59,7 @@ class StatisticsController extends Zend_Controller_Action
$ret['dataBar'] = $this->eventMapper->getCategoryBarCount($poolID);
$ret['dataPie'] = $this->eventMapper->getCategoryPieCount($poolID);
- $ret['color'] = $this->eventcategoryMapper->getCategoryColor($poolID);
+ $ret['color'] = $this->eventcategoryMapper->getCategoryColor($poolID, null);
echo json_encode($ret);
diff --git a/application/layouts/default.phtml b/application/layouts/default.phtml
index f0b2e20..d3637cb 100755
--- a/application/layouts/default.phtml
+++ b/application/layouts/default.phtml
@@ -21,7 +21,8 @@ echo $this->headScript()."\n";
<script type="text/javascript"
src='/media/js/jquery-ui-timepicker-addon.js'></script>
<script type="text/javascript" src='/media/js/script.js'></script>
-<!-- files for calendar -->
+
+<!-- CALENDAR-FILES -->
<script type='text/javascript' src='/media/js/fullcalendar.js'></script>
<script type="text/javascript"
src='/media/js/jquery.qtip-1.0.0-rc3.min.js'></script>
diff --git a/application/models/EventMapper.php b/application/models/EventMapper.php
index 9545380..438613f 100755
--- a/application/models/EventMapper.php
+++ b/application/models/EventMapper.php
@@ -468,7 +468,7 @@ class Application_Model_EventMapper
$event->setID($result['eventID']);
$return[] = $event;
}
-
+
return $return;
}
diff --git a/application/models/EventcategoryMapper.php b/application/models/EventcategoryMapper.php
index 251fc82..3db9013 100755
--- a/application/models/EventcategoryMapper.php
+++ b/application/models/EventcategoryMapper.php
@@ -152,22 +152,24 @@ class Application_Model_EventcategoryMapper
return array_diff_assoc($vv1,$vv2);
}
- public function getCategoryColor($poolID) {
+ public function getCategoryColor($poolID, $eventcategoryID) {
$db = Zend_Db_Table::getDefaultAdapter();
if($poolID != 'all'){
- $select = $this->getDbTable()->select()
- ->distinct()
- ->setIntegrityCheck(false)
- ->from(array('pcec' => 'poolctrl_eventcategory'),
- array('color' => 'pcec.color'))
- ->join(array('pce' => 'poolctrl_event'),
+ if(isset($eventcategoryID)) {
+ $select = $this->getDbTable()->select()
+ ->distinct()
+ ->setIntegrityCheck(false)
+ ->from(array('pcec' => 'poolctrl_eventcategory'),
+ array('color' => 'pcec.color'))
+ ->join(array('pce' => 'poolctrl_event'),
'pce.category = pcec.eventcategoryID',
- array())
- ->where('pce.pbs_poolID = ?', $poolID)
- ->group('pce.category')
- ->order('eventcategoryID ASC');}
- else {
+ array())
+ ->where('pce.pbs_poolID = ?', $poolID)
+ ->where('pcec.eventcategoryID = ?', $eventcategoryID)
+ ->group('pce.category')
+ ->order('eventcategoryID ASC');
+ } else {
$select = $this->getDbTable()->select()
->distinct()
->setIntegrityCheck(false)
@@ -176,14 +178,43 @@ class Application_Model_EventcategoryMapper
->join(array('pce' => 'poolctrl_event'),
'pce.category = pcec.eventcategoryID',
array())
+ ->where('pce.pbs_poolID = ?', $poolID)
->group('pce.category')
->order('eventcategoryID ASC');
}
+ }
+ else {
+ $select = $this->getDbTable()->select()
+ ->distinct()
+ ->setIntegrityCheck(false)
+ ->from(array('pcec' => 'poolctrl_eventcategory'),
+ array('color' => 'pcec.color'))
+ ->join(array('pce' => 'poolctrl_event'),
+ 'pce.category = pcec.eventcategoryID',
+ array())
+ ->group('pce.category')
+ ->order('eventcategoryID ASC');
+ }
- $stmt = $db->query($select);
- $result = $stmt->fetchAll(PDO::FETCH_COLUMN, 0);
-
- return $result;
+ $stmt = $db->query($select);
+ $result = $stmt->fetchAll(PDO::FETCH_COLUMN, 0);
+
+ return $result;
+ }
+
+ public function getCategoryTitle($eventcategoryID) {
+ $db = Zend_Db_Table::getDefaultAdapter();
+ $select = $this->getDbTable()->select()
+ ->from(array('pcec' => 'poolctrl_eventcategory'),
+ 'pcec.title')
+ ->where('pcec.eventcategoryID = ?', $eventcategoryID)
+ ->group('pcec.eventcategoryID');
+
+ $stmt = $db->query($select);
+ $result = $stmt->fetchAll(PDO::FETCH_COLUMN, 0);
+
+ return $result;
+
}
} \ No newline at end of file
diff --git a/application/views/scripts/event/index.phtml b/application/views/scripts/event/index.phtml
index 3fe0194..8836ffc 100755
--- a/application/views/scripts/event/index.phtml
+++ b/application/views/scripts/event/index.phtml
@@ -1,10 +1,15 @@
<h1>Pool Control</h1>
<div id='calendar'
style='margin: 3em 0; font-size: 13px'></div>
+
+<!-- ADD POOL CONTROL CALENDAR -->
<script
type="text/javascript" src="/media/js/calendar.js"></script>
+
+<!-- ############## -->
<!-- DIALOG WINDOWS -->
+<!-- ############## -->
<!-- delete wdhEvent -->
<div id="eventDeleteWdhDialog" style="display: none">