コード例 #1
0
ファイル: ColLocation.php プロジェクト: taryono/school
 public function getParentName()
 {
     if ($this->getParent() != null && $this->getParent() != 0) {
         return ColLocationPeer::retrieveByPk($this->getParent())->getName();
     }
     return '-';
 }
コード例 #2
0
ファイル: listSuccess.php プロジェクト: taryono/school
}
?>
>
					<td class='filter'><?php 
echo submit_image_tag('/images/magnifier.png', array('class' => 'sort', 'onclick' => "blur();"));
?>
</td>
					<td class='filter_first'><?php 
echo input_tag('filters[CODE]', isset($filters['CODE']) ? $filters['CODE'] : null, array('size' => 15));
?>
</td>
					<td class='filter'>
					<?php 
echo input_hidden_tag('filters[id]', isset($filters['id']) ? $filters['id'] : null);
if (isset($filters['id']) && $filters['id']) {
    echo input_auto_complete_tag('col_name', isset($filters['id']) && $filters['id'] ? ColLocationPeer::retrieveByPk($filters['id'])->getName() : '', '/col_location/getListName', array('size' => 50), array('after_update_element' => 'function(f, s) {$("id").updateFromInformalAutocomplete(f, s);}', 'min_chars' => 1));
} else {
    echo input_auto_complete_tag('col_name', null, '/col_location/getListName', array('size' => 50), array('after_update_element' => 'function(f, s) {$("filters_id").updateFromInformalAutocomplete(f, s);}', 'min_chars' => 1));
}
?>
                    </td>
                    <td class='filter'><?php 
echo object_select_tag(isset($filters['DEPARTMENT_ID']) ? $filters['DEPARTMENT_ID'] : null, null, array('include_blank' => true, 'related_class' => 'Department', 'text_method' => '__toString', 'peer_method' => 'doSelectOrdered', 'control_name' => 'filters[DEPARTMENT_ID]'));
?>
</td>
				</tr>
			</thead>
			<tbody>
			<?php 
if ($pager->getNbResults() < 1) {
    ?>
コード例 #3
0
ファイル: actions.class.php プロジェクト: taryono/school
 public function executeDelete()
 {
     $col_location = ColLocationPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($col_location);
     $ref_error = 0;
     foreach ($col_location->getRefCountMethods() as $ref) {
         $method = "count" . $ref['affix'];
         $count = $col_location->{$method}();
         if ($count > 0) {
             ++$ref_error;
             $this->getRequest()->setError('lib_location/delete/' . sfInflector::camelize($ref['table']), $count);
         }
     }
     if ($ref_error > 0) {
         $this->getRequest()->setError('lib_location/delete', '_ERR_DELETE_ (' . $col_location->toString() . ' - id:' . $col_location->getId() . ')');
     } else {
         $col_location->delete();
     }
     return $this->forward('lib_location', 'list');
 }