static function getDisplayName($ref)
 {
     if ($ref['name']) {
         $display = $ref['name'];
     } else {
         $display = $ref['source'];
     }
     if ($ref['publication_date']) {
         $display .= ', ' . Dateable::convertForDisplay($ref['publication_date']);
     }
     if ($ref['source_detail']) {
         $display .= ' (' . $ref['source_detail'] . ')';
     }
     return $display;
 }
Beispiel #2
0
<?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'));
?>

<div class="padded">
<?php 
include_partial('global/datatable', array('data' => $data));
?>
</div>
 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;
 }
Beispiel #4
0
    <?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">
<?php 
include_partial('global/datatable', array('data' => $data));
?>
</div>
Beispiel #5
0
<tr class="text_small hover<?php 
echo $shaded ? ' shaded' : '';
?>
">
  <td><?php 
echo Dateable::convertForDisplay($object['start_date']);
?>
</td>
  <td><?php 
echo LsNumber::makeReadable($object['amount'], '$');
?>
</td>
  <td>
    <?php 
$agencies = array();
?>
    <?php 
foreach (LobbyFilingTable::getAgenciesQuery($object)->setHydrationMode(Doctrine::HYDRATE_ARRAY)->execute() as $agency) {
    ?>
      <?php 
    $agencies[] = entity_link($agency, null);
    ?>
    <?php 
}
?>
    <?php 
echo implode('<br /> ', $agencies);
?>
  </td>

  <td>
Beispiel #6
0
<?php

use_helper('LsNumber');
?>

<?php 
$person = EntityTable::getPersonById($entity['id']);
$legalName = PersonTable::getLegalName($person);
$data = array('Types' => implode(', ', array_keys(EntityTable::getExtensionsForDisplay($entity, false))), 'Legal Name' => $entity['name'] == $legalName ? null : $legalName, 'Birthplace' => $person['birthplace'], 'Date of Birth' => Dateable::convertForDisplay($entity['start_date']), 'Date of Death' => Dateable::convertForDisplay($entity['end_date']), 'Gender' => PersonTable::getGenderName($person));
?>

<?php 
include_partial('global/datatable', array('data' => $data, 'label_width' => isset($label_width) ? $label_width : '80px'));
Beispiel #7
0
<?php

use_helper('LsNumber');
?>

<?php 
$data = array('Types' => implode(', ', array_keys(EntityTable::getExtensionsForDisplay($entity, false))), 'Start Date' => Dateable::convertForDisplay($entity['start_date']), 'End Date' => Dateable::convertForDisplay($entity['end_date']), 'Partner 1' => $entity['partner1'] ? entity_link($entity['partner1']) : null, 'Partner 2' => $entity['partner2'] ? entity_link($entity['partner2']) : null);
?>

<?php 
include_partial('global/datatable', array('data' => $data, 'label_width' => isset($label_width) ? $label_width : '80px'));
Beispiel #8
0
<?php 
slot('share_text');
echo entity_link($relationship['Entity1']);
?>
 <?php 
echo $current === NULL ? "is/was" : ($current == '1' ? "is" : "was");
?>
 a student 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('Type' => $relationship['description1'], 'Start date' => Dateable::convertForDisplay($relationship['start_date']), 'End date' => Dateable::convertForDisplay($relationship['end_date']), 'Is current' => LsLogic::nullOrBoolean($relationship['is_current']), 'Degree' => RelationshipTable::getDegreeNameById($relationship['id']), 'Field' => $relationship['field'], 'Is dropout' => LsLogic::nullOrBoolean($relationship['is_dropout']), 'Notes' => $relationship['notes'] ? nl2br($relationship['notes']) : null);
?>

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

<div class="padded">
<?php 
include_partial('global/datatable', array('data' => $data));
?>
</div>
Beispiel #9
0
<?php

use_helper('LsNumber');
$data = array('Types' => implode(', ', array_keys(EntityTable::getExtensionsForDisplay($entity, false))), 'Start Date' => Dateable::convertForDisplay($entity['start_date']), 'End Date' => Dateable::convertForDisplay($entity['end_date']), 'Website' => $entity['website'] ? link_to(excerpt($entity['website'], 25, '...', false), $entity['website']) : null, 'Employees' => readable_number($entity['employees']), 'Revenue' => readable_number($entity['revenue'], '$'));
?>

<?php 
include_partial('global/datatable', array('data' => $data, 'label_width' => isset($label_width) ? $label_width : '80px'));
Beispiel #10
0
<?php 
echo RelationshipTable::getDisplayDescription($relationship) ? '(' . RelationshipTable::getDisplayDescription($relationship) . ')' : '';
?>
 
<?php 
echo $relationship['Entity2']['primary_ext'] == 'Person' ? 'under' : 'at';
?>
 <?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']), 'Board member' => LsLogic::nullOrBoolean($relationship['is_board']), 'Executive' => LsLogic::nullOrBoolean($relationship['is_executive']), 'Employee' => LsLogic::nullOrBoolean($relationship['is_employee']), 'Compensation' => readable_number($relationship['compensation'], '$'), 'Notes' => $relationship['notes'] ? nl2br($relationship['notes']) : null);
?>

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

<div class="padded">
<?php 
include_partial('global/datatable', array('data' => $data));
?>
</div>
 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);
 }