3 * FusionForge document manager
5 * Copyright 2000, Quentin Cregan/Sourceforge
6 * Copyright 2002-2003, Tim Perdue/GForge, LLC
7 * Copyright 2009, Roland Mas
8 * Copyright 2010-2011, Franck Villaume - Capgemini
9 * Copyright 2011, Franck Villaume - TrivialDev
10 * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
11 * http://fusionforge.org
13 * This file is part of FusionForge. FusionForge is free software;
14 * you can redistribute it and/or modify it under the terms of the
15 * GNU General Public License as published by the Free Software
16 * Foundation; either version 2 of the Licence, or (at your option)
19 * FusionForge is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License along
25 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
26 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29 require_once $gfcommon.'include/Error.class.php';
30 require_once $gfcommon.'docman/Parsedata.class.php';
31 require_once $gfcommon.'docman/DocumentManager.class.php';
33 class Document extends Error {
36 * Associative array of data from db.
38 * @var array $data_array.
52 * @param object The Group object to which this document is associated.
53 * @param int The docid.
54 * @param array The associative array of data.
55 * @return boolean success.
57 function Document(&$Group, $docid = false, $arr = false) {
59 if (!$Group || !is_object($Group)) {
60 $this->setNotValidGroupObjectError();
63 if ($Group->isError()) {
64 $this->setError('Document:: '. $Group->getErrorMessage());
67 $this->Group =& $Group;
70 if (!$arr || !is_array($arr)) {
71 if (!$this->fetchData($docid)) {
75 $this->data_array =& $arr;
76 if ($this->data_array['group_id'] != $this->Group->getID()) {
77 $this->setError('Document:: '. _('Group_id in db result does not match Group Object'));
78 $this->data_array = null;
82 if (!$this->isPublic()) {
83 $perm =& $this->Group->getPermission();
85 if (!$perm || !is_object($perm) || !$perm->isDocEditor()) {
86 $this->setPermissionDeniedError();
87 $this->data_array = null;
96 * create - use this function to create a new entry in the database.
98 * @param string The filename of this document. Can be a URL.
99 * @param string The filetype of this document. If filename is URL, this should be 'URL';
100 * @param string The contents of this document.
101 * @param int The doc_group id of the doc_groups table.
102 * @param string The title of this document.
103 * @param string The description of this document.
104 * @param int The state id of the document. At creation, can not be deleted status.
105 * @return boolean success.
107 function create($filename, $filetype, $data, $doc_group, $title, $description, $stateid = 0) {
108 if (strlen($title) < 5) {
109 $this->setError(_('Title Must Be At Least 5 Characters'));
112 if (strlen($description) < 10) {
113 $this->setError(_('Document Description Must Be At Least 10 Characters'));
117 $user_id = ((session_loggedin()) ? user_getid() : 100);
119 $doc_initstatus = '3';
120 $perm =& $this->Group->getPermission();
121 if ($perm && is_object($perm) && $perm->isDocEditor()) {
122 if ($stateid && $stateid != 2) {
123 $doc_initstatus = $stateid;
125 $doc_initstatus = '1';
129 $result = db_query_params('SELECT filename, doc_group from docdata_vw
133 array($filename, $doc_group, $doc_initstatus));
135 if (!$result || db_numrows($result) > 0) {
136 $this->setError(_('Document already published in this directory'));
140 // If $filetype is "text/plain", $body convert UTF-8 encoding.
141 if (strcasecmp($filetype,"text/plain") === 0 &&
142 function_exists('mb_convert_encoding') &&
143 function_exists('mb_detect_encoding')) {
144 $data = mb_convert_encoding($data, 'UTF-8', mb_detect_encoding($data));
148 // key words for in-document search
149 if ($this->Group->useDocmanSearch()) {
150 $kw = new Parsedata();
151 $kwords = $kw->get_parse_data($data1, htmlspecialchars($title), htmlspecialchars($description), $filetype);
156 $filesize = strlen($data);
159 $result = db_query_params('INSERT INTO doc_data (group_id,title,description,createdate,doc_group,
160 stateid,filename,filetype,filesize,data_words,created_by)
161 VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11)',
162 array($this->Group->getId(),
163 htmlspecialchars($title),
164 htmlspecialchars($description),
174 $this->setError(_('Error Adding Document:').' '.db_error().$result);
179 $docid = db_insertid($result,'doc_data','docid');
181 switch ($this->Group->getStorageAPI()) {
183 $result = db_query_params('UPDATE doc_data set data = $1 where docid = $2',
184 array(base64_encode($data),$docid));
186 $this->setError(_('Error Adding Document:').' '.db_error().$result);
193 $this->setError(_('Error Adding Document: No Storage API'));
199 if (!$this->fetchData($docid)) {
200 $this->setError(_('Error fetching Document'));
204 $this->sendNotice(true);
210 * fetchData() - re-fetch the data for this document from the database.
212 * @param int The document id.
213 * @return boolean success
215 function fetchData($docid) {
216 $res = db_query_params('SELECT * FROM docdata_vw WHERE docid=$1 AND group_id=$2',
217 array($docid, $this->Group->getID()));
218 if (!$res || db_numrows($res) < 1) {
219 $this->setError(_('Document:: Invalid docid'));
222 $this->data_array = db_fetch_array($res);
223 db_free_result($res);
228 * getGroup - get the Group object this Document is associated with.
230 * @return Object The Group object.
232 function &getGroup() {
237 * getID - get this docid.
239 * @return int The docid.
242 return $this->data_array['docid'];
246 * getName - get the name of this document.
248 * @return string The name of this document.
251 return $this->data_array['title'];
255 * getDescription - the description of this document.
257 * @return string The description.
259 function getDescription() {
260 return $this->data_array['description'];
264 * isURL - whether this document is a URL and not a local file.
266 * @return boolean is_url.
269 return ($this->data_array['filetype'] == 'URL');
273 * isText - whether this document is a text document and not a binary one.
275 * @return boolean is_text.
278 $doctype = $this->data_array['filetype'];
279 if (preg_match('|^text/|i', $doctype)) { // text plain, text html, text x-patch, etc
286 * isHtml - whether this document is a html document.
288 * @return boolean is_html.
291 $doctype = $this->data_array['filetype'];
292 if (preg_match('/html/i',$doctype)) {
299 * isPublic - whether this document is available to the general public.
301 * @return boolean is_public.
303 function isPublic() {
304 return (($this->data_array['stateid'] == 1) ? true : false);
308 * getStateID - get this stateid.
310 * @return int The stateid.
312 function getStateID() {
313 return $this->data_array['stateid'];
317 * getStateName - the statename of this document.
319 * @return string The statename.
321 function getStateName() {
322 return $this->data_array['state_name'];
326 * getDocGroupID - get this doc_group_id.
328 * @return int The doc_group_id.
330 function getDocGroupID() {
331 return $this->data_array['doc_group'];
335 * getDocGroupName - the doc_group_name of this document.
337 * @return string The docgroupname.
339 function getDocGroupName() {
340 return $this->data_array['group_name'];
344 * getCreatorID - get this creator's user_id.
346 * @return int The user_id.
348 function getCreatorID() {
349 return $this->data_array['created_by'];
353 * getCreatorUserName - the unix name of the person who created this document.
355 * @return string The unix name of the creator.
357 function getCreatorUserName() {
358 return $this->data_array['user_name'];
362 * getCreatorRealName - the real name of the person who created this document.
364 * @return string The real name of the creator.
366 function getCreatorRealName() {
367 return $this->data_array['realname'];
371 * getCreatorEmail - the email of the person who created this document.
373 * @return string The email of the creator.
375 function getCreatorEmail() {
376 return $this->data_array['email'];
380 * getFileName - the filename of this document.
382 * @return string The filename.
384 function getFileName() {
385 return $this->data_array['filename'];
389 * getFileType - the filetype of this document.
391 * @return string The filetype.
393 function getFileType() {
394 return $this->data_array['filetype'];
398 * getFileData - the filedata of this document.
400 * @return string The filedata.
402 function getFileData() {
404 // Because this could be a large string, we only fetch if we actually need it
406 $res = db_query_params('SELECT data FROM doc_data WHERE docid=$1', array($this->getID()));
407 return base64_decode(db_result($res, 0, 'data'));
411 * getFileSize - Return the size of the document
413 * @return int The file size
415 function getFileSize() {
416 return $this->data_array['filesize'];
420 * getUpdated - get the time this document was updated.
422 * @return int The epoch date this document was updated.
424 function getUpdated() {
425 return $this->data_array['updatedate'];
429 * getCreated - get the time this document was created.
431 * @return int The epoch date this document was created.
433 function getCreated() {
434 return $this->data_array['createdate'];
438 * getLocked - get the lock status of this document.
440 * @return int The lock status of this document.
442 function getLocked() {
443 return $this->data_array['locked'];
447 * getLockdate - get the lock time of this document.
449 * @return int The lock time of this document.
451 function getLockdate() {
452 return $this->data_array['lockdate'];
456 * getLockedBy - get the user id who set lock on this document.
458 * @return int The user id who set lock on this document.
460 function getLockedBy() {
461 return $this->data_array['locked_by'];
465 * getReservedBy - get the owner of the reversed status of this document.
467 * @return int The owner of the reversed status of this document.
469 function getReservedBy() {
470 return $this->data_array['reserved_by'];
474 * getReserved - get the reversed status of this document.
476 * @return int The reversed status of this document.
478 function getReserved() {
479 return $this->data_array['reserved'];
483 * getMonitoredUserEmailAddress - get the email addresses of users who monitor this file
485 * @return string The list of emails comma separated
487 function getMonitoredUserEmailAddress() {
488 $result = db_query_params('select users.email from users,docdata_monitored_docman where users.user_id = docdata_monitored_docman.user_id and docdata_monitored_docman.doc_id = $1', array ($this->getID()));
489 if (!$result || db_numrows($result) < 1) {
495 while ($arr = db_fetch_array($result)) {
499 $values .= $comma.$arr['email'];
507 * isMonitoredBy - get the monitored status of this document for a specific user id.
510 * @return boolean true if monitored by this user
512 function isMonitoredBy($userid = 'ALL') {
513 if ( $userid == 'ALL' ) {
516 $condition = 'user_id='.$userid.' AND';
518 $result = db_query_params('SELECT * FROM docdata_monitored_docman WHERE '.$condition.' doc_id=$1',
519 array($this->getID()));
521 if (!$result || db_numrows($result) < 1)
528 * removeMonitoredBy - remove this document for a specific user id for monitoring.
531 * @return boolean true if success
533 function removeMonitoredBy($userid) {
534 $result = db_query_params('DELETE FROM docdata_monitored_docman WHERE doc_id=$1 AND user_id=$2',
535 array($this->getID(), $userid));
538 $this->setError(_('Unable To Remove Monitor').' : '.db_error());
545 * addMonitoredBy - add this document for a specific user id for monitoring.
548 * @return boolean true if success
550 function addMonitoredBy($userid) {
551 $result = db_query_params('SELECT * FROM docdata_monitored_docman WHERE user_id=$1 AND doc_id=$2',
552 array($userid, $this->getID()));
554 if (!$result || db_numrows($result) < 1) {
555 $result = db_query_params('INSERT INTO docdata_monitored_docman (doc_id,user_id) VALUES ($1,$2)',
556 array($this->getID(), $userid));
559 $this->setError(_('Unable To Add Monitor').' : '.db_error());
567 * clearMonitor - remove all entries of monitoring for this document.
569 * @return boolean true if success.
571 function clearMonitor() {
572 $result = db_query_params('DELETE FROM docdata_monitored_docman WHERE doc_id = $1',
573 array($this->getID()));
578 * setState - set the stateid of the document.
580 * @param int The state id of the doc_states table.
581 * @return boolean success or not.
583 function setState($stateid) {
584 return $this->__setValueinDB('stateid', $stateid);
589 * setDocGroupID - set the doc_group of the document.
591 * @param int The group_id of this document.
592 * @return boolean success or not.
594 function setDocGroupID($newdocgroupid) {
595 return $this->__setValueinDB('doc_group', $newdocgroupid);
599 * setLock - set the locking status of the document.
601 * @param int The status of the lock.
602 * @param int The userid who set the lock.
603 * @param time the epoch time.
604 * @return boolean success or not.
606 function setLock($stateLock, $userid = NULL, $thistime = 0) {
607 $res = db_query_params('UPDATE doc_data SET
616 $this->Group->getID(),
619 if (!$res || db_affected_rows($res) < 1) {
620 $this->setOnUpdateError(_('Document lock failed').' '.db_error());
623 $this->data_array['locked'] = $stateLock;
624 $this->data_array['locked_by'] = $userid;
625 $this->data_array['lockdate'] = $thistime;
630 * setReservedBy - set the reserved status of the document and the owner
632 * @param int The status of the reserved
633 * @param int The ID of the owner : by default : noone
634 * @return boolean success
636 function setReservedBy($statusReserved, $idReserver = NULL) {
637 $res = db_query_params('UPDATE doc_data SET
642 array($statusReserved,
644 $this->Group->getID(),
647 if (!$res || db_affected_rows($res) < 1) {
648 $this->setOnUpdateError(_('Document reservation failed').' '.db_error());
651 $this->sendNotice(false);
656 * getFileTypeImage - return the file image for icon
658 * @return string the file image name
661 function getFileTypeImage() {
662 switch ($this->getFileType()) {
667 case "image/vnd.microsoft.icon":
668 case "image/svg+xml": {
669 $image = 'docman/file_type_image.png';
673 case "audio/x-vorbis+ogg":
675 $image = "docman/file_type_sound.png";
678 case "application/pdf": {
679 $image = 'docman/file_type_pdf.png';
684 $image = 'docman/file_type_html.png';
689 case "application/xml":
691 $image = 'docman/file_type_plain.png';
694 case "application/msword":
695 case "application/vnd.openxmlformats-officedocument.wordprocessingml.document":
696 case "application/vnd.oasis.opendocument.text": {
697 $image = 'docman/file_type_writer.png';
700 case "application/vnd.ms-excel":
701 case "application/vnd.oasis.opendocument.spreadsheet":
702 case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
703 $image = 'docman/file_type_spreadsheet.png';
706 case "application/vnd.oasis.opendocument.presentation":
707 case "application/vnd.ms-powerpoint":
708 case "application/vnd.ms-office":
709 case "application/vnd.openxmlformats-officedocument.presentationml.presentation": {
710 $image = 'docman/file_type_presentation.png';
713 case "application/zip":
714 case "application/x-tar":
715 case "application/x-rpm":
716 case "application/x-rar-compressed":
717 case "application/x-bzip2":
718 case "application/x-gzip":
719 case "application/x-lzip":
720 case "application/x-compress":
721 case "application/x-7z-compressed":
722 case "application/x-gtar":
723 case "application/x-stuffitx":
724 case "application/x-lzx":
725 case "application/x-lzh":
726 case "application/x-gca-compressed":
727 case "application/x-apple-diskimage":
728 case "application/x-dgc-compressed":
729 case "application/x-dar":
730 case "application/x-cfs-compressed":
731 case "application/vnd.ms-cab-compressed":
732 case "application/x-alz-compressed":
733 case "application/x-astrotite-afa":
734 case "application/x-ace-compressed":
735 case "application/x-cpio":
736 case "application/x-shar":
737 case "application/x-xz": {
738 $image = 'docman/file_type_archive.png';
742 $image = 'docman/file_type_unknown.png';
749 * update - use this function to update an existing entry in the database.
751 * @param string The filename of this document. Can be a URL.
752 * @param string The filetype of this document. If filename is URL, this should be 'URL';
753 * @param string The contents of this document.
754 * @param int The doc_group id of the doc_groups table.
755 * @param string The title of this document.
756 * @param string The description of this document.
757 * @param int The state id of the doc_states table.
758 * @return boolean success.
760 function update($filename, $filetype, $data, $doc_group, $title, $description, $stateid) {
762 $perm =& $this->Group->getPermission();
763 if (!$perm || !is_object($perm) || !$perm->isDocEditor()) {
764 $this->setPermissionDeniedError();
768 $user = session_get_user();
769 if ($this->getLocked() && ($this->getLockedBy() != $user->getID())) {
770 $this->setPermissionDeniedError();
774 if (strlen($title) < 5) {
775 $this->setError(_('Title Must Be At Least 5 Characters'));
779 if (strlen($description) < 10) {
780 $this->setError(_('Document Description Must Be At Least 10 Characters'));
784 /* TODO : NEED REAL CHECK */
786 $result = db_query_params('SELECT filename, doc_group FROM docdata_vw WHERE filename = $1 AND doc_group = $2 AND stateid = $3 AND docid != $4',
787 array($filename, $doc_group, $stateid, $this->getID()));
788 if (!$result || db_numrows($result) > 0) {
789 $this->setError(_('Document already published in this directory'));
794 $res = db_query_params('UPDATE doc_data SET
806 array(htmlspecialchars($title),
807 htmlspecialchars($description),
815 $this->Group->getID(),
819 if (!$res || db_affected_rows($res) < 1) {
820 $this->setOnUpdateError(db_error());
827 // key words for in-document search
828 if ($this->Group->useDocmanSearch()) {
829 $kw = new Parsedata();
830 $kwords = $kw->get_parse_data($data1, htmlspecialchars($title), htmlspecialchars($description), $filetype);
835 $res = db_query_params('UPDATE doc_data SET filesize=$1, data_words=$2 WHERE group_id=$3 AND docid=$4',
838 $this->Group->getID(),
842 if (!$res || db_affected_rows($res) < 1) {
843 $this->setOnUpdateError(db_error());
847 switch ($this->Group->getStorageAPI()) {
849 $res = db_query_params('UPDATE doc_data SET data = $1 where group_id = $2 and docid = $3',
850 array(base64_encode($data),
851 $this->Group->getID(),
855 if (!$res || db_affected_rows($res) < 1) {
856 $this->setOnUpdateError(db_error());
862 $this->setOnUpdateError(_('No Storage API'));
868 $this->sendNotice(false);
873 * sendNotice - Notifies of document submissions
875 * @param boolean true = new document (default value)
877 function sendNotice($new=true) {
878 $BCC = $this->Group->getDocEmailAddress();
879 if ($this->isMonitoredBy('ALL')) {
880 $BCC .= $this->getMonitoredUserEmailAddress();
882 if (strlen($BCC) > 0) {
884 $status = _('New document');
886 $status = _('Updated document');
888 $subject = '['.$this->Group->getPublicName().'] '.$status.' - '.$this->getName();
889 $body = _('Project:').' '.$this->Group->getPublicName()."\n";
890 $body .= _('Directory:').' '.$this->getDocGroupName()."\n";
891 $body .= _('Document title:').' '.$this->getName()."\n";
892 $body .= _('Document description:').' '.util_unconvert_htmlspecialchars($this->getDescription())."\n";
893 $body .= _('Submitter:').' '.$this->getCreatorRealName()." (".$this->getCreatorUserName().") \n";
894 $body .= "\n\n-------------------------------------------------------\n".
895 _('For more info, visit:').
896 "\n\n" . util_make_uri('/docman/?group_id='.$this->Group->getID().'&view=listfile&dirid='.$this->getDocGroupID());
898 util_send_message('', $subject, $body, '', $BCC);
905 * delete - Delete this file
907 * @return boolean success
910 $perm =& $this->Group->getPermission();
911 if (!$perm || !is_object($perm) || !$perm->isDocEditor()) {
912 $this->setPermissionDeniedError();
916 $result = db_query_params('DELETE FROM doc_data WHERE docid=$1',
917 array($this->getID()));
919 $this->setError(_('Error Deleting Document:').' '.db_error());
924 switch ($this->Group->getStorageAPI()) {
929 $this->setError(_('Error Deleting Document: No Storage API'));
935 /** we should be able to send a notice that this doc has been deleted .... but we need to rewrite sendNotice
936 * $this->sendNotice(false);
937 * @TODO delete monitoring this file */
942 * trash - move this file to trash
944 * @return boolean success or not.
947 $this->setState('2');
948 $dm = new DocumentManager($this->Group);
949 $this->setDocGroupID($dm->getTrashID());
951 $this->setReservedBy(0);
952 $this->sendNotice(false);
953 $this->clearMonitor();
958 * __setValueinDB - private function to update columns in db
960 * @param string the column to update
961 * @param int the value to store
962 * @return boolean success or not
965 private function __setValueinDB($column, $value) {
969 $qpa = db_construct_qpa();
970 $qpa = db_construct_qpa($qpa, 'UPDATE doc_data SET ');
971 $qpa = db_construct_qpa($qpa, $column);
972 $qpa = db_construct_qpa($qpa, '=$1
976 $this->Group->getID(),
978 $res = db_query_qpa($qpa);
979 if (!$res || db_affected_rows($res) < 1) {
980 $this->setOnUpdateError(db_error().print_r($qpa));
986 $this->setOnUpdateError(_('wrong column name'));
989 $this->sendNotice(false);
993 function createVersion() {
997 function deleteVersion() {
1001 function editFile() {
1002 $editfileaction = '?action=editfile&fromview=listfile&dirid='.$this->getDocGroupID();
1003 if (isset($GLOBALS['childgroup_id']) && $GLOBALS['childgroup_id']) {
1004 $editfileaction .= '&childgroup_id='.$GLOBALS['childgroup_id'];
1006 $editfileaction .= '&group_id='.$GLOBALS['group_id'];
1008 <script language="JavaScript" type="text/javascript">/* <![CDATA[ */
1009 function doItEditData<?php echo $this->getID(); ?>() {
1010 document.getElementById('editdata<?php echo $this->getID(); ?>').submit();
1011 document.getElementById('submiteditdata<?php echo $this->getID(); ?>').disabled = true;
1014 <h3><?php echo _('Document Edit') ?></h3>
1017 <strong><?php echo _('Document Title:') ?></strong>
1018 <?php echo _('Refers to the relatively brief title of the document (e.g. How to use the download server).') ?>
1021 <strong><?php echo _('Description:') ?></strong>
1022 <?php echo _('A brief description to be placed just under the title.') ?>
1025 if ($this->Group->useDocmanSearch())
1026 echo '<p>'. _('Both fields are used by document search engine.'). '</p>';
1029 <form id="editdata<?php echo $this->getID(); ?>" name="editdata<?php echo $this->getID(); ?>" action="<?php echo $editfileaction ?>" method="post" enctype="multipart/form-data">
1034 <strong><?php echo _('Document Title:') ?> </strong><?php echo utils_requiredField(); ?> <?php printf(_('(at least %1$s characters)'), 5) ?><br />
1035 <input type="text" name="title" size="40" maxlength="255" value="<?php echo $this->getName(); ?>" />
1041 <strong><?php echo _('Description:') ?> </strong><?php echo utils_requiredField(); ?> <?php printf(_('(at least %1$s characters)'), 10) ?><br />
1042 <input type="text" name="description" size="50" maxlength="255" value="<?php echo $this->getDescription(); ?>" />
1048 <strong><?php echo _('File')?></strong><?php echo utils_requiredField(); ?><br />
1049 <?php if ($this->isURL()) {
1050 echo '<a href="'.inputSpecialchars($this->getFileName()).'">['. _('View File URL') .']</a>';
1052 <a target="_blank" href="view.php/<?php echo $this->Group->getID().'/'.$this->getID().'/'.urlencode($this->getFileName()) ?>"><?php echo $this->getFileName(); ?></a>
1059 if ((!$this->isURL()) && ($this->isText()) && $this->getStateID() != '2') {
1060 if ($this->Group->useCreateOnline()) {
1063 echo _('Edit the contents to your desire or leave them as they are to remain unmodified.');
1064 switch ($this->getFileType()) {
1066 $GLOBALS['editor_was_set_up']=false;
1068 /* name must be != data then nothing is displayed */
1069 $params['name'] = 'details'.$this->getID();
1070 $params['height'] = "300";
1071 $params['group'] = $this->Group->getID();
1072 $params['body'] = $this->getFileData();
1073 plugin_hook("text_editor",$params);
1074 if (!$GLOBALS['editor_was_set_up']) {
1075 echo '<textarea name="details'.$this->getID().'" rows="15" cols="70">'. $this->getFileData() .'</textarea><br />';
1077 unset($GLOBALS['editor_was_set_up']);
1078 echo '<input type="hidden" name="filetype" value="text/html">';
1082 echo '<textarea name="details'.$this->getID().'" rows="15" cols="70">'. $this->getFileData() .'</textarea><br />';
1083 echo '<input type="hidden" name="filetype" value="text/plain">';
1093 <strong><?php echo _('Folder that document belongs in') ?></strong><br />
1095 $newdgf = new DocumentGroupFactory($this->Group);
1096 $newdgh = new DocumentGroupHTML($this->Group);
1097 if ($this->getStateID() == 2) {
1098 $newdgh->showSelectNestedGroups($newdgf->getNested(), 'doc_group', false, false);
1100 $newdgh->showSelectNestedGroups($newdgf->getNested(), 'doc_group', false, $this->getDocGroupID());
1106 <strong><?php echo _('State') ?>:</strong><br />
1108 if ($this->getStateID() == 2) {
1109 doc_get_state_box('xzxz', $this->getStateID());
1111 doc_get_state_box('xzxz');
1118 <?php if ($this->getStateID() != '2') {
1119 if ($this->isURL()) { ?>
1120 <strong><?php echo _('Specify an outside URL where the file will be referenced') ?> :</strong><?php echo utils_requiredField(); ?><br />
1121 <input type="text" name="file_url" size="50" value="<?php echo $this->getFileName() ?>" />
1123 <strong><?php echo _('OPTIONAL: Upload new file') ?></strong><br />
1124 <input type="file" name="uploaded_data" size="30" />
1132 <input type="hidden" name="docid" value="<?php echo $this->getID(); ?>" />
1133 <input type="button" id="submiteditdata<?php echo $this->getID(); ?>" value="<?php echo _('Submit Edit') ?>" onclick="javascript:doItEditData<?php echo $this->getID(); ?>()" />
1141 // c-file-style: "bsd"