32 include_once
'class.ilMDBase.php';
39 include_once
'Services/MetaData/classes/class.ilMDEntity.php';
45 include_once
'Services/MetaData/classes/class.ilMDEntity.php';
51 $ent->setMetaId($a_entity_id);
57 include_once
'Services/MetaData/classes/class.ilMDEntity.php';
61 $ent->setParentType(
'meta_contribute');
76 case 'GraphicalDesigner':
77 case 'TechnicalImplementer':
78 case 'ContentProvider':
79 case 'TechnicalValidator':
80 case 'EducationalValidator':
82 case 'InstructionalDesigner':
83 case 'SubjectMatterExpert':
86 case 'PointOfContact':
87 $this->role = $a_role;
100 $this->date = $a_date;
112 $ilDB = $DIC[
'ilDB'];
115 $fields[
'meta_contribute_id'] = array(
'integer',$next_id =
$ilDB->nextId(
'il_meta_contribute'));
117 if ($this->db->insert(
'il_meta_contribute', $fields)) {
128 $ilDB = $DIC[
'ilDB'];
131 if ($this->db->update(
132 'il_meta_contribute',
133 $this->__getFields(),
134 array(
"meta_contribute_id" => array(
'integer',$this->
getMetaId()))
142 public function delete()
146 $ilDB = $DIC[
'ilDB'];
149 $query =
"DELETE FROM il_meta_contribute " .
150 "WHERE meta_contribute_id = " .
$ilDB->quote($this->
getMetaId(),
'integer');
165 return array(
'rbac_id' => array(
'integer',$this->
getRBACId()),
166 'obj_id' => array(
'integer',$this->
getObjId()),
167 'obj_type' => array(
'text',$this->
getObjType()),
169 'parent_id' => array(
'integer',$this->
getParentId()),
170 'role' => array(
'text',$this->
getRole()),
171 'c_date' => array(
'text',$this->
getDate()));
178 $ilDB = $DIC[
'ilDB'];
180 include_once
'Services/MetaData/classes/class.ilMDLanguageItem.php';
183 $query =
"SELECT * FROM il_meta_contribute " .
184 "WHERE meta_contribute_id = " .
$ilDB->quote($this->
getMetaId(),
'integer');
207 $writer->xmlStartTag(
'Contribute', array(
'Role' => $this->
getRole()
213 foreach ($entities as
$id) {
215 $ent->toXML($writer);
217 if (!count($entities)) {
218 include_once
'Services/MetaData/classes/class.ilMDEntity.php';
220 $ent->toXML($writer);
223 $writer->xmlElement(
'Date', null, $this->
getDate());
224 $writer->xmlEndTag(
'Contribute');
229 public static function _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
233 $ilDB = $DIC[
'ilDB'];
235 $query =
"SELECT meta_contribute_id FROM il_meta_contribute " .
236 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
" " .
237 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" " .
238 "AND parent_id = " .
$ilDB->quote($a_parent_id,
'integer') .
" " .
239 "AND parent_type = " .
$ilDB->quote($a_parent_type,
'text');
243 $ids[] =
$row->meta_contribute_id;
245 return $ids ? $ids : array();
263 $ilDB = $DIC[
'ilDB'];
266 $query =
"SELECT entity,ent.parent_type,role FROM il_meta_entity ent " .
267 "JOIN il_meta_contribute con ON ent.parent_id = con.meta_contribute_id " .
268 "WHERE ent.rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
" " .
269 "AND ent.obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" ";
272 if (
$row->role ==
'Author' and $row->parent_type ==
'meta_contribute') {
273 $authors[] = trim(
$row->entity);
276 return $authors ? $authors : array();
& getEntity($a_entity_id)
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
if(!array_key_exists('StateId', $_REQUEST)) $id
static _getIds($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
static _lookupAuthors($a_rbac_id, $a_obj_id, $a_obj_type)
Lookup authors.
setMetaId($a_meta_id, $a_read_data=true)
foreach($_POST as $key=> $value) $res
setParentType($a_parent_type)