46 var
$fields = array(
"document_id" => Number,
50 "publication_date" => Date,
53 "publication" => String,
57 "last_modified" => Timestamp,
58 "document_library_id" => Number,
60 "allow_access" => String
73 "url" =>
"External URL");
99 $owner = $this->
Owner();
101 return ($owner->user_id ==
$user->user_id) ?
true :
false;
118 checkRole(
$library->upload_files) || checkRole(
$library->delete_files) || $member)
142 $this->primary_key =
"document_id";
143 $this->table =
"document";
147 $this->relations[
"Owner"] =
$mgr->getUserClass();
149 $this->default_format =
"{title}";
151 $this->DataItem(func_get_args());
156 trace(
"Searching Documents", 3);
161 $range =
" AND {$this->primary_key} IN (".implode(
$range,
", ").
")";
164 if (is_object($params))
171 if (!
$search->get(
"text",
"like"))
173 $search->secondaryFields(
"author",
"notes",
"publication");
177 $search->remapField(
"text",
"notes");
191 $params = preg_replace(
'/[^\w]+/',
' ', $params);
192 $params =
"%$params%";
193 $documents = Query::create(
Document,
"WHERE (title like :a OR keywords LIKE :b OR notes Like :c) and public=1 $range")
194 ->bind(
":a", $params,
":b", $params,
":c", $params)
213 function prettifyClassName($plural =
false) {
return $this->item->prettifyClassName($plural =
false); }
223 return $this->item->title;
228 return $this->item->publication_date;
233 $file = $this->item->file;
235 $library = $this->item->DocumentLibrary();
240 $link =
"/document_details";
241 $linkText =
"View Details";
245 $link =
"/action/document/download";
246 $linkText =
"Download";
250 return $this->item->format(
"<h4>{title}</h4><p><em>{author} {publication_date:short}</em></p>{$img} <a href='{$link}?document_id={document_id}'>{$linkText}</a> $size");
261 var
$fields = array(
"document_comment_id" => Number,
262 "document_id" => Number,
263 "comment_id" => Number);
279 catch(DataNotFoundException $e)
289 $url =
"document_details?document_id={$this->document_id}";
290 return $url . $this->format(
"#comment{comment_id}");
300 return $this->getRelated(
Comment);
316 return "WHERE public=1";
321 return "{title:xml}";
331 return "{author:xml}";
336 return "{keywords:xml}";
if(! $document_library_id) $library
This class maps the publication table.
search($params, $range=null)
DataItems must implement this method to provide search functionality.
summary()
Display the item title and any other essential details for the item such as author and a create date.
DocumentSearchResult($item)
prettifyClassName($plural=false)
static wrap($items, $resultClass)
static getValue($component, $name)
Retrieve the value of the specified Setting.
This class maps the topic table.
Provides the interface to the user model for the application.
if(! $document_id) $document
The Searchable interface must be implemented by any DataItem classes that want to be searchable via t...
$table column("Redirect From", "<a href='redirect_form?redirect_id={redirect_id}'>{redirect_from}</a>", true, "width: 30%") -> column("Redirect To", "<a href='{redirect_to}' target='_blank'>{redirect_to}</a>", true, "width: 30%") ->column("Last Modified", "{last_modified}", true, "width: 20%; text-align: center") ->column("Override", "{ override true