コード例 #1
0
 static function convertValueForDisplay($value, $field, $excerpt = 40)
 {
     if (is_null($value)) {
         return 'NULL';
     }
     if (!($mod = self::loadModification($field))) {
         return $value;
     }
     $table = Doctrine::getTable($mod['object_model']);
     $columns = $table->getColumns();
     if ($mod['object_model'] == 'Entity') {
         if (!array_key_exists($field['field_name'], $columns)) {
             if ($extensionName = EntityTable::getExtensionNameByFieldName($field['field_name'])) {
                 $table = Doctrine::getTable($extensionName);
             }
         }
     } elseif ($mod['object_model'] == 'Relationship') {
         if (!array_key_exists($field['field_name'], $columns)) {
             $table = Doctrine::getTable(RelationshipTable::getCategoryNameByFieldName($field['field_name']));
         }
     }
     if ($alias = self::getFieldNameAlias($field)) {
         $class = $table->getRelation($alias)->getClass();
         if ($record = Doctrine::getTable($class)->find($value, Doctrine::HYDRATE_ARRAY)) {
             if ($class == 'Entity') {
                 sfLoader::loadHelpers('Ls');
                 return entity_link($record, null);
             } elseif ($class == 'sfGuardUser') {
                 sfLoader::loadHelpers('Ls');
                 return user_link($record);
             }
             return $record;
         }
     }
     if (in_array($field['field_name'], array('start_date', 'end_date'))) {
         return Dateable::convertForDisplay($value);
     }
     $def = $table->getColumnDefinition($field['field_name']);
     switch ($def['type']) {
         case 'integer':
             return (double) $value;
             break;
         case 'boolean':
             return $value ? 'yes' : 'no';
             break;
     }
     if ($excerpt) {
         $short = LsString::excerpt($value, $excerpt);
         return $short == $value ? $value : '<span title="' . strip_tags($value) . '">' . $short . '</span>';
     }
     return $value;
 }
コード例 #2
0
 public function convertValueForDisplay($value)
 {
     if (is_null($value)) {
         return '<span class="text_small">NULL</span>';
     }
     if (!($record = $this->Modification->getObject(true))) {
         return $value;
     }
     $table = $record->getTable();
     if ($record instanceof Entity) {
         $data = $record->getData();
         if (!array_key_exists($this->field_name, $data)) {
             if ($extensionName = EntityTable::getExtensionNameByFieldName($this->field_name)) {
                 $table = Doctrine::getTable($extensionName);
             }
         }
     } elseif ($record instanceof Relationship) {
         $data = $record->getData();
         if (!array_key_exists($this->field_name, $data)) {
             $table = Doctrine::getTable(RelationshipTable::getCategoryNameByFieldName($this->field_name));
         }
     }
     if ($alias = $this->getFieldNameAlias()) {
         $class = $table->getRelation($alias)->getClass();
         if ($record = Doctrine::getTable($class)->find($value)) {
             if ($record instanceof Entity) {
                 sfLoader::loadHelpers('Ls');
                 return entity_link($record, null);
             }
             return $record;
         }
     }
     if (in_array($this->field_name, array('start_date', 'end_date'))) {
         return Dateable::convertForDisplay($value);
     }
     $def = $table->getColumnDefinition($this->field_name);
     switch ($def['type']) {
         case 'integer':
             return (string) $value;
             break;
         case 'boolean':
             return $value ? 'yes' : 'no';
             break;
     }
     return LsString::excerpt($value);
 }
コード例 #3
0
ファイル: toolbarSuccess.php プロジェクト: silky/littlesis
  }

  if (!refSource || !refName)
  {
    alert('You must complete the source fields');
    return false;
  }
  
  return true;
}

<?php 
if (isset($entity1)) {
    ?>
  var bulkEntityLink = '<?php 
    echo str_replace("'", "\\'", entity_link($entity1));
    ?>
';
  <?php 
    echo "setEntity(" . ($is_switched ? '2' : '1') . ", " . $entity1['id'] . ", '" . $entity1['primary_ext'] . "', bulkEntityLink);";
}
?>

