function act_add_coe() { $chain_of_events_form = chain_of_events_form('new'); if (isset($_POST['save'])) { $status = shn_form_validate($chain_of_events_form); if ($status) { $this->event_id = $this->event->event_record_number; $coe = new ChainOfEvents(); form_objects($chain_of_events_form, $coe); $coe->event = $this->event_id; $coe->SaveAll(); $this->coeid = $coe->chain_of_events_record_number; $coe->LoadFromRecordNumber($this->coeid); $coe->LoadRelationships(); popuate_formArray($chain_of_events_form, $coe); change_tpl('coe_finish'); } } $this->chain_of_events_form = $chain_of_events_form; }
/** * act_edit_document Action to edit document details * * @access public * @return void */ public function act_edit_document() { $this->document_form = document_form('edit'); if (isset($_POST['update']) || isset($_POST['yes']) || isset($_POST['no'])) { $status = shn_form_validate($this->document_form); if (!$status) { return; } $this->fileExist = false; $type = null; $uri = shn_files_store('choose_file_upload', null, $type); //"http://test"; if ($uri == null) { $uri = ''; } if (isset($_POST['yes'])) { $this->supporting_docs->uri = $_SESSION['uri']; $this->supporting_docs->Save(); shnMessageQueue::addInformation(_t('THE_OLD_FILE_ATTACHMENT_WAS_UPDATED_WITH_THE_NEW_FILE_ATTACHMENT_')); } else { if (isset($_POST['no'])) { } else { if ($this->supporting_docs->uri != null && $uri != '') { $this->fileExist = true; $_SESSION['uri'] = $uri; $_SESSION['type'] = $type; return; } else { if ($this->supporting_docs->uri != null && $uri == '') { } else { $this->supporting_docs->uri = $uri; $this->supporting_docs->Save(); } } } } if ($_SESSION['type'] != null) { $type = $_SESSION['type']; } form_objects($this->document_form, $this->supporting_docs_meta); $this->supporting_docs_meta->format = $type; $this->supporting_docs_meta->SaveAll(); unset($_SESSION['type']); set_redirect_header('docu', 'view_document', null); exit; } }
function act_supporting_doc() { include_once APPROOT . 'inc/lib_form_util.inc'; include_once APPROOT . 'inc/lib_uuid.inc'; $this->supporting_doc_form = $supporting_doc_form; $this->pid = isset($_GET['pid']) && $_GET['pid'] != null ? $_GET['pid'] : $_SESSION['pid']; if ($this->pid != null) { $person_form = person_form('new'); $this->person_form = $person_form; $this->person = $this->person_information($this->pid, $this->person_form); $_SESSION['ppid'] = $this->pid; } if (isset($_POST['save'])) { $status = shn_form_validate($supporting_doc_form); if ($status) { $supporting_doc = new SupportingDocs(); $supporting_doc->doc_id = shn_create_uuid('document'); $supporting_doc->uri = 'www.respere.com'; $supporting_doc->Save(); $supporting_docmeta = new SupportingDocsMeta(); $supporting_docmeta->doc_id = $supporting_doc->doc_id; form_objects($supporting_doc_form, $supporting_docmeta); $supporting_docmeta->format = $this->findexts($_FILES['document']['name']); $supporting_docmeta->Save(); } } }