33 $this->
id = (int)$a_id;
52 $this->title = $a_title;
70 $this->description = $a_value;
88 $this->pool_id = (int)$a_pool_id;
106 $this->schedule_id = (int)$a_schedule_id;
124 $this->nr_of_items = (int)$a_value;
142 $this->info_file = $a_value;
159 if($this->
id && $this->info_file)
162 return $path.$this->info_file;
182 $original = $a_upload[
"name"];
184 if(@move_uploaded_file($a_upload[
"tmp_name"],
$path.$original))
186 chmod(
$path.$original, 0770);
216 $this->post_text = $a_value;
234 $this->post_file = $a_value;
251 if($this->
id && $this->post_file)
254 return $path.$this->post_file;
274 $original = $a_upload[
"name"];
276 if(@move_uploaded_file($a_upload[
"tmp_name"],
$path.$original))
278 chmod(
$path.$original, 0770);
309 include_once
"Modules/BookingManager/classes/class.ilFSStorageBooking.php";
327 include_once
"Modules/BookingManager/classes/class.ilFSStorageBooking.php";
331 $path = $storage->getAbsolutePath().
"/";
335 $path .= $a_subdir.
"/";
355 $set =
$ilDB->query(
'SELECT *'.
356 ' FROM booking_object'.
357 ' WHERE booking_object_id = '.
$ilDB->quote($this->id,
'integer'));
377 'title' => array(
'text', $this->
getTitle()),
381 'info_file' => array(
'text', $this->
getFile()),
382 'post_text' => array(
'text', $this->
getPostText()),
402 $this->
id = $ilDB->nextId(
'booking_object');
405 $fields[
'booking_object_id'] = array(
'integer', $this->
id);
406 $fields[
'pool_id'] = array(
'integer', $this->
getPoolId());
408 return $ilDB->insert(
'booking_object', $fields);
426 return $ilDB->update(
'booking_object', $fields,
427 array(
'booking_object_id'=>array(
'integer', $this->
id)));
439 $set =
$ilDB->query(
'SELECT *'.
440 ' FROM booking_object'.
441 ' WHERE pool_id = '.
$ilDB->quote($a_pool_id,
'integer').
463 return $ilDB->manipulate(
'DELETE FROM booking_object'.
464 ' WHERE booking_object_id = '.
$ilDB->quote($this->id,
'integer'));
479 $set =
$ilDB->query(
"SELECT booking_object_id,nr_items".
480 " FROM booking_object".
481 " WHERE ".
$ilDB->in(
"booking_object_id", $a_obj_ids,
"",
"integer"));
484 $map[
$row[
"booking_object_id"]] =
$row[
"nr_items"];
490 public function doClone($a_pool_id, $a_schedule_map =
null)
492 $new_obj =
new self();
493 $new_obj->setPoolId($a_pool_id);
494 $new_obj->setTitle($this->
getTitle());
497 $new_obj->setFile($this->
getFile());
514 $target = $new_obj->initStorage($new_obj->getId());
setScheduleId($a_schedule_id)
Set booking schedule id.
setFile($a_value)
Set info file.
uploadFile(array $a_upload)
Upload new info file.
setTitle($a_title)
Set object title.
getScheduleId()
Get booking schedule id.
getPostText()
Get post text.
static getNrOfItemsForObjects(array $a_obj_ids)
Get nr of available items
getPostFile()
Get post file.
setPoolId($a_pool_id)
Set booking pool id.
getTitle()
Get object title.
getNrOfItems()
Get number of items.
setPostFile($a_value)
Set post file.
static getList($a_pool_id)
Get list of booking objects for given type
deleteFile()
remove existing info file
uploadPostFile(array $a_upload)
Upload new post file.
setDescription($a_value)
Set object description.
getPoolId()
Get booking pool id.
__construct($a_id=NULL)
Constructor.
doClone($a_pool_id, $a_schedule_map=null)
setNrOfItems($a_value)
Set number of items.
getFileFullPath()
Get path to info file.
setPostText($a_value)
Set post text.
getDescription()
Get object description.
deleteFiles()
remove existing files
save()
Create new entry in db.
getPostFileFullPath()
Get path to post file.
getDBFields()
Parse properties for sql statements.
deletePostFile()
remove existing post file
static initStorage($a_id, $a_subdir=null)
Init file system storage.
update()
Update entry in db.
read()
Get dataset from db.
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.