Generate an HTML row of data for the census
Add prefix cell (store XREF and drag/drop)
Add suffix cell (delete button)

@param CensusInterface $census
@param Individual      $individual
@param Individual      $head

@return string
181279
public function censusTableRow(CensusInterface $census, Individual $individual, Individual $head): string
    {
        $html = '';
        foreach ($census->columns() as $column) {
            $html .= '<td class="wt-census-assistant-field p-0"><input class="form-control wt-census-assistant-form-control p-0" type="text" value="' . $column->generate($individual, $head) . '" name="ca_individuals[' . $individual->xref() . '][]"></td>';
        }

        return '<tr class="wt-census-assistant-row"><td class="wt-census-assistant-field" hidden>' . $individual->xref() . '</td>' . $html . '<td class="wt-census-assistant-field"><a class="icon-remove" href="#" title="' . I18N::translate('Remove') . '"></a></td></tr>';
    }
1245051
public function generate(Individual $individual, Individual $head): string
    {
        foreach ($individual->facts(['OCCU']) as $fact) {
            return $fact->value();
        }

        return '';
    }
1305217
public function hExtendIndiHeaderIcons(IndividualController $ctrlIndi) {
        if($ctrlIndi){
            $dindi = new Individual($ctrlIndi->getSignificantIndividual());
            return FunctionsPrint::formatSosaNumbers($dindi->getSosaNumbers(), 1, 'large');
        }
        return '';
    }
620232
public function formatPID(string $personalID, string $format = 'A########'): string
    {
        $personalID = $this->stripNonNumeric($personalID) * 1;
        $preset     = preg_replace("/[^a-zA-Z]/", '', $format);

        return ($preset.str_pad($personalID, strlen($format) - strlen($preset), '0', STR_PAD_LEFT));
    }
235342
public function generate(Individual $individual, Individual $head): string
    {
        if ($individual === $head) {
            return 'head';
        }

        return Functions::getCloseRelationshipName($head, $individual);
    }
132400
protected function chartCompact(Individual $individual, ChartService $chart_service): ResponseInterface
    {
        $ancestors = $chart_service->sosaStradonitzAncestors($individual, 5);

        $html = view('modules/compact-chart/chart', [
            'ancestors' => $ancestors,
            'module'    => $this,
        ]);

        return response($html);
    }
836988
private function _writeHeader()
	{
		$record  = 0x0014;			   // Record identifier

		/* removing for now
		// need to fix character count (multibyte!)
		if (strlen($this->_phpSheet->getHeaderFooter()->getOddHeader()) <= 255) {
			$str	  = $this->_phpSheet->getHeaderFooter()->getOddHeader();	   // header string
		} else {
			$str = '';
		}
		*/

		$recordData = PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong($this->_phpSheet->getHeaderFooter()->getOddHeader());
		$length = strlen($recordData);

		$header   = pack("vv", $record, $length);

		$this->_append($header . $recordData);
	}
1323265
private function createNoteText(CensusInterface $census, $ca_title, $ca_place, $ca_citation, $ca_individuals, $ca_notes): string
    {
        $text = $ca_title . "\n" . $ca_citation . "\n" . $ca_place . "\n\n";

        foreach ($census->columns() as $n => $column) {
            if ($n === 0) {
                $text .= "\n";
            } else {
                $text .= ' | ';
            }
            $text .= $column->abbreviation();
        }

        foreach ($census->columns() as $n => $column) {
            if ($n === 0) {
                $text .= "\n";
            } else {
                $text .= ' | ';
            }
            $text .= '-----';
        }

        foreach ($ca_individuals as $xref => $columns) {
            $text .= "\n" . implode(' | ', $columns);
        }

        return $text . "\n\n" . $ca_notes;
    }
238011
public function generate(Individual $individual, Individual $head): string
    {
        foreach ($individual->getAllNames() as $name) {
            $given = $name['givn'];
            $space_pos = strpos($given, ' ');

            if ($space_pos === false) {
                return $given;
            }

            return substr($given, 0, $space_pos + 2);
        }

        return '';
    }
426750
def addIndividual(self, individual):
        
        id_ = individual.getId()
        self._individualIdMap[id_] = individual
        self._individualIds.append(id_)
        self._individualNameMap[individual.getName()] = individual
307193
private function addAncestorsToCart(Individual $individual): void
    {
        $this->addRecordToCart($individual);

        foreach ($individual->childFamilies() as $family) {
            foreach ($family->spouses() as $parent) {
                $this->addAncestorsToCart($parent);
            }
        }
    }
1173180
public function generate(Individual $individual, Individual $head): string
    {
        return $individual->getEstimatedBirthDate()->minimumDate()->format('%j %n %Y');
    }
804693
public function getSosaNumbers(Individual $indi) {
        if(!$this->is_setup) return array();
        return Database::prepare(
                'SELECT majs_sosa, majs_gen FROM `##maj_sosa`'.
                ' WHERE majs_i_id=:indi_id AND majs_gedcom_id=:tree_id AND majs_user_id=:user_id'
            )->execute(array(
                'indi_id' => $indi->getXref(), 
                'tree_id' => $this->tree->getTreeId(), 
                'user_id' => $this->user->getUserId()
            ))->fetchAssoc();
    }
706318
public function getAddIndividualAction(ServerRequestInterface $request, Tree $tree): ResponseInterface
    {
        $xref = $request->get('xref', '');

        $individual = Individual::getInstance($xref, $tree);

        if ($individual === null) {
            throw new IndividualNotFoundException();
        }

        $options = $this->individualOptions($individual);

        $title = I18N::translate('Add %s to the clippings cart', $individual->fullName());

        return $this->viewResponse('modules/clippings/add-options', [
            'options' => $options,
            'default' => key($options),
            'record'  => $individual,
            'title'   => $title,
            'tree'    => $tree,
        ]);
    }
672126
public function generate(Individual $individual, Individual $head): string
    {
        foreach ($individual->spouseFamilies() as $family) {
            foreach ($family->facts(['MARR']) as $fact) {
                $marriage_jd = $fact->date()->julianDay();
                $census_jd   = $this->date()->julianDay();
                if ($marriage_jd <= $census_jd && $marriage_jd >= $census_jd - 365) {
                    return 'Y';
                }
            }
        }

        return '';
    }
969202
public function generate(Individual $individual, Individual $head): string
    {
        $family = $this->spouseFamily($individual);
        $sex    = $individual->sex();

        if ($family === null || $family->facts(['MARR'])->isEmpty()) {
            if ($this->isChild($individual)) {
                return $this->conditionChild($sex);
            }

            return $this->conditionSingle($sex);
        }

        if ($family->facts(['DIV'])->isNotEmpty()) {
            return $this->conditionDivorced($sex);
        }

        $spouse = $family->spouse($individual);
        if ($spouse instanceof Individual && $this->isDead($spouse)) {
            return $this->conditionWidowed($sex);
        }

        return $this->conditionMarried($sex);
    }
1282960
public function chartUrl(Individual $individual, array $parameters = []): string
    {
        return route('module', [
                'module'  => $this->name(),
                'action'  => 'Chart',
                'xrefs[]' => $individual->xref(),
                'ged'     => $individual->tree()->name(),
            ] + $parameters);
    }