<?php 
if (isset($entity2_name)) {
    ?>
  $('entity<?php 
    echo $is_switched ? 1 : 2;
    ?>
_input').value = "<?php 
    echo $entity2_name;
コード例 #4
0
ファイル: addressSuccess.php プロジェクト: silky/littlesis
<?php 
}
?>

<?php 
if (isset($nearby_address_pager) && $nearby_address_pager->getCountQuery()->count()) {
    ?>

<?php 
    include_partial('global/section', array('title' => 'Nearby Entities', 'pager' => $nearby_address_pager));
    ?>

<div class="padded">
<?php 
    foreach ($nearby_address_pager->execute() as $address) {
        ?>
  <?php 
        echo entity_link($address->Entity);
        ?>
 (<?php 
        echo link_to($address->getOneLiner(), 'entity/address?id=' . $address->id);
        ?>
)
  <br />
<?php 
    }
    ?>
</div>

<?php 
}
コード例 #5
0
ファイル: childOrgsSuccess.php プロジェクト: silky/littlesis
<?php

include_partial('entity/basic', array('entity' => $entity));
?>

<?php 
include_partial('global/subsection', array('title' => 'Child Organizations', 'pager' => $children_pager, 'pointer' => 'Subgroups of ' . $entity->name));
?>

<div class="padded">
<?php 
foreach ($children_pager->execute() as $child) {
    ?>
  <?php 
    echo entity_link($child);
    ?>
  <br />
<?php 
}
?>
</div>
コード例 #6
0
ファイル: _entityresults.php プロジェクト: silky/littlesis
<div class="section" style="display: block;">
  <span class="section_title">Matches</span>
</div>
<div class="section_meta" style="display: block;"><?php 
echo pager_meta($entity_pager);
?>
</div>


<div class="padded" style="display: block;">
<?php 
foreach ($entity_pager->execute() as $entity) {
    ?>

  <?php 
    $innerHtml = '<span class="text_big">' . entity_link($entity) . '</span> ' . input_hidden_tag('relationship[' . strtolower($entityField) . '_id]', $entity->id);
    ?>
  <?php 
    $innerHtml = str_replace('"', '\\\'', $innerHtml);
    ?>

  <?php 
    include_partial('entity/oneliner', array('entity' => $entity, 'actions' => array(array('raw' => '<a href="javascript:void(0);" onclick="selectEntity(\'' . $innerHtml . '\', \'' . strtolower($entityField) . '\');">select</a>'))));
    ?>

<?php 
}
?>
</div>
コード例 #7
0
    <?php 
echo entity_link($object, null);
?>
  </td>
  <td style='padding-bottom:.6em'>
    <?php 
$recipients = LsDoctrineQuery::create()->from('Entity e')->andWhereIn('e.id', explode(',', $object['degree1_ids']))->fetchArray();
?>
    <?php 
echo LsNumber::makeReadable($object['total'], '$');
?>
  </td>
  <td style='padding-bottom:.6em'>
    <?php 
$recipientLinks = array();
?>
    <?php 
foreach ($recipients as $recipient) {
    ?>
      <?php 
    $recipientLinks[] = entity_link($recipient, null, false);
    ?>
    <?php 
}
?>
    <?php 
echo implode(', ', $recipientLinks);
?>
  </td>
</tr>
コード例 #8
0
ファイル: _connecttorow.php プロジェクト: silky/littlesis
<tr>
  <td>
    <?php 
echo entity_link($object, null);
?>
    <?php 
$rels = LsDoctrineQuery::create()->from('Relationship r')->andWhereIn('r.id', explode(',', $object['relationship_ids']))->fetchArray();
?>
    <?php 
$rel_links = array();
?>
    <?php 
foreach ($rels as $rel) {
    ?>
      <?php 
    $rel_links[] = trim(get_partial('relationship/oneliner', array('relationship' => $rel, 'profiled_entity' => $base_object, 'related_entity' => $object)));
    ?>
    <?php 
}
?>
  
    <?php 
echo implode(' ', $rel_links);
?>
  </td>
</tr>
コード例 #9
0
ファイル: _similarEntities.php プロジェクト: silky/littlesis
  No similar names found.
  <br />
  <div style="padding-top: .5em">
  <?php 
        echo link_to('Look for possible merges &raquo;', EntityTable::getInternalUrl($entity, 'merge'));
        ?>
  </div>
<?php 
    } else {
        ?>
  <div class="padded">
  <?php 
        foreach ($similar_entities as $similar_entity) {
            ?>
    <?php 
            echo entity_link($similar_entity, null);
            ?>
    <br />
  <?php 
        }
        ?>
  <br />
  <?php 
        echo link_to('Begin merging process &raquo;', EntityTable::getInternalUrl($entity, 'merge'));
        ?>
  </div>
<?php 
    }
    ?>

