initial commit

This commit is contained in:
Chris Sewell
2012-11-28 03:55:08 -05:00
parent 7adb399b2e
commit cf140a2e97
3247 changed files with 492437 additions and 0 deletions

View File

@ -0,0 +1,89 @@
[?php
/**
* <?php echo $this->getGeneratedModuleName() ?> actions.
*
* @package ##PROJECT_NAME##
* @subpackage <?php echo $this->getGeneratedModuleName() ?>
* @author ##AUTHOR_NAME##
* @version SVN: $Id: actions.class.php 3335 2007-01-23 16:19:56Z fabien $
*/
class <?php echo $this->getGeneratedModuleName() ?>Actions extends sfActions
{
public function executeIndex()
{
return $this->forward('<?php echo $this->getModuleName() ?>', 'list');
}
public function executeList()
{
$this-><?php echo $this->getPluralName() ?> = <?php echo $this->getClassName() ?>Peer::doSelect(new Criteria());
}
public function executeShow()
{
$this-><?php echo $this->getSingularName() ?> = <?php echo $this->getClassName() ?>Peer::retrieveByPk(<?php echo $this->getRetrieveByPkParamsForAction(49) ?>);
$this->forward404Unless($this-><?php echo $this->getSingularName() ?>);
}
public function executeCreate()
{
$this-><?php echo $this->getSingularName() ?> = new <?php echo $this->getClassName() ?>();
$this->setTemplate('edit');
}
public function executeEdit()
{
$this-><?php echo $this->getSingularName() ?> = <?php echo $this->getClassName() ?>Peer::retrieveByPk(<?php echo $this->getRetrieveByPkParamsForAction(49) ?>);
$this->forward404Unless($this-><?php echo $this->getSingularName() ?>);
}
public function executeUpdate()
{
if (<?php echo $this->getTestPksForGetOrCreate(false) ?>)
{
$<?php echo $this->getSingularName() ?> = new <?php echo $this->getClassName() ?>();
}
else
{
$<?php echo $this->getSingularName() ?> = <?php echo $this->getClassName() ?>Peer::retrieveByPk(<?php echo $this->getRetrieveByPkParamsForAction(45) ?>);
$this->forward404Unless($<?php echo $this->getSingularName() ?>);
}
<?php foreach ($this->getTableMap()->getColumns() as $name => $column): $type = $column->getCreoleType(); ?>
<?php if ($name == 'CREATED_AT' || $name == 'UPDATED_AT') continue ?>
<?php $name = sfInflector::underscore($column->getPhpName()) ?>
<?php if ($type == CreoleTypes::DATE || $type == CreoleTypes::TIMESTAMP): ?>
if ($this->getRequestParameter('<?php echo $name ?>'))
{
list($d, $m, $y) = sfI18N::getDateForCulture($this->getRequestParameter('<?php echo $name ?>'), $this->getUser()->getCulture());
$<?php echo $this->getSingularName() ?>->set<?php echo $column->getPhpName() ?>("$y-$m-$d");
}
<?php elseif ($type == CreoleTypes::BOOLEAN): ?>
$<?php echo $this->getSingularName() ?>->set<?php echo $column->getPhpName() ?>($this->getRequestParameter('<?php echo $name ?>', 0));
<?php elseif ($column->isForeignKey()): ?>
$<?php echo $this->getSingularName() ?>->set<?php echo $column->getPhpName() ?>($this->getRequestParameter('<?php echo $name ?>') ? $this->getRequestParameter('<?php echo $name ?>') : null);
<?php else: ?>
$<?php echo $this->getSingularName() ?>->set<?php echo $column->getPhpName() ?>($this->getRequestParameter('<?php echo $name ?>'));
<?php endif; ?>
<?php endforeach; ?>
$<?php echo $this->getSingularName() ?>->save();
return $this->redirect('<?php echo $this->getModuleName() ?>/show?<?php echo $this->getPrimaryKeyUrlParams() ?>);
<?php //' ?>
}
public function executeDelete()
{
$<?php echo $this->getSingularName() ?> = <?php echo $this->getClassName() ?>Peer::retrieveByPk(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>);
$this->forward404Unless($<?php echo $this->getSingularName() ?>);
$<?php echo $this->getSingularName() ?>->delete();
return $this->redirect('<?php echo $this->getModuleName() ?>/list');
}
}

View File

@ -0,0 +1,29 @@
[?php use_helper('Object') ?]
[?php echo form_tag('<?php echo $this->getModuleName() ?>/update') ?]
<?php foreach ($this->getPrimaryKey() as $pk): ?>
[?php echo object_input_hidden_tag($<?php echo $this->getSingularName() ?>, 'get<?php echo $pk->getPhpName() ?>') ?]
<?php endforeach; ?>
<table>
<tbody>
<?php foreach ($this->getTableMap()->getColumns() as $name => $column): ?>
<?php if ($column->isPrimaryKey()) continue ?>
<?php if ($name == 'CREATED_AT' || $name == 'UPDATED_AT') continue ?>
<tr>
<th><?php echo sfInflector::humanize(sfInflector::underscore($column->getPhpName())) ?><?php if ($column->isNotNull()): ?>*<?php endif; ?>:</th>
<td>[?php echo <?php echo $this->getCrudColumnEditTag($column) ?> ?]</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<hr />
[?php echo submit_tag('save') ?]
[?php if (<?php echo $this->getPrimaryKeyIsSet() ?>): ?]
&nbsp;[?php echo link_to('delete', '<?php echo $this->getModuleName() ?>/delete?<?php echo $this->getPrimaryKeyUrlParams() ?>, 'post=true&confirm=Are you sure?') ?]
&nbsp;[?php echo link_to('cancel', '<?php echo $this->getModuleName() ?>/show?<?php echo $this->getPrimaryKeyUrlParams() ?>) ?]
[?php else: ?]
&nbsp;[?php echo link_to('cancel', '<?php echo $this->getModuleName() ?>/list') ?]
[?php endif; ?]
</form>

View File

@ -0,0 +1,26 @@
<h1><?php echo $this->getModuleName() ?></h1>
<table>
<thead>
<tr>
<?php foreach ($this->getTableMap()->getColumns() as $column): ?>
<th><?php echo sfInflector::humanize(sfInflector::underscore($column->getPhpName())) ?></th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
[?php foreach ($<?php echo $this->getPluralName() ?> as $<?php echo $this->getSingularName() ?>): ?]
<tr>
<?php foreach ($this->getTableMap()->getColumns() as $column): ?>
<?php if ($column->isPrimaryKey()): ?>
<td>[?php echo link_to($<?php echo $this->getSingularName() ?>->get<?php echo $column->getPhpName() ?>(), '<?php echo $this->getModuleName() ?>/show?<?php echo $this->getPrimaryKeyUrlParams() ?>) ?]</td>
<?php else: ?>
<td>[?php echo $<?php echo $this->getSingularName() ?>->get<?php echo $column->getPhpName() ?>() ?]</td>
<?php endif; ?>
<?php endforeach; ?>
</tr>
[?php endforeach; ?]
</tbody>
</table>
[?php echo link_to ('create', '<?php echo $this->getModuleName() ?>/create') ?]

View File

@ -0,0 +1,13 @@
<table>
<tbody>
<?php foreach ($this->getTableMap()->getColumns() as $column): ?>
<tr>
<th><?php echo sfInflector::humanize(sfInflector::underscore($column->getPhpName())) ?>: </th>
<td>[?= $<?php echo $this->getSingularName() ?>->get<?php echo $column->getPhpName() ?>() ?]</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<hr />
[?php echo link_to('edit', '<?php echo $this->getModuleName() ?>/edit?<?php echo $this->getPrimaryKeyUrlParams() ?>) ?]
&nbsp;[?php echo link_to('list', '<?php echo $this->getModuleName() ?>/list') ?]