Ejemplo n.º 1
0
 function __construct($id = 0)
 {
     if ($id == $this->getCurrentUser('id')) {
         $this->_save_permission_level = 0;
     }
     return parent::__construct($id);
 }
Ejemplo n.º 2
0
 function __construct($id = 0)
 {
     if ($id == $GLOBALS['user_system']->getCurrentPerson('id')) {
         // Every person can save their own details
         $this->_save_permission_level = 0;
     }
     return parent::__construct($id);
 }
Ejemplo n.º 3
0
 function __construct($id = 0)
 {
     if (!empty($GLOBALS['system'])) {
         $GLOBALS['system']->includeDBClass('person');
         $GLOBALS['system']->includeDBClass('family');
         $this->_dummy_person = new Person();
         foreach ($this->_dummy_person->fields as $i => $v) {
             unset($this->_dummy_person->fields[$i]['readonly']);
         }
         $this->_dummy_family = new Family();
         foreach ($this->_dummy_family->fields as $i => $v) {
             unset($this->_dummy_family->fields[$i]['readonly']);
         }
         foreach ($this->_dummy_person->fields as $i => $v) {
             if ($v['type'] == 'serialise') {
                 continue;
             }
             if ($i == 'familyid') {
                 continue;
             }
             if (empty($v['label'])) {
                 $v['label'] = $this->_dummy_person->getFieldLabel($i);
             }
             $this->_field_details['p.' . $i] = $v;
             $this->_field_details['p.' . $i]['allow_empty'] = true;
         }
         foreach ($this->_dummy_family->fields as $i => $v) {
             if ($v['type'] == 'serialise') {
                 continue;
             }
             if (empty($v['label'])) {
                 $v['label'] = $this->_dummy_family->getFieldLabel($i);
             }
             if (in_array($i, array('status', 'created', 'creator'))) {
                 $v['label'] = "Family's " . $v['label'];
             }
             $this->_field_details['f.' . $i] = $v;
             $this->_field_details['f.' . $i]['allow_empty'] = true;
         }
         $this->_custom_fields = $GLOBALS['system']->getDBObjectData('custom_field', array(), 'OR', 'rank');
         $this->_dummy_custom_field = new Custom_Field();
     }
     return parent::__construct($id);
 }
Ejemplo n.º 4
0
 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;
         }
     }
 }
Ejemplo n.º 5
0
 protected function __construct()
 {
     $this->editKeys = self::normalizeEditKeys($this->editKeys);
     parent::__construct();
 }
Ejemplo n.º 6
0
 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;
         }
     }
 }