</div>
コード例 #10
0
<tr class="hover">
  <td>
    <span class="text_big">
    <?php 
if ($object->Entity1->id == $base_object->id) {
    ?>
      <?php 
    echo entity_link($object->Entity2);
    ?>
    <?php 
} else {
    ?>
      <?php 
    echo entity_link($object->Entity1);
    ?>
    <?php 
}
?>
    </span>
  </td>
  <td>
    <?php 
if ($base_object->id == $object->entity1_id) {
    ?>
      <?php 
    echo link_to($object->description2 ? $object->description2 : $object->Category->default_description, 'relationship/view?id=' . $object->id);
    ?>
    <?php 
} else {
    ?>
      <?php 
コード例 #11
0
ファイル: latestSuccess.php プロジェクト: silky/littlesis
foreach ($article_pager->execute() as $article) {
    ?>
  <span style="color: #888;"><?php 
    echo $article['ArticleSource']['name'];
    ?>
</span>
  <br />
  <span style="font-size: 18px; font-weight: bold;"><?php 
    echo link_to($article['title'] . ' &raquo;', $article['url']);
    ?>
</span>
  <br />
  <?php 
    $entities = array();
    ?>
  <?php 
    foreach ($article->ArticleEntity as $ae) {
        ?>
    <?php 
        $entities[] = entity_link($ae->Entity, null);
        ?>
  <?php 
    }
    ?>
  <?php 
    echo implode(', ', $entities);
    ?>
  <br />
  <br />
<?php 
}
コード例 #12
0
<?php

$unique = uniqid() . "_" . $related_entity["id"];
$entity_length = strlen($related_entity["name"]);
$blurb_length = 85 - round($entity_length * 1.2);
?>

<div class="related_entity">
  <div class="related_entity_entity">
    <?php 
echo entity_link($related_entity);
?>

    <?php 
if (isset($related_entity["blurb"])) {
    ?>
      &nbsp;
      <span class="related_entity_blurb">
        <?php 
    echo excerpt($related_entity['blurb'], $blurb_length);
    ?>
      </span>
    <?php 
}
?>
  </div>

  <div class="related_entity_relationship">
    <?php 
$first = array_shift($relationships);
?>
コード例 #13
0
<?php

echo json_encode(array('id' => $entity->id, 'ext' => $entity['primary_ext'], 'link' => entity_link($entity, null, false)));
コード例 #14
0
ファイル: _carousel.php プロジェクト: silky/littlesis
    <br />
    <br />
  
    <span class="entity-carousel-count">Related <?php 
    echo $entity['primary_ext'] == 'Person' ? 'people' : 'orgs';
    ?>
: </span>
   
    <?php 
    $related_links = array();
    ?>
    <?php 
    foreach ($interlocks as $related) {
        ?>
      <?php 
        $related_links[] = entity_link($related, 'entity-carousel-related', false, excerpt($related['name'], 40));
        ?>
    <?php 
    }
    ?>
    <?php 
    $related_links[] = '<nobr><strong>' . link_to('More &raquo;', EntityTable::generateRoute($entity, 'interlocks')) . '</strong></nobr>';
    ?>
    
    <?php 
    echo implode(" &bull; ", $related_links);
    ?>
  </div>
</div>
<?php 
}
コード例 #15
0
ファイル: _mini.php プロジェクト: silky/littlesis
 relationships:</span>
   
    <?php 
    $related_links = array();
    ?>
    <?php 
    foreach ($sample_relateds as $related) {
        ?>
      <?php 
        $related_links[] = entity_link($related, 'entity-mini-related', false, excerpt($related['name'], 40));
        ?>
    <?php 
    }
    ?>
    <?php 
    if (count($relateds) > 3) {
        ?>
      <?php 
        $related_links[] = '<nobr>' . entity_link($entity, 'entity-mini-related', false, 'More &raquo;') . '</nobr>';
        ?>
    <?php 
    }
    ?>
    
    <?php 
    echo implode(" &bull; ", $related_links);
    ?>
  </div>
