public function _load_object($handler_id, $args, &$data) { $qb = fi_kilonkipinat_todos_todoitem_dba::new_query_builder(); $qb->add_constraint('topic', '=', $this->_request_data['content_topic']->id); $qb->add_constraint('guid', '=', $args[0]); $qb->set_limit(1); $objects = $qb->execute(); if (is_array($objects) && count($objects) > 0) { $this->_object = $objects[0]; $this->_todo = $this->_object; } else { debug_push_class(__CLASS__, __FUNCTION__); debug_pop(); $_MIDCOM->generate_error(MIDCOM_ERRNOTFOUND, 'Failed to load todo, cannot continue. Last Midgard error was: ' . midcom_application::get_error_string()); // This will exit. } return $this->_object; }
echo "</td>"; echo "\t\t</tr>"; } echo "</table>"; echo "<br /><br />"; echo '<a href="' . $prefix . 'list/my_groups/">Näytä kaikki</a>'; } else { echo "<p>Ei nakkeja</p>"; } ?> </div> </div> <div class="fi_kilonkipinat_website_toggler_container"> <?php $qb_my_supervised = fi_kilonkipinat_todos_todoitem_dba::new_query_builder(); $qb_my_supervised->add_constraint('supervisor', '=', $_MIDGARD['user']); $qb_my_supervised->add_constraint('status', '<', FI_KILONKIPINAT_TODOS_TODOITEM_STATUS_CLOSED); $my_supervised_count = $qb_my_supervised->count(); $qb_my_supervised->add_order('deadline', 'ASC'); $qb_my_supervised->set_limit(5); $todos_my_supervised = $qb_my_supervised->execute(); ?> <h2><a href="#" class="fi_kilonkipinat_website_toggler_trigger" onclick="return false;">Minä valvojana (<?php echo $my_supervised_count; ?> )</a></h2> <div class="fi_kilonkipinat_website_toggler_content" style="display: none;"> <?php if (count($todos_my_supervised) > 0) { echo "<table class=\"tablesorter\">\n";