32 include_once
'class.ilMDBase.php';
47 include_once
'Services/MetaData/classes/class.ilMDEntity.php';
53 include_once
'Services/MetaData/classes/class.ilMDEntity.php';
60 $ent->setMetaId($a_entity_id);
66 include_once
'Services/MetaData/classes/class.ilMDEntity.php';
70 $ent->setParentType(
'meta_contribute');
86 case 'GraphicalDesigner':
87 case 'TechnicalImplementer':
88 case 'ContentProvider':
89 case 'TechnicalValidator':
90 case 'EducationalValidator':
92 case 'InstructionalDesigner':
93 case 'SubjectMatterExpert':
96 case 'PointOfContact':
97 $this->role = $a_role;
110 $this->date = $a_date;
123 $fields[
'meta_contribute_id'] = array(
'integer',$next_id = $ilDB->nextId(
'il_meta_contribute'));
125 if($this->db->insert(
'il_meta_contribute',$fields))
139 if($this->db->update(
'il_meta_contribute',
140 $this->__getFields(),
141 array(
"meta_contribute_id" => array(
'integer',$this->
getMetaId()))))
155 $query =
"DELETE FROM il_meta_contribute ".
156 "WHERE meta_contribute_id = ".$ilDB->quote($this->
getMetaId() ,
'integer');
172 return array(
'rbac_id' => array(
'integer',$this->
getRBACId()),
173 'obj_id' => array(
'integer',$this->
getObjId()),
174 'obj_type' => array(
'text',$this->
getObjType()),
176 'parent_id' => array(
'integer',$this->
getParentId()),
177 'role' => array(
'text',$this->
getRole()),
178 'c_date' => array(
'text',$this->
getDate()));
185 include_once
'Services/MetaData/classes/class.ilMDLanguageItem.php';
189 $query =
"SELECT * FROM il_meta_contribute ".
190 "WHERE meta_contribute_id = ".$ilDB->quote($this->
getMetaId() ,
'integer');
214 $writer->xmlStartTag(
'Contribute',array(
'Role' => $this->
getRole()
220 foreach($entities as $id)
223 $ent->toXML($writer);
225 if(!count($entities))
227 include_once
'Services/MetaData/classes/class.ilMDEntity.php';
229 $ent->toXML($writer);
232 $writer->xmlElement(
'Date',null,$this->
getDate());
233 $writer->xmlEndTag(
'Contribute');
238 function _getIds($a_rbac_id,$a_obj_id,$a_parent_id,$a_parent_type)
242 $query =
"SELECT meta_contribute_id FROM il_meta_contribute ".
243 "WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,
'integer').
" ".
244 "AND obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ".
245 "AND parent_id = ".$ilDB->quote($a_parent_id ,
'integer').
" ".
246 "AND parent_type = ".$ilDB->quote($a_parent_type ,
'text');
251 $ids[] =
$row->meta_contribute_id;
253 return $ids ? $ids : array();
272 $query =
"SELECT entity,ent.parent_type,role FROM il_meta_entity ent ".
273 "JOIN il_meta_contribute con ON ent.parent_id = con.meta_contribute_id ".
274 "WHERE ent.rbac_id = ".$ilDB->quote($a_rbac_id ,
'integer').
" ".
275 "AND ent.obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ";
279 if(
$row->role ==
'Author' and
$row->parent_type ==
'meta_contribute')
281 $authors[] = trim(
$row->entity);
284 return $authors ? $authors : array();