Esempio n. 1
0
 static function getCategoryIds($id)
 {
     return OsEntity::getCategoryIds($id);
 }
Esempio n. 2
0
$addressLinks = array();
if ($entity['primary_ext'] == 'Org') {
    ?>
  <?php 
    $addresses = Doctrine::getTable('Address')->findByEntityId($entity['id']);
    ?>
  <?php 
    foreach ($addresses as $address) {
        ?>
    <?php 
        $addressLinks[] = address_link($address);
        ?>
  <?php 
    }
}
?>

<?php 
$categoryLinks = array();
$categories = OsEntity::getCategoriesForDisplay($entity['id']);
foreach ($categories as $category) {
    ?>
  <?php 
    $categoryLinks[] = category_link($category);
}
?>

<?php 
include_partial('global/datatable', array('data' => array('Aliases' => $aliases = EntityTable::getAliasNamesById($entity['id'], false), 'Networks' => $networkLinks, 'Industries' => $categoryLinks, 'Addresses' => $addressLinks), 'label_width' => '100px'));
?>
</div>
Esempio n. 3
0
 public function executeAddIndustry($request)
 {
     $this->checkEntity($request, false, false);
     if ($request->isMethod('post')) {
         $catId = $request->getParameter('category');
         $count = LsDoctrineQuery::create()->from('OsCategory c')->where('c.category_id = ?', $catId)->count();
         if (!$count) {
             $this->forward404();
         }
         if (!in_array($catId, OsEntity::getCategoryIds($this->entity['id']))) {
             $ec = new OsEntityCategory();
             $ec->entity_id = $this->entity['id'];
             $ec->category_id = $catId;
             $ec->source = "user_id: " . $this->getUser()->getGuardUser()->id;
             $ec->save();
         }
         $this->redirect(EntityTable::getInternalUrl($this->entity, 'editIndustries'));
     }
     $this->categories = Doctrine::getTable('OsCategory')->findAll(Doctrine::HYDRATE_ARRAY);
     usort($this->categories, array('OsCategoryTable', 'categoryCmp'));
     $this->existing_category_ids = OsEntity::getCategoryIds($this->entity['id']);
 }