mirror of
https://github.com/atlanticbiomedical/portal-legacy.git
synced 2025-07-02 01:47:28 -04:00
initial commit
This commit is contained in:
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* ##MODULE_NAME## actions.
|
||||
*
|
||||
* @package ##PROJECT_NAME##
|
||||
* @subpackage ##MODULE_NAME##
|
||||
* @author ##AUTHOR_NAME##
|
||||
* @version SVN: $Id: actions.class.php 2288 2006-10-02 15:22:13Z fabien $
|
||||
*/
|
||||
class ##MODULE_NAME##Actions extends auto##MODULE_NAME##Actions
|
||||
{
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
generator:
|
||||
class: sfPropelCrudGenerator
|
||||
param:
|
||||
model_class: ##MODEL_CLASS##
|
||||
theme: default
|
0
data/symfony/generator/sfPropelCrud/default/skeleton/lib/.sf
Executable file
0
data/symfony/generator/sfPropelCrud/default/skeleton/lib/.sf
Executable file
0
data/symfony/generator/sfPropelCrud/default/skeleton/templates/.sf
Executable file
0
data/symfony/generator/sfPropelCrud/default/skeleton/templates/.sf
Executable file
0
data/symfony/generator/sfPropelCrud/default/skeleton/validate/.sf
Executable file
0
data/symfony/generator/sfPropelCrud/default/skeleton/validate/.sf
Executable 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');
|
||||
}
|
||||
}
|
@ -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() ?>): ?]
|
||||
[?php echo link_to('delete', '<?php echo $this->getModuleName() ?>/delete?<?php echo $this->getPrimaryKeyUrlParams() ?>, 'post=true&confirm=Are you sure?') ?]
|
||||
[?php echo link_to('cancel', '<?php echo $this->getModuleName() ?>/show?<?php echo $this->getPrimaryKeyUrlParams() ?>) ?]
|
||||
[?php else: ?]
|
||||
[?php echo link_to('cancel', '<?php echo $this->getModuleName() ?>/list') ?]
|
||||
[?php endif; ?]
|
||||
</form>
|
@ -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') ?]
|
@ -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() ?>) ?]
|
||||
[?php echo link_to('list', '<?php echo $this->getModuleName() ?>/list') ?]
|
Reference in New Issue
Block a user