Commit e0a7a3b7 authored by comraden's avatar comraden
Browse files

add place of birth/death

parent 38e605a4
<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
$version = '1.0';
$updateFileDate = '2021-02-16';
$updateFileTime = '12:00';
$updateDescription ='<span style="color:green">Update person (place of birth/death)</span>';
$excludeFile = 'false';
if(!function_exists('PrintStepResult')) {
function PrintStepResult($result)
{
if ($result)
{
$output=' - <span style="color:green">'.JText::_('SUCCESS').'</span>';
}
else
{
$output=' - <span style="color:red">'.JText::_('FAILED').'</span>';
}
return $output;
}}
function UpdateTablePerson()
{
$db = JFactory::getDBO();
echo JText::sprintf( 'Update table %1$s', '<b>#__joomleague_person</b>' );
$query = "
ALTER TABLE `#__joomleague_person` ADD
`birthplace` varchar(50) NOT NULL
AFTER `birthday`
";
$db->setQuery( $query );
if ( $db->query() )
{
echo ' - <span style="color:green">' . JText::_( 'SUCCESS' ) . '</span>';
}
else
{
echo ' - <span style="color:red">' . JText::_( 'FAILED' ) . '</span>';
}
$query = "
ALTER TABLE `#__joomleague_person`
ADD `deathplace` varchar(50) NOT NULL
AFTER `deathday`
";
$db->setQuery( $query );
if ( $db->query() )
{
echo ' - <span style="color:green">' . JText::_( 'SUCCESS' ) . '</span>';
}
else
{
echo ' - <span style="color:red">' . JText::_( 'FAILED' ) . '</span>';
}
return '';
}
?>
<hr>
<?php
$output = JText::sprintf( 'JoomLeague v%1$s - Database-Update - Filedate: %2$s / %3$s',
$version, $updateFileDate, $updateFileTime );
JToolBarHelper::title( $output );
echo UpdateTablePerson();
echo '<br/>';
?>
<hr />
......@@ -63,12 +63,22 @@
label="COM_JOOMLEAGUE_ADMIN_PERSON_BIRTHDAY"
class="inputbox"
format="%Y-%m-%d"/>
<field
name="birthplace"
type="text"
label="COM_JOOMLEAGUE_ADMIN_PERSON_BIRTHPLACE"
class="inputbox"/>
<field
name="deathday"
type="calendar"
label="COM_JOOMLEAGUE_ADMIN_PERSON_DEATHDAY"
class="inputbox"
format="%Y-%m-%d"/>
<field
name="deathplace"
type="text"
label="COM_JOOMLEAGUE_ADMIN_PERSON_DEATHPLACE"
class="inputbox"/>
<field
name="height"
type="text"
......@@ -225,4 +235,4 @@
<option value="1">JYES</option>
</field>
</fieldset>
</form>
\ No newline at end of file
</form>
......@@ -807,6 +807,8 @@ COM_JOOMLEAGUE_ADMIN_PERSON_L_NAME="Last name"
;COM_JOOMLEAGUE_ADMIN_PERSON_IMAGE="Image"
COM_JOOMLEAGUE_ADMIN_PERSON_BIRTHDAY="Birthday"
COM_JOOMLEAGUE_ADMIN_PERSON_DEATHDAY="Day of death"
COM_JOOMLEAGUE_ADMIN_PERSON_BIRTHPLACE="Birthplace"
COM_JOOMLEAGUE_ADMIN_PERSON_DEATHPLACE="Place of death"
COM_JOOMLEAGUE_ADMIN_PERSON_NATIONALITY="Nationality"
COM_JOOMLEAGUE_ADMIN_PERSON_INFO="Info"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment