.
*/
class ApplAgreePrivacy extends Appl {
public function __construct($appl_id) {
$this->appl_id = $appl_id;
$this->name = "AgreePrivacy";
$this->compulsory = true;
}
public function get_print_name() {
return "Privacy statement";
}
public function get_print_name_short() {
return "Privacy statement";
}
public function get_print_value($readonly=false) {
global $setup;
$r = "name."\" name=\"".$this->name."\"";
if( $readonly ) $r .= " readonly=\"readonly\"";
if( $this->value ) $r .= " checked=\"checked\"";
$r .= " />";
return $r;
}
public function set($value) {
$this->value = ($value==true);
return true;
}
public function check() {
if( !isset($_POST[ $this->name ]) ) {
$this->error = true;
$this->error_txt = "You cannot apply if you do not agree to the privacy statement";
return false;
}else {
return true;
}
}
public function get_access($new=true) {
if( $this->access>=0 ) return $this->access;
elseif( is_anon() && $new ) return self::ACCESS_RW;
elseif( (isset($_SESSION['access_user']) && $_SESSION['access_user']) && $new ) return self::ACCESS_RW;
else return self::ACCESS_NO;
}
public function get_sql($new=true) {
// Don't save this field
return array();
}
public function get_value($new=true) {
$r = array();
if( $new ) $r['new']["Agree privacy statement"] = "Yes";
return $r;
}
}
?>