. */ class ApplFirstName extends Appl { public function __construct($appl_id) { $this->appl_id = $appl_id; $this->name = "FirstName"; $this->compulsory = true; } public function get_print_name() { return "First name"; } public function get_print_name_short() { return "First name"; } public function get_print_value($readonly=false) { $r = "name."\" value=\"".$this->value."\" size=\"40\" maxlength=\"50\""; if( $readonly ) $r .= " disabled=\"disabled\""; $r .= " />"; return $r; } public function set($value) { if( strlen($value)<2 OR strlen($value)>50 ) { // Error $this->error = true; $this->error_txt = "Please supply your first name (maximum 50 characters)"; return false; }elseif( !check_capitals($value) ) { // Error $this->error = true; $this->error_txt = "First names do not consist of capitals only. Please use proper casing"; return false; }else { $this->value = $value; return true; } } public function get_access($new=true) { global $setup; if( $this->access>=0 ) return $this->access; elseif( isset($_SESSION['sess_functions']) && in_array("applicationfield_personaledit", $_SESSION['sess_functions']) ) return self::ACCESS_RW; elseif( isset($_SESSION['sess_functions']) && in_array("applicationfield_personalview", $_SESSION['sess_functions']) ) return self::ACCESS_R; elseif( is_anon() && $new ) return self::ACCESS_RW; elseif( isset($_SESSION['access_user']) && $_SESSION['access_user'] && $new && !$setup['ApplShowNameReadonly'] ) return self::ACCESS_RW; elseif( isset($_SESSION['access_user']) && $_SESSION['access_user'] ) return self::ACCESS_R; else return self::ACCESS_NO; } public function get_sql($new=true) { // Return when making new application or when there is write access if( $this->get_access($new)==Appl::ACCESS_RW OR $new ) return array($this->name => $this->value); else return array(); } } ?>