public function act_new_document()
 {
     global $conf;
     $document_form = document_form('new');
     $this->document_form = $document_form;
     if (isset($_POST['save'])) {
         $status = shn_form_validate($this->document_form);
         if (!$status) {
             return;
         }
         unset($document_form['doc_id']);
         $supporting_docs = new SupportingDocs();
         $supporting_docs_meta = new SupportingDocsMeta();
         $type = null;
         $uri = shn_files_store('choose_file_upload', null, $type);
         //"http://test";
         if ($uri == null) {
             $uri = '';
         }
         $doc_uuid = shn_create_uuid('doc');
         $supporting_docs->doc_id = $doc_uuid;
         $supporting_docs_meta->doc_id = $doc_uuid;
         $supporting_docs->uri = $uri;
         form_objects($document_form, $supporting_docs);
         form_objects($document_form, $supporting_docs_meta);
         $supporting_docs_meta->format = $type;
         $supporting_docs->Save();
         $supporting_docs_meta->SaveAll();
         $this->supporting_docs = $supporting_docs;
         $this->supporting_docs_meta = $supporting_docs_meta;
         set_url_args('doc_id', $this->supporting_docs_meta->doc_id);
         change_tpl('add_document_finish');
         set_redirect_header('docu', 'view_document');
         exit;
     }
 }
示例#2
0
 function act_unknown_error()
 {
     $this->title = _t('SYSTEM_ERROR');
     change_tpl('act_error');
 }
 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;
 }