</div>
<?php 
}
コード例 #16
0
ファイル: _userlistrow.php プロジェクト: silky/littlesis
    ?>
    &rarr; 
    <?php 
    echo ModificationFieldTable::convertValueForDisplay($field['new_value'], $field);
    ?>
)
  </td>
<?php 
} elseif ($object['merge_object_id']) {
    ?>
  <?php 
    $merge_object = LsDoctrineQuery::create()->from('Entity e')->where('e.id = ? AND e.is_deleted IS NOT NULL', $object['merge_object_id'])->fetchOne();
    ?>
  <td>
    Merged into <?php 
    echo entity_link($merge_object);
    ?>
  </td>
<?php 
} else {
    ?>
  <td></td>
<?php 
}
?>
  
</tr>

<?php 
if (!$object['is_delete']) {
    foreach ($fields as $field) {
コード例 #17
0
ファイル: _membershipview.php プロジェクト: silky/littlesis
<?php

use_helper('LsNumber');
?>

<span class="text_big">
<?php 
slot('share_text');
echo entity_link($relationship['Entity1']);
?>
 <?php 
echo $current === NULL ? "is/was" : ($current == '1' ? "is" : "was");
?>
 a member of <?php 
echo entity_link($relationship['Entity2']);
end_slot();
echo get_slot('share_text');
slot('share_text', RelationshipTable::formatSentenceForShare(get_slot('share_text')));
?>
</span>

<br />
<br />

<?php 
$data = array('Title' => $relationship['description1'], 'Start date' => Dateable::convertForDisplay($relationship['start_date']), 'End date' => Dateable::convertForDisplay($relationship['end_date']), 'Is current' => LsLogic::nullOrBoolean($relationship['is_current']), 'Dues' => readable_number($relationship['dues'], '$'), 'Notes' => $relationship['notes'] ? nl2br($relationship['notes']) : null);
?>

<?php 
include_partial('global/section', array('title' => 'Details'));
?>
コード例 #18
0
ファイル: _addresslistrow.php プロジェクト: silky/littlesis
<tr>
  <td>
    <?php 
echo sprintf("%01.1f", AddressTable::getDistanceBetweenCoords($object->latitude, $object->longitude, $base_object->latitude, $base_object->longitude));
?>
  </td>
  <td><?php 
echo entity_link($object->Entity, null);
?>
</td>
  <td>
    <span class="text_small"><?php 
echo $object->getOneLiner();
?>
</span>
  </td>
</tr>
コード例 #19
0
ファイル: _updatedlistrow.php プロジェクト: silky/littlesis
    echo $field->getFieldNameForDisplay();
    ?>
</strong> (<?php 
    echo $field->getOldValueForDisplay();
    ?>
 &rarr; <?php 
    echo $field->getNewValueForDisplay();
    ?>
)
  </td>
<?php 
} elseif ($object->merge_object_id) {
    ?>
  <td>
    Merged into <?php 
    echo entity_link(Doctrine::getTable('Entity')->find($object->merge_object_id));
    ?>
  </td>
<?php 
} else {
    ?>
  <td></td>
<?php 
}
?>
  
  <td>
    <?php 
echo link_to('more changes', 'modification/list?user_id=' . $object->user_id);
?>
  </td>
コード例 #20
0
ファイル: _networksearchrow.php プロジェクト: silky/littlesis
<tr>
  <td>
    <?php 
echo entity_link($object, null);
?>
  </td>
  <td>
    <?php 
$entities = LsDoctrineQuery::create()->from('Entity e')->andWhereIn('e.id', explode(',', $object['degree1_ids']))->execute();
?>
    <?php 
$entity_links = array();
?>
    <?php 
foreach ($entities as $entity) {
    ?>
      <?php 
    $entity_links[] = entity_link($entity, null);
    ?>
    <?php 
}
?>
  
    <?php 
echo implode(', ', $entity_links);
?>
  </td>
</tr>
コード例 #21
0
ファイル: _networkrow.php プロジェクト: silky/littlesis
<tr>
  <td>
    <?php 
echo entity_link($object, null);
?>
  </td>
  <td>
    <?php 
$networkLinks = array();
?>
    <?php 
$commonExt = $base_object->getPrimaryExtension() == 'Person' ? 'Org' : 'Person';
?>
    <?php 
$query = call_user_func(array($base_object, 'getCommon' . $commonExt . 'sByPositionQuery'), $object);
?>
    <?php 
foreach ($query->execute() as $networkEntity) {
    ?>
      <?php 
    $networkLinks[] = entity_link($networkEntity, null);
    ?>
    <?php 
}
?>
    <?php 
echo implode(', ', $networkLinks);
?>
  </td>
</tr>
コード例 #22
0
ファイル: imagesSuccess.php プロジェクト: silky/littlesis
<?php 
$col = -1;
?>
  <tr>
<?php 
foreach ($entities as $entity) {
    ?>
  <?php 
    if ($col == 4) {
        ?>
  </tr>
  <tr>
  <?php 
    }
    ?>
    <td style="vertical-align: top; text-align: center; padding: 0.8em; padding-bottom: 1.2em;">
      <?php 
    echo link_to(image_tag(ImageTable::getPath($entity['Image'][0]['filename'], 'profile'), array('alt' => '', 'style' => 'height: 100px; border: 0;')), EntityTable::getInternalUrl($entity));
    ?>
      <br />
      <br />
      <?php 
    echo entity_link($entity, null);
    ?>
    </td>
  <?php 
    $col = ($col + 1) % 5;
}
?>
  </tr>
</table>
コード例 #23
0
ファイル: _findConnections.php プロジェクト: silky/littlesis
<br>

<?php 
    }
    ?>


