.
*/
class CandAgreeCIA extends Cand {
public function __construct($candidate_id) {
$this->candidate_id = $candidate_id;
$this->name = "AgreeCIA";
$this->compulsory = true;
}
public function get_print_name() {
return "Agree CIA";
}
public function get_print_name_short() {
return "Agree CIA";
}
public function get_print_value($readonly=false) {
$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 candidate if you haven't taken notice of all related articles in the CIA relating to the post for which you are candidating.";
return false;
}else {
return true;
}
}
public function get_access($new=true) {
if( 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_accesspublic() {
return false;
}
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']["Taken notice of all related articles in CIA"] = "Yes";
return $r;
}
}
?>