Пример #1
0
 public function deleteLocation($id)
 {
     parent::deleteRecord($id);
     $parentForm = Openbiz::getObject($this->parentFormName);
     $parentForm->rerender();
     return parent::close();
 }
 public function deleteAccount($id = null)
 {
     $rec = $this->getDataObj()->fetchById($id);
     $profile_id = Openbiz::$app->getUserProfile("Id");
     if ($rec['user_id'] == $profile_id) {
         $result = parent::deleteRecord($id);
     }
     //also notify remote service provider
 }
Пример #3
0
 /**
  * DeleteRecord() - allow delete only if no child node
  * @return avoid
  */
 public function deleteRecord()
 {
     $rec = $this->getActiveRecord();
     if (!$rec) {
         return;
     }
     $id = $rec['Id'];
     $recordList = $this->getDataObj()->directFetch("[PId]='{$id}'");
     if (count($recordList) > 0) {
         $errorMsg = "Unable to delete the record that has 1 or more children nodes.";
         Openbiz::$app->getClientProxy()->showErrorMessage($errorMsg);
         return;
     }
     return parent::deleteRecord();
 }