<?php 
} elseif ($sf_request->getParameter('id2')) {
    ?>

<strong>No connections found between <?php 
    echo entity_link($entity);
    ?>
 and <?php 
    echo entity_link($entity2);
    ?>
.</strong>

<?php 
}
?>



<?php 
if (isset($entity_pager)) {
    ?>

<?php 
    include_partial('global/section', array('title' => 'Search Results', 'pager' => $entity_pager));
コード例 #24
0
ファイル: _entityresults.php プロジェクト: silky/littlesis
<div class="section" style="display: block;">
  <span class="section_title">Matches</span>
</div>
<div class="section_meta" style="display: block;"><?php 
echo pager_meta($entity_pager);
?>
</div>


<div class="padded" style="display: block;">
<?php 
foreach ($entity_pager->execute() as $entity) {
    ?>
 
   <?php 
    $entity_link = str_replace("'", "\\'", entity_link($entity));
    ?>

  <?php 
    $innerHtml = '<span class="text_big">' . $entity_link . '</span> ' . input_hidden_tag('org_id', $entity->id);
    ?>
  <?php 
    $innerHtml = str_replace('"', '\\\'', $innerHtml);
    ?>

  <?php 
    include_partial('entityoneliner', array('entity' => $entity, 'actions' => array(array('raw' => '<a href="javascript:void(0);" onclick="selectEntity(\'' . $innerHtml . '\', \'' . 'org' . '\');">select</a>'))));
    ?>

<?php 
}
コード例 #25
0
ファイル: _listFavorites.php プロジェクト: silky/littlesis
<?php

if (isset($favorites)) {
    ?>
  <?php 
    include_partial('global/section', array('title' => 'Favorites', 'actions' => array(array('text' => 'edit', 'url' => 'home/favorites'), array('text' => 'hide', 'url' => 'home/hideFavorites'))));
    ?>
  
  <div style="padding: 1em; line-height: 17px;">
    <?php 
    foreach ($favorites as $favorite) {
        ?>
      <?php 
        echo entity_link($favorite->getObject(), null);
        ?>
<br />
    <?php 
    }
    ?>
  </div>
  <br />
<?php 
}
コード例 #26
0
ファイル: _toptentable.php プロジェクト: silky/littlesis
          <?php 
        echo $e->LsListEntity[0]->rank;
        ?>
.
        <?php 
    } else {
        ?>
        <?php 
    }
    ?>
   
         
      </td>
      <td class="entity">
        <?php 
    echo entity_link($e, '');
    ?>
  
      </td>
    </tr>
  <?php 
}
?>
  <?php 
