Ejemplo n.º 1
0
 public function executeDelete()
 {
     $publisher = PublisherPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($publisher);
     $ref_error = 0;
     foreach ($publisher->getRefCountMethods() as $ref) {
         $method = "count" . $ref['affix'];
         $count = $publisher->{$method}();
         if ($count > 0) {
             ++$ref_error;
             $this->getRequest()->setError('publisher/delete/' . sfInflector::camelize($ref['table']), $count);
         }
     }
     if ($ref_error > 0) {
         $this->getRequest()->setError('publisher/delete', '_ERR_DELETE_ (' . $publisher->toString() . ' - id:' . $publisher->getId() . ')');
     } else {
         $publisher->delete();
     }
     return $this->forward('publisher', 'list');
 }
Ejemplo n.º 2
0
				</tr>
				<tr class="list" id='filter' <?php 
if (!isset($filters)) {
    echo 'style="display:;"';
}
?>
>
					<td class='filter'><?php 
echo submit_image_tag('/images/magnifier.png', array('class' => 'sort', 'onclick' => "blur();"));
?>
</td>
					<td class='filter_first'>
					<?php 
echo input_hidden_tag('filters[id]', isset($filters['id']) ? $filters['id'] : null);
if (isset($filters['id']) && $filters['id']) {
    echo input_auto_complete_tag('publisher_name', isset($filters['id']) && $filters['id'] ? PublisherPeer::retrieveByPk($filters['id'])->getName() : '', '/publisher/getList', array('size' => 70), array('after_update_element' => 'function(f, s) {$("id").updateFromInformalAutocomplete(f, s);}', 'min_chars' => 1));
} else {
    echo input_auto_complete_tag('publisher_name', null, '/publisher/getList', array('size' => 70), array('after_update_element' => 'function(f, s) {$("filters_id").updateFromInformalAutocomplete(f, s);}', 'min_chars' => 1));
}
?>
					<?php 
#echo input_tag('filters[NAME]', isset($filters['NAME']) ? $filters['NAME'] : null, array ( 'size' => 15,))
?>
                    </td>
				</tr>
			</thead>
			<tbody>
			<?php 
if ($pager->getNbResults() < 1) {
    ?>
				<tr class="list"><td colspan="100"><div class="no_record"><?php