Exemple #1
0
 public function verifyActionData()
 {
     $returnValue = true;
     if ($this->action_id != NULL && !TasksappValidator::checkInteger($this->action_id)) {
         $this->errorArray['action_id'] = true;
     }
     if (!TasksappValidator::checkString($this->action)) {
         $this->errorArray['action'] = true;
     }
     if (!TasksappValidator::checkList($this->importance, array("0", "1", "2", "3", "4", "wf"))) {
         $this->errorArray['importance'] = true;
     }
     if (!TasksappValidator::checkDate($this->dateDue)) {
         $this->errorArray['dateDue'] = true;
     }
     if (!TasksappValidator::checkList($this->context, Command::getContexts())) {
         $this->errorArray['context'] = true;
     }
     if (!TasksappValidator::checkInteger($this->project_id)) {
         $this->errorArray['project_id'] = true;
     }
     if (count($this->errorArray) != 0) {
         $returnValue = false;
     }
     return $returnValue;
 }
Exemple #2
0
 /**
  * Create a new User object
  *
  * This method creates a new user from the username and password given in
  * the login form.
  *
  * @param Array $inputArray Array containing the $_POST data sent from the
  * login form
  * @return void
  *
  */
 public function __construct()
 {
     $db = Database::getInstance();
     $userArray = $db->getUserDetailsByuser_id($_SESSION['user_id']);
     $this->user_id = $userArray['user_id'];
     $this->username = $userArray['username'];
     $this->usertype = $userArray['usertype'];
     $this->contexts = Command::getContexts();
 }
</div>

<div class="formTable">
<span>date due</span>
<input type="text" id="datepicker" name="dateDue" value="<?php 
echo $action->dateDue();
?>
" size="10" class="text" />&nbsp;&nbsp;
</div>

<div class="formTable">
<span>context</span>
<select name="context">
<?php 
var_dump(Command::getContexts());
foreach (Command::getContexts() as $id => $context) {
    print "<option value=" . $context;
    if ($context == $action->context()) {
        print " selected>{$context}";
    } else {
        print ">{$context}";
    }
}
?>
</select>

</div>

<div class="formTable">
<span>project</span>
<select name="project_id">