Changeset 468
- Timestamp:
- 11/25/08 16:41:34 (1 month ago)
- Files:
-
- trunk/apps/intranet/modules/zone/actions/actions.class.php (modified) (3 diffs)
- trunk/apps/intranet/modules/zone/templates/editSuccess.php (modified) (1 diff)
- trunk/apps/intranet/modules/zone/templates/listSuccess.php (modified) (1 diff)
- trunk/apps/intranet/modules/zone/templates/market_editSuccess.php (added)
- trunk/lib/form/Market_sectorForm.class.php (added)
- trunk/lib/form/base/BaseMarketForm.class.php (modified) (6 diffs)
- trunk/lib/form/base/BaseMarket_sectorForm.class.php (added)
- trunk/lib/model/Market.php (modified) (1 diff)
- trunk/lib/model/Market_sector.php (added)
- trunk/lib/model/Market_sectorPeer.php (added)
- trunk/lib/model/map/Market_sectorMapBuilder.php (added)
- trunk/lib/model/om/BaseMarket_sector.php (added)
- trunk/lib/model/om/BaseMarket_sectorPeer.php (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/apps/intranet/modules/zone/actions/actions.class.php
r181 r468 7 7 class zoneActions extends sfActions 8 8 { 9 /* ZONES */10 9 public function executeIndex() 11 10 { … … 20 19 $this->zones = ZonePeer::doSelect($c); 21 20 22 // sectors21 // sectors 23 22 $c = new Criteria(); 24 23 $c->add(SectorPeer::AGENCY_ID, $this->getUser()->getSubscriber()->getAgencyId()); 25 24 $this->sectors = SectorPeer::doSelect($c); 25 26 // market 27 $c = new Criteria(); 28 $c->add(Market_sectorPeer::AGENCY_ID, $this->getUser()->getSubscriber()->getAgencyId()); 29 $this->markets = Market_sectorPeer::doSelect($c); 26 30 } 27 31 … … 196 200 return $this->redirect('zone/sector_show?id='.$sector_id); 197 201 } 202 203 public function executeMarket_create() 204 { 205 $this->form = new Market_sectorForm(); 206 $this->setTemplate('market_edit'); 207 } 208 209 public function executeMarket_edit($request) 210 { 211 $this->form = new Market_sectorForm(Market_sectorPeer::retrieveByPk($request->getParameter('id'))); 212 } 213 214 public function executeMarket_update($request) 215 { 216 $this->forward404Unless($request->isMethod('post')); 217 218 $this->form = new Market_sectorForm(Market_sectorPeer::retrieveByPk($request->getParameter('id'))); 219 220 $market_sector = $request->getParameter('market_sector'); 221 $market_sector['city_id'] = $request->getParameter('city_id'); 222 223 $this->form->bind($market_sector); 224 if ($this->form->isValid()) 225 { 226 $market_sector = $this->form->save(); 227 228 $this->redirect('zone/market_edit?id='.$market_sector->getId()); 229 } 230 231 $this->setTemplate('market_edit'); 232 } 198 233 } trunk/apps/intranet/modules/zone/templates/editSuccess.php
r151 r468 13 13 </table> 14 14 <hr /> 15 <?php echo submit_ tag('Enregistrer') ?>15 <?php echo submit_image_tag('tpl_02/'.$sf_user->getCulture().'/button/save.png') ?> 16 16 <?php if ($zone->getId()): ?> 17 <?php echo link_to( 'Supprimer', 'zone/delete?id='.$zone->getId(), 'post=true&confirm=Are you sure?') ?>18 <?php echo link_to( 'Annuler', 'zone/show?id='.$zone->getId()) ?>17 <?php echo link_to(image_tag('tpl_02/'.$sf_user->getCulture().'/button/delete.png'), 'zone/delete?id='.$zone->getId(), 'post=true&confirm=Are you sure?') ?> 18 <?php echo link_to(image_tag('tpl_02/'.$sf_user->getCulture().'/button/cancel.png'), 'zone/show?id='.$zone->getId()) ?> 19 19 <?php else: ?> 20 <?php echo link_to( 'Annuler', 'zone/list') ?>20 <?php echo link_to(image_tag('tpl_02/'.$sf_user->getCulture().'/button/cancel.png'), 'zone/list') ?> 21 21 <?php endif; ?> 22 22 </form> trunk/apps/intranet/modules/zone/templates/listSuccess.php
r181 r468 49 49 <hr /> 50 50 <?php echo link_to(image_tag('tpl_02/'.$sf_user->getCulture().'/button/add.png'), 'zone/sector_create') ?> 51 51 52 <hr /> 53 <h3><?php echo ucfirst(__('market')) ?></h3> 54 <table> 55 <thead> 56 <tr> 57 <th width="50">Num.</th> 58 <th width="200"><?php echo ucfirst(__('city')) ?></th> 59 <th width="100"><?php echo ucfirst(__('district')) ?></th> 60 <th> </th> 61 </tr> 62 </thead> 63 <tbody> 64 <?php foreach ($markets as $market): ?> 65 <tr> 66 <td><?php echo $market->getId() ?></td> 67 <td><?php echo $market->getApicity() ?></td> 68 <td><?php echo $market->getApidistrict() ?></td> 69 <td><?php echo link_to(image_tag('tpl_02/'.$sf_user->getCulture().'/button/view_inline.png'), 'zone/market_edit?id='.$market->getId()) ?></td> 70 </tr> 71 <?php endforeach; ?> 72 </tbody> 73 </table> 74 <hr /> 75 <?php echo link_to(image_tag('tpl_02/'.$sf_user->getCulture().'/button/add.png'), 'zone/market_create') ?> 76 <hr /> trunk/lib/form/base/BaseMarketForm.class.php
r372 r468 18 18 'agency' => new sfWidgetFormInput(), 19 19 'agency_city' => new sfWidgetFormInput(), 20 'agency_agent' => new sfWidgetFormInput(), 21 'agency_phone' => new sfWidgetFormInput(), 22 'agency_mail' => new sfWidgetFormInput(), 20 23 'nature_id' => new sfWidgetFormPropelSelect(array('model' => 'Market_nature', 'add_empty' => false)), 21 24 'type_id' => new sfWidgetFormPropelSelect(array('model' => 'Market_type', 'add_empty' => false)), … … 61 64 'building' => new sfWidgetFormInput(), 62 65 'sector' => new sfWidgetFormInput(), 66 'district_id' => new sfWidgetFormPropelSelect(array('model' => 'Apidistrict', 'add_empty' => true)), 63 67 'address1' => new sfWidgetFormInput(), 64 68 'address2' => new sfWidgetFormInput(), … … 92 96 'building_permit' => new sfWidgetFormInputCheckbox(), 93 97 'url' => new sfWidgetFormInput(), 98 'last_change' => new sfWidgetFormDate(), 94 99 'created_at' => new sfWidgetFormDateTime(), 95 100 'updated_at' => new sfWidgetFormDateTime(), … … 102 107 'agency' => new sfValidatorString(array('max_length' => 100, 'required' => false)), 103 108 'agency_city' => new sfValidatorString(array('max_length' => 100, 'required' => false)), 109 'agency_agent' => new sfValidatorString(array('max_length' => 100, 'required' => false)), 110 'agency_phone' => new sfValidatorString(array('max_length' => 100, 'required' => false)), 111 'agency_mail' => new sfValidatorString(array('max_length' => 100, 'required' => false)), 104 112 'nature_id' => new sfValidatorPropelChoice(array('model' => 'Market_nature', 'column' => 'id')), 105 113 'type_id' => new sfValidatorPropelChoice(array('model' => 'Market_type', 'column' => 'id')), … … 145 153 'building' => new sfValidatorString(array('max_length' => 100, 'required' => false)), 146 154 'sector' => new sfValidatorString(array('max_length' => 100, 'required' => false)), 155 'district_id' => new sfValidatorPropelChoice(array('model' => 'Apidistrict', 'column' => 'id', 'required' => false)), 147 156 'address1' => new sfValidatorString(array('max_length' => 100, 'required' => false)), 148 157 'address2' => new sfValidatorString(array('max_length' => 100, 'required' => false)), … … 176 185 'building_permit' => new sfValidatorBoolean(array('required' => false)), 177 186 'url' => new sfValidatorString(array('max_length' => 160, 'required' => false)), 187 'last_change' => new sfValidatorDate(array('required' => false)), 178 188 'created_at' => new sfValidatorDateTime(array('required' => false)), 179 189 'updated_at' => new sfValidatorDateTime(array('required' => false)), trunk/lib/model/Market.php
r434 r468 12 12 public function __toString() 13 13 { 14 $txt = $this->getMarket_type(); 15 $this->getNatureId() ? $txt .= ' en '.$this->getMarket_nature() : null; 16 $this->getCity() ? $txt .= ' '.__('Ã ').' '.$this->getCity() : null; 17 return $txt; 14 sfLoader::loadHelpers('I18N'); 15 // parts or old type 16 if($this->getTypeId()==1) $str = $this->getPartsName(); 17 else $str = $this->getMarket_type(); 18 // city or district 19 if(ParamPeer::getValueByName('estate_city', sfContext::getInstance()->getUser()->getSubscriber()->getAgencyId())): 20 if($this->getApidistrict()): 21 $str .= ' - '.$this->getApidistrict(); 22 elseif($this->getCity()): 23 $str .= ' '.__('in(at)').' '.$this->getCity(); 24 endif; 25 else: 26 $str .= ' '.__('in(at)').' '.$this->getCity(); 27 endif; 28 return (string)$str; 18 29 } 19 30
