/**
  * @remotable
  * @formHandler
  */
 public function saveForm($a)
 {
     //capture the param 'staffList' and loop through the array of IDs
     //echo $a['staffList'];
     if (strlen($a['staffList'] > 0)) {
         $orgID = $this->getOrgID();
         $staff = $a['staffList'];
         $q = Doctrine_Manager::getInstance()->getCurrentConnection();
         $query = "UPDATE contact_value SET \r\n\t\t\t\t\t\t\tisRedFlag =  CASE \r\n\t\t\t\t\t\t\t\t\tWhen id in ({$staff})  \r\n\t\t\t\t\t\t\t\t\t\t THEN  1  \r\n\t\t\t\t\t\t\t\t\tElse 0\r\n\t\t\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\t WHERE orgID={$orgID}";
         $result = $q->execute($query);
         //$q = Doctrine_Manager::getInstance()->getCurrentConnection();
         //$query = "UPDATE `contact_value` SET `isRedFlag` = '0' WHERE `orgID` = $orgID;";
         //$result = $q->execute($query);
         //$query = "UPDATE `contact_value` SET `isRedFlag` = '1' WHERE (`contact_value`.`ID` IN ($staff) AND `orgID` = $orgID);";
         //$result = $q->execute($query);
         //$q = Doctrine_Query::create()
         //->update('ContactValue')
         //->set('isRedFlag', 0)
         //->where('ID NOT IN (' . $a['staffList'] . ')')
         //->andWhere('orgID = '.$orgID.'');
         //$q->execute();
         //echo $q->getSqlQuery();
     }
     return parent::saveForm($a);
 }
 /**
  * @remotable
  * @formHandler
  */
 public function saveForm($a)
 {
     $return = parent::saveForm($a);
     if (isset($a["colorCode"])) {
         $user = $this->getSessionValue("contactID");
         $q = Doctrine_Query::create()->update("ContactValue c")->set("c.colorCode", "?", $a["colorCode"])->where("c.ID = ?", $user);
         $q->execute();
         $return["data"]["colorCode"] = $a["colorCode"];
     }
     return $return;
 }
 /**
  * @remotable
  * @formHandler
  */
 public function saveForm($a)
 {
     //do current password validation here and update $a Array
     if (strlen($a["curr_password"]) > 0) {
         $hashedPass = $this->generateHash($a["curr_password"]);
         $currPass = $this->doPasswordCheck("");
         if ($hashedPass == $currPass->password) {
             $a["password"] = $a["new_password"];
         } else {
             return array("success" => false, "msg" => "The current password you have entered does not match our records.");
         }
     }
     return parent::saveForm($a);
 }
 /**
  * @remotable
  * @formHandler
  */
 public function saveForm($a)
 {
     //$this->setupOneToOne($a);
     $a["incidentSplitDate"] = date("Y-m-d", strtotime($a["incidentSplitDate"]));
     $date = strtotime($a["incidentSplitDate"] . " " . $a["incidentSplitTime"]);
     $a["incidentTime"] = date("Y-m-d H:i:s", $date);
     $return = parent::saveForm($a);
     if (isset($return['data'])) {
         $data = $return["data"];
         $ts = strtotime($data["incidentTime"]);
         $data["incidentSplitDate"] = date("Y-m-d", $ts);
         $data["incidentSplitTime"] = date("g:ia", $ts);
         $return["data"] = $data;
     }
     return $return;
 }
 /**
  * @remotable
  * @formHandler
  */
 public function saveForm($a)
 {
     $a['type'] = 1;
     return parent::saveForm($a);
 }
 /**
  * @remotable
  * @formHandler
  */
 public function saveForm($a)
 {
     $_POST = $this->populateArray($_POST);
     $recordId = $this->getLoadFormID($a);
     //New record with no recurrence route to existing function from parent
     if ($this->isExisitingRecord($recordId) == false && (!isset($a['rrule']) || $a['rrule'] == "")) {
         // call parent method to update
         return parent::saveForm($a);
     }
     //Existing record with no rrule
     if ($this->isExisitingRecord($recordId) == true && (!isset($a['rrule']) || $a['rrule'] == "")) {
         return parent::saveForm($a);
     }
     //Existing record with rrule
     if ($this->isExisitingRecord($recordId) == true && (isset($a['rrule']) || $a['rrule'] != "")) {
         $exeResult = $this->removeRecurrences($a['atcRecurrID']);
         if (!$exeResult) {
             //if delete fails
             return array("success" => false);
         }
     }
     $rrule = $this->ical_rrule($a['rrule']);
     $a = $this->actRecurr($a);
     if (isset($rrule['FREQ'])) {
         if (!isset($rrule['INTERVAL'])) {
             $rrule['INTERVAL'] = 1;
         }
         //is this BYDAY weekly with selected dates like MO,TU.
         if (array_key_exists('BYDAY', $rrule)) {
             return $this->processDatesByDay($rrule);
         } else {
             return $this->processDates($rrule);
         }
     }
 }
 /**
  * @remotable
  * @formHandler
  */
 public function saveForm($a)
 {
     $a['orgID'] = $this->getOrgID();
     $a['mfrom'] = $this->getUserName();
     return parent::saveForm($a);
 }