Ejemplo n.º 1
0
 /**
  * @permissions view
  * @return string
  */
 protected function actionShowAssignedRecords()
 {
     //load tag
     $objTag = new class_module_tags_tag($this->getSystemid());
     //get assigned record-ids
     $objArraySectionIterator = new class_array_section_iterator($objTag->getIntAssignments());
     $objArraySectionIterator->setPageNumber((int) ($this->getParam("pv") != "" ? $this->getParam("pv") : 1));
     $objArraySectionIterator->setArraySection($objTag->getArrAssignedRecords($objArraySectionIterator->calculateStartPos(), $objArraySectionIterator->calculateEndPos()));
     return $this->renderList($objArraySectionIterator, false, "assignedTagList");
 }
Ejemplo n.º 2
0
 public function testTagAssignmentRemoval()
 {
     //related to checkin #6111
     $objTag = new class_module_tags_tag();
     $objTag->setStrName(generateSystemid());
     $objTag->updateObjectToDb();
     $objAspect = new class_module_system_aspect();
     $objAspect->setStrName(generateSystemid());
     $objAspect->updateObjectToDb();
     $objTag->assignToSystemrecord($objAspect->getSystemid());
     $this->flushDBCache();
     $this->assertEquals(count($objTag->getArrAssignedRecords()), 1);
     $this->assertEquals(count(class_module_tags_tag::getTagsForSystemid($objAspect->getSystemid())), 1);
     $objTag->removeFromSystemrecord($objAspect->getSystemid(), "");
     $this->flushDBCache();
     $this->assertEquals(count($objTag->getArrAssignedRecords()), 0);
     $this->assertEquals(count(class_module_tags_tag::getTagsForSystemid($objAspect->getSystemid())), 0);
     $objTag->deleteObjectFromDatabase();
     $objAspect->deleteObjectFromDatabase();
 }