Changeset 75
- Timestamp:
- 08/22/08 14:03:33 (3 months ago)
- Files:
-
- trunk/apps/main/config/routing.yml (modified) (3 diffs)
- trunk/apps/main/i18n/fr/messages.xml (modified) (2 diffs)
- trunk/apps/main/lib/myActions.class.php (modified) (18 diffs)
- trunk/apps/main/modules/applications/actions/actions.class.php (modified) (5 diffs)
- trunk/apps/main/modules/applications/actions/components.class.php (modified) (4 diffs)
- trunk/apps/main/modules/applications/templates/_filterForm.php (modified) (1 diff)
- trunk/apps/main/modules/applications/templates/_form.php (modified) (3 diffs)
- trunk/apps/main/modules/applications/templates/_popularTags.php (modified) (1 diff)
- trunk/apps/main/modules/applications/templates/_relatedTags.php (modified) (1 diff)
- trunk/apps/main/modules/applications/templates/addSuccess.php (modified) (1 diff)
- trunk/apps/main/modules/applications/templates/connectAsCompanySuccess.php (modified) (1 diff)
- trunk/apps/main/modules/applications/templates/connectAsDeveloperSuccess.php (modified) (5 diffs)
- trunk/apps/main/modules/applications/templates/detailsSuccess.php (modified) (9 diffs)
- trunk/apps/main/modules/applications/templates/homeSuccess.php (modified) (2 diffs)
- trunk/apps/main/modules/applications/templates/tagsSuccess.php (modified) (2 diffs)
- trunk/apps/main/modules/companies/actions/actions.class.php (modified) (5 diffs)
- trunk/apps/main/modules/companies/actions/components.class.php (modified) (1 diff)
- trunk/apps/main/modules/companies/templates/_form.php (modified) (3 diffs)
- trunk/apps/main/modules/companies/templates/addSuccess.php (modified) (1 diff)
- trunk/apps/main/modules/companies/templates/connectSuccess.php (modified) (7 diffs)
- trunk/apps/main/modules/companies/templates/contactSuccess.php (modified) (2 diffs)
- trunk/apps/main/modules/companies/templates/detailsSuccess.php (modified) (10 diffs)
- trunk/apps/main/modules/companies/templates/editSuccess.php (modified) (1 diff)
- trunk/apps/main/modules/companies/templates/homeSuccess.php (modified) (1 diff)
- trunk/apps/main/modules/companies/validate (deleted)
- trunk/apps/main/modules/feeds/actions/actions.class.php (modified) (3 diffs)
- trunk/apps/main/modules/home/templates/indexSuccess.php (modified) (1 diff)
- trunk/apps/main/modules/jobs/actions/actions.class.php (modified) (5 diffs)
- trunk/apps/main/modules/jobs/actions/components.class.php (modified) (3 diffs)
- trunk/apps/main/modules/jobs/templates/_entry.php (modified) (3 diffs)
- trunk/apps/main/modules/jobs/templates/_filterForm.php (modified) (1 diff)
- trunk/apps/main/modules/maps/templates/CompanySuccess.php (modified) (1 diff)
- trunk/apps/main/modules/maps/templates/sfGuardUserSuccess.php (modified) (1 diff)
- trunk/apps/main/modules/people/actions/actions.class.php (modified) (12 diffs)
- trunk/apps/main/modules/people/actions/components.class.php (modified) (1 diff)
- trunk/apps/main/modules/people/templates/_filterForm.php (modified) (1 diff)
- trunk/apps/main/modules/people/templates/contactSuccess.php (modified) (2 diffs)
- trunk/apps/main/modules/people/templates/detailsSuccess.php (modified) (14 diffs)
- trunk/apps/main/modules/sfGuardAuth/actions/actions.class.php (modified) (23 diffs)
- trunk/apps/main/modules/sfGuardAuth/templates/registerSuccess.php (modified) (2 diffs)
- trunk/apps/main/templates/_messages.php (modified) (1 diff)
- trunk/config/ProjectConfiguration.class.php (modified) (2 diffs)
- trunk/config/app.yml-dist (modified) (3 diffs)
- trunk/data/fixtures/data.yml (modified) (1 diff)
- trunk/lib/form/ActivationForm.class.php (modified) (2 diffs)
- trunk/lib/form/ApplicationCompanyForm.class.php (modified) (1 diff)
- trunk/lib/form/ApplicationDeveloperForm.class.php (modified) (1 diff)
- trunk/lib/form/ApplicationForm.class.php (modified) (3 diffs)
- trunk/lib/form/BaseFormPropel.class.php (modified) (2 diffs)
- trunk/lib/form/BlogPostForm.class.php (modified) (1 diff)
- trunk/lib/form/CompanyContactForm.class.php (added)
- trunk/lib/form/CompanyForm.class.php (modified) (1 diff)
- trunk/lib/form/CompanyPersonForm.class.php (modified) (1 diff)
- trunk/lib/form/CountrySelectorForm.class.php (modified) (2 diffs)
- trunk/lib/form/EventForm.class.php (modified) (1 diff)
- trunk/lib/form/JobFilterForm.class.php (added)
- trunk/lib/form/JobForm.class.php (modified) (1 diff)
- trunk/lib/form/LocalEventForm.class.php (modified) (1 diff)
- trunk/lib/form/PersonContactForm.class.php (added)
- trunk/lib/form/RecommendationForm.class.php (modified) (1 diff)
- trunk/lib/form/RegisterForm.class.php (modified) (5 diffs)
- trunk/lib/form/ResendActivationForm.class.php (modified) (2 diffs)
- trunk/lib/form/SigninForm.class.php (modified) (1 diff)
- trunk/lib/form/shared/BaseConnectionForm.class.php (modified) (5 diffs)
- trunk/lib/form/shared/BaseContactForm.class.php (added)
- trunk/lib/form/shared/BaseForm.class.php (added)
- trunk/lib/helper/ImageHelper.php (modified) (4 diffs)
- trunk/lib/helper/ObjectUrlHelper.php (modified) (24 diffs)
- trunk/lib/model/Application.php (modified) (1 diff)
- trunk/lib/model/Company.php (modified) (1 diff)
- trunk/lib/utils/SymfoniansTestBrowser.class.php (modified) (6 diffs)
- trunk/lib/utils/sfValidatedThumb.class.php (modified) (4 diffs)
- trunk/lib/validator/sfValidatorSchemaLicence.class.php (modified) (2 diffs)
- trunk/lib/validator/sfValidatorTags.class.php (modified) (3 diffs)
- trunk/lib/widget/sfWidgetFormSchemaFormatterDiv.class.php (modified) (1 diff)
- trunk/test/functional/main/applicationsActionsTest.php (modified) (9 diffs)
- trunk/test/functional/main/assets (added)
- trunk/test/functional/main/assets/sample_image.png (added)
- trunk/test/functional/main/companiesActionsTest.php (modified) (3 diffs)
- trunk/test/functional/main/conditionalCacheTest.php (modified) (3 diffs)
- trunk/test/functional/main/feedsActionsTest.php (modified) (1 diff)
- trunk/test/functional/main/homeActionsTest.php (modified) (3 diffs)
- trunk/test/functional/main/localEventsActionsTest.php (modified) (1 diff)
- trunk/test/functional/main/peopleActionsTest.php (modified) (1 diff)
- trunk/test/unit/BaseFormTest.php (added)
- trunk/web/css/style.css (modified) (5 diffs)
- trunk/web/uploads/people/standard (added)
- trunk/web/uploads/people/standard/samples (moved) (moved from trunk/web/uploads/people/samples)
- trunk/web/uploads/people/standard/samples/fabpot.png (copied) (copied from trunk/web/uploads/people/samples/fabpot.png)
- trunk/web/uploads/people/standard/samples/mbertier.png (copied) (copied from trunk/web/uploads/people/samples/mbertier.png)
- trunk/web/uploads/people/standard/samples/niko.jpg (copied) (copied from trunk/web/uploads/people/samples/niko.jpg)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/apps/main/config/routing.yml
r71 r75 111 111 112 112 # Applications 113 applications_test:114 url: /applications/test115 param: { module: applications, action: test }116 113 applications_countries: 117 114 url: /applications/countries … … 169 166 company_add: 170 167 url: /company/add 171 param: { module: companies, action: add}168 param: { module: companies, action: edit } 172 169 173 170 company_edit: … … 185 182 company_edit_connection: 186 183 url: /company/:slug/connection/:id/edit 187 param: { module: companies, action: editConnection}184 param: { module: companies, action: connect } 188 185 189 186 company_contact: trunk/apps/main/i18n/fr/messages.xml
r38 r75 315 315 <trans-unit id="69"> 316 316 <source>Fields marked with a <span class="left-star">star</span> are mandatory.</source> 317 <target>Les champs marqués d'une <span class="left-star"> star</span> sont obligatoires</target>317 <target>Les champs marqués d'une <span class="left-star">étoile</span> sont obligatoires</target> 318 318 </trans-unit> 319 319 … … 615 615 <trans-unit id="129"> 616 616 <source>Update %name% application informations</source> 617 <target>Mettre à jour les informations concernant l'application % application%</target>617 <target>Mettre à jour les informations concernant l'application %name%</target> 618 618 </trans-unit> 619 619 trunk/apps/main/lib/myActions.class.php
r62 r75 1 1 <?php 2 2 /** 3 * Shared actions stub 3 * Shared actions stub for all actions 4 4 * 5 5 */ … … 29 29 protected function buildPagerRoute($route_name, $params = array()) 30 30 { 31 $query_string = http_build_query($params, '', '&'); 32 if ($query_string) 31 if ($query_string = http_build_query($params, '', '&')) 33 32 { 34 33 $route = sprintf('%s?%s&page=', $route_name, $query_string); … … 38 37 $route = sprintf('%s?page=', $route_name); 39 38 } 39 40 40 return $route; 41 41 } … … 64 64 * Returns the rendered value of a partial 65 65 * 66 * @param string $module Module name67 * @param string $partial Partial name (including the underscore prefix)68 * @param array $vars Var to pass to the partial (optional)66 * @param string $module Module name 67 * @param string $partial Partial name (including the underscore prefix) 68 * @param array $vars Var to pass to the partial (optional) 69 69 * @return string 70 70 */ 71 71 protected function getRenderedPartial($module, $partial, $vars = array()) 72 72 { 73 $view = new sfPartialView(); 74 $view->initialize(sfContext::getInstance(), $module, $partial, null); 75 return $view->render($vars); 76 } 77 73 $view = new sfPartialView(sfContext::getInstance(), $module, $partial, null); 74 $view->setPartialVars($vars); 75 return $view->render(); 76 } 77 78 /** 79 * Get the current view cache manager, if any (it does not exist in dev env) 80 * 81 * @return sfViewCacheManager|null 82 */ 78 83 protected function getViewCacheManager() 79 84 { … … 81 86 } 82 87 88 /** 89 * Purges the cache related to a given object 90 * 91 * @param object $object 92 * @return mixed 93 */ 83 94 protected function purgeObjectRelatedCache($object) 84 95 { 85 96 $purge_method = sprintf('purge%sRelatedCache', ucfirst(get_class($object))); 97 86 98 if (method_exists($this, $purge_method)) 87 99 { … … 90 102 } 91 103 104 /** 105 * Purges the homepage cache related assets 106 * 107 */ 92 108 protected function purgeHomepage() 93 109 { … … 98 114 } 99 115 116 /** 117 * Purges the sections homepages cache related assets 118 * 119 */ 100 120 protected function purgeHomepages() 101 121 { … … 112 132 } 113 133 134 /** 135 * Purges an application cache related assets 136 * 137 * @param Application $application 138 */ 114 139 protected function purgeApplicationRelatedCache(Application $application) 115 140 { … … 127 152 } 128 153 154 /** 155 * Purges a company cache related assets 156 * 157 * @param Company $company 158 */ 129 159 protected function purgeCompanyRelatedCache(Company $company) 130 160 { … … 142 172 } 143 173 174 /** 175 * Purges a job cache related assets 176 * 177 * @param Job $job 178 */ 144 179 protected function purgeJobRelatedCache(Job $job) 145 180 { … … 157 192 } 158 193 194 /** 195 * Purges a user cache related assets 196 * 197 * @param sfGuardUser $person 198 */ 159 199 protected function purgePersonRelatedCache(sfGuardUser $person) 160 200 { … … 168 208 } 169 209 210 /** 211 * Purges a recommendation cache related assets 212 * 213 * @param Recommendation $recommendation 214 */ 170 215 protected function purgeRecommendationRelatedCache(Recommendation $recommendation) 171 216 { … … 179 224 } 180 225 226 /** 227 * Purges an application company relation cache 228 * 229 * @param ApplicationCompany $app_company 230 */ 181 231 protected function purgeApplicationCompanyRelatedCache(ApplicationCompany $app_company) 182 232 { … … 190 240 } 191 241 242 /** 243 * Purges an application developer related cache 244 * 245 * @param ApplicationDeveloper $app_person 246 */ 192 247 protected function purgeApplicationDeveloperRelatedCache(ApplicationDeveloper $app_person) 193 248 { … … 201 256 } 202 257 258 /** 259 * Purges a company person related cache 260 * 261 * @param CompanyPerson $company_person 262 */ 203 263 protected function purgeCompanyPersonRelatedCache(CompanyPerson $company_person) 204 264 { … … 298 358 } 299 359 $mailer->disconnect(); 300 360 301 361 // Add mailSent timestamp 302 362 $this->getUser()->setAttribute('lastMailAt', time()); 303 363 304 364 return ($sent > 0); 305 365 } … … 342 402 return $address; 343 403 } 344 404 345 405 /** 346 406 * Checks for mail flooding (die, dirty spammers) … … 352 412 { 353 413 $user = $this->getUser(); 354 414 355 415 if (!$user) 356 416 { 357 417 throw new sfException($this->__('Mail sending use the session, please allow cookies')); 358 418 } 359 419 360 420 $lastMailAt = $user->getAttribute('lastMailAt', null); 361 421 362 422 if (is_null($lastMailAt)) 363 423 { 364 424 return; 365 425 } 366 426 367 427 $ttl = sfConfig::get('app_mail_mail_flood_time', 300); 368 369 if (time() - $lastMailAt < $ttl) 428 429 if (time() - $lastMailAt < $ttl) 370 430 { 371 431 throw new sfException(sprintf($this->__('You must wait at least %d seconds between two mail send, please try again later'), $ttl)); 372 432 } 373 433 } 374 375 /** 376 * Post execution: if a form has been set, we put it in sfContext to be able 434 435 /** 436 * Post execution: if a form has been set, we put it in sfContext to be able 377 437 * to reference it in the layout or partials 378 438 * trunk/apps/main/modules/applications/actions/actions.class.php
r71 r75 38 38 39 39 $this->form = new ApplicationForm($application); 40 $this->form->setDefault('tags', $application->getTagsString()); 40 41 $this->setTemplate('edit'); 41 42 $message = $this->__('Application updated'); … … 53 54 } 54 55 55 $this->form->setDefault('tags', $application->getTagsString());56 $this->application = $application;57 58 56 if ($request->isMethod('post')) 59 57 { … … 79 77 80 78 $this->getUser()->setFlash('notice', $message); 81 $this->getUser()->setAttribute('from_app_creation', is_null($request->getParameter('slug')), 'symfonians');82 79 $this->redirect(sprintf($redirect, $application->getSlug())); 83 80 } … … 161 158 { 162 159 $connection = ApplicationDeveloperPeer::retrieveByPK($request->getParameter('id')); 160 163 161 $this->forward404If(is_null($connection)); 164 162 … … 200 198 'developer_id' => $this->getUser()->getId())); 201 199 $this->form->bind($params); 200 202 201 if ($this->form->isValid()) 203 202 { trunk/apps/main/modules/applications/actions/components.class.php
r2 r75 7 7 { 8 8 9 /** 10 * Filter form component 11 * 12 */ 9 13 public function executeFilterForm() 10 14 { 11 $this->countries = ApplicationPeer::retrieveCountries(); 15 $this->form = new CountrySelectorForm(ApplicationPeer::retrieveCountries()); 16 $this->form->setDefault('country', $this->getRequestParameter('country')); 12 17 } 13 18 19 /** 20 * Popular tags component 21 * 22 */ 14 23 public function executePopularTags() 15 24 { … … 20 29 } 21 30 31 /** 32 * Recently added apps component 33 * 34 */ 22 35 public function executeRecentlyAdded() 23 36 { … … 28 41 } 29 42 43 /** 44 * Recently updated apps component 45 * 46 */ 30 47 public function executeRecentlyUpdated() 31 48 { … … 36 53 } 37 54 55 /** 56 * Related tags component 57 * 58 */ 38 59 public function executeRelatedTags() 39 60 { 40 $this->related_tags = TagPeer::getRelatedTags($this->tag, 41 array('model' => 'Application')); 61 $this->related_tags = TagPeer::getRelatedTags($this->tag, array('model' => 'Application')); 42 62 } 43 63 64 /** 65 * User applications 66 * 67 */ 44 68 public function executeUserApplications() 45 69 { trunk/apps/main/modules/applications/templates/_filterForm.php
r56 r75 1 1 <form action="<?php echo url_for('@application_home') ?>" method="get" id="country_form"> 2 <?php /* 2 <?php echo $form['country']->renderLabel() ?> 3 <?php echo $form['country']->render() ?> 3 4 <p> 4 <label for="country"><?php echo __('Filter by country') ?></label> 5 <?php echo select_tag('country', 6 options_for_select($countries, 7 $sf_request->getParameter('country'), 8 array('include_custom' => __('All countries')))) ?> 5 <input type="checkbox" value="1" <?php echo $sf_request->hasParameter('opensource') ? 'checked="checked"' : '' ?> name="opensource" id="opensource"> 6 <label for="opensource" class="left"><?php echo __('Only open source applications') ?></label> 9 7 </p> 10 8 <p> 11 <?php echo checkbox_tag('opensource', 1, $sf_request->hasParameter('opensource'), 'id=opensource') ?> 12 <?php echo label_for('opensource', __('Only open source applications'), 'class=left') ?> 9 <input type="submit" value="<?php echo __('Filter') ?>" name="commit"/> 13 10 </p> 14 <p>15 <?php echo submit_tag(__('Filter')) ?>16 </p>17 */ ?>18 11 </form> trunk/apps/main/modules/applications/templates/_form.php
r70 r75 15 15 <legend><?php echo __('Application informations') ?></legend> 16 16 <div class="form-row required <?php echo $form['name']->hasError() ? 'field_error' : '' ?>"> 17 <?php echo $form['name']->renderLabel( ) ?>17 <?php echo $form['name']->renderLabel(__('Application name')) ?> 18 18 <?php echo $form['name']->render() ?> 19 19 <?php echo $form['name']->renderError() ?> … … 28 28 <legend><?php echo __('Other informations') ?></legend> 29 29 <?php echo $form['country']->renderRow() ?> 30 <?php echo $form['screenshot_file']->renderRow( ) ?>30 <?php echo $form['screenshot_file']->renderRow(array(), __('Screenshot')) ?> 31 31 <div class="form-row"> 32 32 <?php echo $form['is_opensource'] ?> 33 <?php echo $form['is_opensource']->renderLabel(__(' Is this application open source?'), array('class' => 'inline')) ?>33 <?php echo $form['is_opensource']->renderLabel(__('This application is open source'), array('class' => 'inline')) ?> 34 34 </div> 35 <?php echo $form['licence']->renderRow(array(), __(' If application is open source, how is it licensed?')) ?>35 <?php echo $form['licence']->renderRow(array(), __('Licence informations')) ?> 36 36 <?php echo $form['feed_url']->renderRow() ?> 37 37 <div class="date_select"> … … 43 43 <div class="form-row" style="text-align:center;clear:left;"> 44 44 <p> 45 <?php echo $form['id'] ?> 45 46 <?php echo $form['_csrf_token'] ?> 46 47 <input type="submit" value="<?php echo $submit_label ?>" /> trunk/apps/main/modules/applications/templates/_popularTags.php
r2 r75 2 2 <h3><?php echo __('Tags') ?></h3> 3 3 <div class="tags_cloud"> 4 <?php echo tag_cloud($tags , '@application_tag?tag=') ?>4 <?php echo tag_cloud($tags->getRawValue(), '@application_tag?tag=%s') ?> 5 5 </div> 6 6 <p class="more"> trunk/apps/main/modules/applications/templates/_relatedTags.php
r2 r75 3 3 array('%tag%' => tags_string($tag))) ?></h3> 4 4 <div class="tags_cloud"> 5 <?php echo more_related_tag_cloud($related_tags, '@application_home?tag= ', $tag)?>5 <?php echo more_related_tag_cloud($related_tags, '@application_home?tag=%s', $tag)?> 6 6 </div> 7 7 <p class="more"> trunk/apps/main/modules/applications/templates/addSuccess.php
r56 r75 5 5 6 6 <?php include_partial('applications/form', 7 array('application' => $ application,7 array('application' => $form->getObject(), 8 8 'form' => $form, 9 9 'title' => $page_title, trunk/apps/main/modules/applications/templates/connectAsCompanySuccess.php
r71 r75 9 9 <?php slot('sidebar') ?> 10 10 <?php if ($application->getScreenshotPath()): ?> 11 <?php $image = image_tag($application->getFullScreenshotPath(), 12 'class=app_screenshot alt='.$application->getName().' preview') ?> 11 <?php $image = application_image_tag($application, 'class=app_screenshot alt='.$application->getName().' preview') ?> 13 12 <?php if ($application->getHomepage()): ?> 14 13 <?php echo link_to($image, $application->getHomepage()) ?> trunk/apps/main/modules/applications/templates/connectAsDeveloperSuccess.php
r68 r75 2 2 3 3 <?php slot('page_title') ?> 4 <?php $page_title = __('Connect yourself to the %application% application', 4 <?php $page_title = __('Connect yourself to the %application% application', 5 5 array('%application%' => $application->getName())) ?> 6 6 <?php echo $page_title ?> … … 9 9 <?php slot('sidebar') ?> 10 10 <?php if ($application->getScreenshotPath()): ?> 11 <?php $image = image_tag($application->getFullScreenshotPath(), 12 'class=app_screenshot alt='.$application->getName().' preview') ?> 11 <?php $image = image_tag($application, 'class=app_screenshot alt='.$application->getName().' preview') ?> 13 12 <?php if ($application->getHomepage()): ?> 14 13 <?php echo link_to($image, $application->getHomepage()) ?> … … 19 18 <?php end_slot() ?> 20 19 21 <?php echo breadcrumb(array(array(__('Applications'), '@application_home'), 20 <?php echo breadcrumb(array(array(__('Applications'), '@application_home'), 22 21 array($application->getName(), '@application_page?slug='.$application->getSlug()), 23 22 $page_title)) ?> … … 25 24 <h2><?php echo $page_title ?><span class="gradient"> </span></h2> 26 25 27 <?php if (isset($from_app_creation) && $from_app_creation): ?> 28 <p><?php echo __('Now that your app has been added, please provide some informations on how you\'ve been implied with it :-)') ?></p> 29 <?php else: ?> 30 <p><?php echo __('If you have worked on the %application% application, please fill and submit the form below.', 31 array('%application%' => $application->getName())) ?></p> 32 <?php endif; ?> 26 <p><?php echo __('If you have worked on the %application% application, please fill and submit the form below.', 27 array('%application%' => $application->getName())) ?></p> 33 28 34 29 <p class="form-info"> … … 40 35 <fieldset> 41 36 <legend><?php echo __('Connection informations') ?></legend> 42 <div class="form-row required ">37 <div class="form-row required <?php echo $form['role']->hasError() ? 'field_error' : '' ?>"> 43 38 <?php echo $form['role']->renderLabel(__('Your role in this project')) ?> 44 39 <?php echo $form['role']->render() ?> trunk/apps/main/modules/applications/templates/detailsSuccess.php
r2 r75 8 8 <?php slot('sidebar') ?> 9 9 <?php if ($application->getScreenshotPath()): ?> 10 <?php $image = image_tag($application->getFullScreenshotPath(), 11 'class=app_screenshot alt='.$application->getName().' preview') ?> 10 <?php $image = application_image_tag($application, 'class=app_screenshot alt='.$application->getName().' preview') ?> 12 11 <?php if ($application->getHomepage()): ?> 13 12 <?php echo link_to($image, $application->getHomepage()) ?> … … 26 25 <ul class="admin_actions"> 27 26 <li> 28 <?php echo link_to(__('Edit this application informations'), 27 <?php echo link_to(__('Edit this application informations'), 29 28 '@application_edit?slug='.$application->getSlug(), 30 29 'class=bigedit') ?></li> 31 30 <li> 32 <?php echo link_to(__('Delete this application'), 31 <?php echo link_to(__('Delete this application'), 33 32 '@application_delete?slug='.$application->getSlug(), 34 33 'class=bigdelete confirm='.__('Are you sure?')) ?></li> 35 34 <?php if ($sf_user->isAdmin()): ?> 36 35 <li> 37 <?php echo link_to(__('Promote as featured on homepage'), 36 <?php echo link_to(__('Promote as featured on homepage'), 38 37 '@application_promote?slug='.$application->getSlug(), 39 38 'class=promote confirm='.__('Are you sure?')) ?></li> … … 42 41 <?php endif; ?> 43 42 <h3><?php echo __('Have a nice symfony app?') ?></h3> 44 <?php echo big_button_to(__('Add an application'), 43 <?php echo big_button_to(__('Add an application'), 45 44 '@application_add', 'id=bt_addapp') ?> 46 45 <?php end_slot() ?> 47 46 48 47 <div class="fiftypercent"> 49 50 <?php echo breadcrumb(array(array(__('Applications'), '@application_home'), 48 49 <?php echo breadcrumb(array(array(__('Applications'), '@application_home'), 51 50 $page_title)) ?> 52 51 53 52 <h2> 54 53 <?php echo $page_title ?> … … 61 60 <span class="gradient"> </span> 62 61 </h2> 63 62 64 63 <?php include_partial('applications/entry', 65 64 array('application' => $application)) ?> 66 65 67 66 </div> 68 67 … … 86 85 <?php endif; ?> 87 86 <?php if ($sf_user->getId() == $app_person->getDeveloperId()): ?> 88 <?php echo link_to(image_tag('page_edit.png', 'alt=Edit '),87 <?php echo link_to(image_tag('page_edit.png', 'alt=Edit person connection'), 89 88 '@application_edit_developer_connection?slug='.$application->getSlug().'&id='.$app_person->getId(), 90 89 'title='.__('Edit your connection with ').$app_person->getApplication()->getName().' rel=nofollow class=edit') ?> … … 116 115 <?php endif; ?> 117 116 </div> 118 117 119 118 <div class="related_companies"> 120 119 <h3><?php echo __('Companies related to this application') ?></h3> … … 125 124 <tr class="<?php echo $i % 2 == 0 ? 'row' : 'row odd' ?>"> 126 125 <td class="mini_thumb_cell"> 127 <?php echo link_to( image_tag($company_application->getCompany()->getFullLogoPath(),126 <?php echo link_to(company_image_tag($company_application->getCompany(), 128 127 'class=mini_thumb'), 129 128 '@company_page?slug='.$company_application->getCompany()->getSlug(), … … 137 136 <?php endif; ?> 138 137 <?php if ($sf_user->getId() == $company_application->getSubmitterId()): ?> 139 <?php echo link_to(image_tag('page_edit.png', 'alt=Edit '),138 <?php echo link_to(image_tag('page_edit.png', 'alt=Edit company connection'), 140 139 '@application_edit_company_connection?slug='.$application->getSlug().'&id='.$company_application->getId(), 141 140 'title='.__('Edit this connection to ').$company_application->getCompany()->getName().' rel=nofollow class=edit') ?> … … 161 160 <?php endif; ?> 162 161 <p class="more"> 163 <?php echo link_to(__('Connect a company!'), 162 <?php echo link_to(__('Connect a company!'), 164 163 '@application_connect_as_company?slug='.$application->getSlug()) ?> 165 164 </p> 166 165 </div> 167 166 168 167 </div> trunk/apps/main/modules/applications/templates/homeSuccess.php
r11 r75 62 62 <?php endif; ?> 63 63 <?php echo link_to($application->getName(), 64 '@application_page?slug='.$application->getSlug()) ?>64 '@application_page?slug='.$application->getSlug()) ?> 65 65 <?php if ($application->getCountry()): ?> 66 66 <?php echo flag_image_tag($application->getCountry()) ?> … … 69 69 <div class="thumb_area"> 70 70 <p><?php if ($application->getScreenshotPath()): ?> 71 <?php echo link_to(image_tag($application->getFullScreenshotPath(), 72 'alt=screenshot'), 71 <?php echo link_to(application_image_tag($application, 'alt=screenshot'), 73 72 '@application_page?slug='.$application->getSlug(), 74 73 'class=thumb_link') ?> trunk/apps/main/modules/applications/templates/tagsSuccess.php
r2 r75 10 10 <?php end_slot() ?> 11 11 12 <?php echo breadcrumb(array(array(__('Applications'), '@application_home'), 12 <?php echo breadcrumb(array(array(__('Applications'), '@application_home'), 13 13 $page_title)) ?> 14 14 … … 19 19 20 20 <div class="tags_cloud big_cloud"> 21 <?php echo tag_cloud($tags, '@application_home?tag= ') ?>21 <?php echo tag_cloud($tags, '@application_home?tag=%s') ?> 22 22 </div> trunk/apps/main/modules/companies/actions/actions.class.php
r48 r75 9 9 { 10 10 11 public function executeAdd() 12 { 13 $this->company = new Company(); 14 if ($this->getRequest()->getMethod() == sfRequest::POST) 15 { 16 $this->updateFromRequest(); 17 parent::purgeObjectRelatedCache($this->company); 18 $this->getUser()->setFlash('notice', $this->__('Company added')); 19 $this->getUser()->setAttribute('from_company_creation', true, 'symfonians'); 20 $this->redirect('@company_connect_as_member?slug='.$this->company->getSlug()); 21 } 22 } 23 24 public function executeEdit() 11 /** 12 * Adds or edit a Company 13 * 14 * @param sfWebRequest $request 15 */ 16 public function executeEdit(sfWebRequest $request) 17 { 18 if (!is_null($request->getParameter('slug'))) 19 { 20 $company = $this->getFromSlug(); 21 22 $this->forward404If(is_null($company), sprintf('Company with slug "%s" not found', $request->getParameter('slug'))); 23 24 if (!$this->getUser()->isAdmin() && $company->getSubmitterId() != $this->getUser()->getId()) 25 { 26 $this->getUser()->setFlash('warning', $this->__('You are not allowed to edit this record')); 27 $this->redirect('@company_page?slug='.$company->getSlug()); 28 } 29 30 $this->form = new CompanyForm($company); 31 $this->setTemplate('edit'); 32 $message = $this->__('Company updated'); 33 $redirect = '@company_page?slug=%s'; 34 $creation = false; 35 } 36 else 37 { 38 $company = new Company(); 39 $this->form = new CompanyForm(); 40 $this->setTemplate('add'); 41 $message = $this->__('Company added'); 42 $redirect = '@company_connect_as_member?slug=%s'; 43 $creation = true; 44 } 45 46 if ($request->isMethod('post')) 47 { 48 $submitter_id = $this->getUser()->isAdmin() && $company->getSubmitterId() ? $company->getSubmitterId() : $this->getUser()->getId(); 49 $params = array_merge($request->getParameter('company'), 50 array('submitter_id' => $submitter_id)); 51 $this->form->bind($params, $request->getFiles('company')); 52 53 if (!$this->form->isValid() or is_null($company = $this->form->save())) 54 { 55 return sfView::SUCCESS; 56 } 57 58 /* @var $thumb sfValidatedThumb */ 59 if (!is_null($thumb = $this->form->getValue('logo_file'))) 60 { 61 $thumb->saveThumb('companies', $company, 'setLogoPath'); 62 } 63 64 parent::purgeObjectRelatedCache($company); 65 66 $this->getUser()->setFlash('notice', $this->__('Company updated')); 67 $this->redirect(sprintf($redirect, $company->getSlug())); 68 } 69 } 70 71 /** 72 * Connect to a company 73 * 74 * @param sfWebRequest $request
