function getInstancesQueryComps($params, $logic, $order) { $res = parent::getInstancesQueryComps($params, $logic, $order); $res['from'] = '(' . $res['from'] . ') LEFT OUTER JOIN person creator ON note_comment.creator = creator.id'; $res['select'][] = 'creator.first_name as creator_fn'; $res['select'][] = 'creator.last_name as creator_ln'; return $res; }
private function _logOut() { if (!empty($_SESSION['user'])) { DB_Object::releaseAllLocks($_SESSION['user']['id']); } $_SESSION['user'] = NULL; $_SESSION['login_time'] = NULL; $_SESSION['last_activity_time'] = NULL; }
function printFieldInterface($name, $prefix = '') { switch ($name) { case 'photo': ?> <input type="file" name="photo" /> <?php break; case 'familyid': ?> <div class="controls-text"> <i class="icon-home"></i> <?php $this->printFieldValue('familyid'); ?> <br /> <a href="<?php echo build_url(array('view' => '_edit_family', 'familyid' => $this->values['familyid'])); ?> "> <i class="icon-wrench"></i>Edit family details</a> <a href="<?php echo build_url(array('view' => '_move_person_to_family', 'personid' => $this->id)); ?> "> <i class="icon-random"></i>Move to different family</a> </div> <?php break; default: parent::printFieldInterface($name, $prefix); } }
function load($id) { if ($id == 'TEMP') { if (!empty($_SESSION['saved_query'])) { $x = unserialize($_SESSION['saved_query']); $this->populate($x->id, $x->values); } return TRUE; } else { return parent::load($id); } }
function __construct($stock_file_id = 0) { parent::__construct(); if ($stock_file_id) { $db = $this->mysqli; $results = $db->query("SELECT stock_file_id, display_name, file_name, hook_name FROM ashp_stock_files WHERE stock_file_id = '{$stock_file_id}'"); $vars = $results->fetch_array(MYSQLI_ASSOC); if (empty($vars)) { echo edgimo_error('No stock file found with ID = ' . $stock_file_id); return; } foreach ($vars as $k => $v) { $this->{$k} = $v; } } }
function save() { // If the subject or details is updated, set the 'editor' and 'edited' fields if (isset($this->_old_values['subject']) || isset($this->_old_values['details'])) { $this->setValue('edited', 'CURRENT_TIMESTAMP'); $this->setValue('editor', $GLOBALS['user_system']->getCurrentUser('id')); } return parent::save(); }
public function getValue($name) { $res = parent::getValue($name); if ($name == 'actions' && isset($res['dates'])) { // Convert old format to new format foreach ($res['dates'] as $fieldid => $note) { $res['fields']['custom_' . $fieldid] = array('value' => "-1==={$note}", 'add' => true); } unset($res['dates']); } return $res; }
function save() { $this->setValue('modified', date('Y-m-d H:i:s')); $this->setValue('modifier', $GLOBALS['user_system']->getCurrentUser('id')); return parent::save(); }
protected function __construct() { $this->editKeys = self::normalizeEditKeys($this->editKeys); parent::__construct(); }
function __construct($faculty_id = 0) { parent::__construct(); if ($faculty_id) { $db = $this->mysqli; $results = $db->query("SELECT * FROM ashp_faculty WHERE faculty_id = '{$faculty_id}'"); $vars = $results->fetch_array(MYSQLI_ASSOC); if (empty($vars)) { echo edgimo_error('No faculty found with ID = ' . $faculty_id); return; } foreach ($vars as $k => $v) { $this->{$k} = $v; } } }