Ejemplo n.º 1
0
 function act_filemanagerupload()
 {
     include_once APPROOT . 'inc/lib_uuid.inc';
     include_once APPROOT . 'inc/lib_files.inc';
     $type = null;
     global $conf;
     $imagesfolder = $conf['media_dir'] . "filemanager" . DS;
     //WWWWROOT . "images" . DS . "uploads" . DS;
     $uri = shn_files_store('file', null, $type, $imagesfolder);
     exit;
 }
Ejemplo n.º 2
0
 /**
  * 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;
     }
 }
Ejemplo n.º 3
0
 public function SavePicture()
 {
     if ($this->picture_doc == true && is_uploaded_file($_FILES['picture']['tmp_name'])) {
         $type = null;
         $uri = shn_files_store('picture', null, $type);
         if ($uri == null) {
             $uri = '';
         }
         $document_form = document_form('new');
         $supporting_docs = new SupportingDocs();
         $supporting_docs_meta = new SupportingDocsMeta();
         $pictureDoc = new SupportingDocEntity(SupportingDocEntity::generateTableName('picture'));
         $pictureDoc->record_number = $this->person_record_number;
         if ($_POST['picture_id'] != null) {
             $picture_id = $_POST['picture_id'];
             if ($uri != '') {
                 $supporting_docs->doc_id = $picture_id;
                 $supporting_docs->uri = $uri;
                 $supporting_docs->_saved = true;
                 form_objects($document_form, $supporting_docs);
                 //$supporting_docs->Delete();
                 $supporting_docs->Save();
                 form_objects($document_form, $supporting_docs_meta);
                 $supporting_docs_meta->title = "Picture";
                 $supporting_docs_meta->doc_id = $picture_id;
                 $supporting_docs_meta->format = $type;
                 $supporting_docs_meta->_saved = true;
                 $supporting_docs_meta->Save();
                 $pictureDoc->doc_id = $picture_id;
                 $pictureDoc->_saved = true;
                 $pictureDoc->linked_by = $_SESSION['username'];
                 $pictureDoc->Save();
             }
         } else {
             $picture_id = shn_create_uuid('picture');
             $supporting_docs->doc_id = $picture_id;
             $supporting_docs->uri = $uri;
             form_objects($document_form, $supporting_docs);
             $supporting_docs->Save();
             form_objects($document_form, $supporting_docs_meta);
             $supporting_docs_meta->title = "Picture";
             $supporting_docs_meta->doc_id = $picture_id;
             $supporting_docs_meta->format = $type;
             $supporting_docs_meta->Save();
             $pictureDoc->doc_id = $picture_id;
             $pictureDoc->linked_by = $_SESSION['username'];
             $pictureDoc->Save();
         }
     }
 }