if (isset($see_more) && $see_more && $list->LsListEntity->count() > $limit) {
    ?>
    <tr>
      <td colspan="2" class="see_more">
        <em>
          <?php 
    echo link_to('see more...', 'list/view?id=' . $list->id);
コード例 #27
0
      <?php 
    echo radiobutton_tag($field, $entity['id'] . ':' . '0', false);
    ?>
 X <br />
      <?php 
    echo radiobutton_tag($field, $entity['id'] . ':' . '?', false);
    ?>
 ? <br />
      <?php 
    echo link_to('search', 'http://google.com/images?q=' . urlencode($entity['name']), 'target=_blank');
    ?>
    </td>
    
    <td>
      <?php 
    echo entity_link($entity);
    ?>
    </td>
    
    <td>
      <?php 
    if ($image = $entity['Image'][0]['filename']) {
        ?>
        <?php 
        echo link_to(image_tag(ImageTable::getPath($image, 'profile'), array('alt' => '', 'style' => 'height: 80px; border: 0;')), EntityTable::getInternalUrl($entity));
        ?>
      <?php 
    }
    ?>
    </td>
コード例 #28
0
    </td>
  </tr>

  <tr>
    <td class="form_label"></td>
    <td id="entity2_field" class="form_field text_big">
      <?php 
echo entity_link($entity2);
?>
      is
      <?php 
echo $category_form['description2']->render();
?>
      of 
      <?php 
echo entity_link($entity1);
?>
    </td>
  </tr>


  <?php 
include_partial('global/form', array('form' => $category_form, 'field_names' => array('start_date', 'end_date', 'is_current', 'notes')));
?>

  <?php 
include_partial('global/formspacer');
?>

  <tr>
    <td></td>
コード例 #29
0
ファイル: _interlocksrow.php プロジェクト: silky/littlesis
<tr>
  <td style="width: 30%; padding-bottom: 0.6em">
    <?php 
echo entity_link($object, null);
?>
  </td>
  <td style="padding-bottom: 0.6em">
    <?php 
//$people = LsDoctrineQuery::create()->from('Entity e')->andWhereIn('e.id', explode(',', $object['people_ids']))->fetchArray()
?>
    <?php 
$people = EntityTable::getMultipleById(explode(',', $object['people_ids']));
?>
    <?php 
$people_links = array();
?>
    <?php 
foreach ($people as $person) {
    ?>
      <?php 
    $people_links[] = entity_link($person, null, false);
    ?>
    <?php 
}
?>
  
    <?php 
echo implode(', ', $people_links);
?>
  </td>
</tr>
コード例 #30
0
ファイル: _genericview.php プロジェクト: silky/littlesis
    ?>
  <?php 
    if ($desc1 = $relationship['description1']) {
        ?>
    <?php 
        $data[ucfirst($desc1)] = entity_link($relationship['Entity1']);
        ?>
  <?php 
    }
    ?>
  
  <?php 
    if ($desc2 = $relationship['description2']) {
        ?>
    <?php 
        $data[' ' . ucfirst($desc2)] = entity_link($relationship['Entity2']);
        ?>
  <?php 
    }
}
?>
  
<?php 
$data = array_merge($data, array('Start date' => Dateable::convertForDisplay($relationship['start_date']), 'End date' => Dateable::convertForDisplay($relationship['end_date']), 'Is current' => LsLogic::nullOrBoolean($relationship['is_current']), 'Notes' => $relationship['notes'] ? nl2br($relationship['notes']) : null));
?>

<?php 
include_partial('global/section', array('title' => 'Details'));
?>

<div class="padded">