Development

Changeset 15667

You must first sign up to be able to contribute.

Changeset 15667

Show
Ignore:
Timestamp:
02/20/09 23:34:26 (4 years ago)
Author:
Stephen.Ostrow
Message:
  • Updated the rest of the modules to use the new admin-generation system
  • Added an admin module for sfUserEmailAddressType which is new to the sfDoctrineUserPlugin 1.2 API
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserAddress/actions/actions.class.php

    r12393 r15667  
    11<?php 
     2 
     3require_once dirname(__FILE__).'/../lib/sfUserAddressGeneratorConfiguration.class.php'; 
     4require_once dirname(__FILE__).'/../lib/sfUserAddressGeneratorHelper.class.php'; 
    25 
    36/** 
    47 * sfUserAddress actions. 
    58 * 
    6  * @package    sfDoctrineUserPlugin 
     9 * @package    americanhealthplans 
    710 * @subpackage sfUserAddress 
    811 * @author     Stephen Ostrow <sostrow@sowebdesigns.com> 
    9  * @version    SVN: $Id: actions.class.php 1415 2006-06-11 08:33:51Z fabien $ 
     12 * @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $ 
    1013 */ 
    11 class sfUserAddressActions extends autosfUserAddressActions 
     14class sfUserAddressActions extends autoSfUserAddressActions 
    1215{ 
    13   public function executeAjaxSave() 
    14   { 
    15     $this->forward('sfUserAddress', 'ajaxEdit'); 
    16   } 
    17      
    18   public function executeAjaxEdit() 
    19   { 
    20     $this->sf_user_address = $this->getsfUserAddressOrCreate(); 
    21      
    22     if ( !$this->sf_user_address['id'] && $this->hasRequestParameter('sf_user_id') ) 
    23       $this->sf_user_address->set('user_id', $this->getRequestParameter('sf_user_id')); 
    24  
    25     if ( $this->getRequest()->getMethod() == sfRequest::POST) 
    26     { 
    27       $this->updatesfUserAddressFromRequest(); 
    28  
    29       $this->savesfUserAddress($this->sf_user_address); 
    30  
    31       //$this->setFlash('notice', 'Your modifications have been saved'); 
    32  
    33       $this->sf_user_user = $this->sf_user_address['User']; 
    34       $this->setTemplate('ajaxList'); 
    35       return sfView::SUCCESS; 
    36     } 
    37     else 
    38     { 
    39       $this->addJavascriptsForEdit(); 
    40  
    41       $this->labels = $this->getLabels(); 
    42     } 
    43      
    44     // temporary fix to avoid using a distinct editSuccess.php template 
    45     sfLoader::loadHelpers(array('Helper', 'ObjectDoctrineAdmin')); 
    46   } 
    47  
    48   public function executeAjaxDelete () 
    49   { 
    50     $this->sf_user_address = Doctrine::getTable('sfUserAddress')->find($this->getRequestParameter('id')); 
    51     $this->sf_user_user = $this->sf_user_address['User']; 
    52      
    53     $this->forward404Unless($this->sf_user_address); 
    54  
    55     try 
    56     { 
    57       $this->deletesfUserAddress($this->sf_user_address); 
    58     } 
    59     catch (Doctrine_Exception $e) 
    60     { 
    61       $this->getRequest()->setError('delete', 'Could not delete the selected Sf user address. Make sure it does not have any associated items.'); 
    62       return $this->forward('sfUserAddress', 'list'); 
    63     } 
    64      
    65     $this->setTemplate('ajaxList'); 
    66     return sfView::SUCCESS; 
    67   } 
    6816} 
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserAddress/config/generator.yml

    r12393 r15667  
    11generator: 
    2   class:              sfDoctrineAdminGenerator 
     2  class: sfDoctrineGenerator 
    33  param: 
    4     model_class:      sfUserAddress 
    5     theme:            default 
    6        
    7     fields: 
    8       updated_at: { type: plain, params: date_format='MM/dd/yy hh:mm a' } 
    9       UpdatedBy: { type: plain } 
    10       created_at: { type: plain, params: date_format='MM/dd/yy hh:mm a' } 
    11       CreatedBy: { type: plain } 
    12        
    13     list: 
    14       title: Addresses for Users 
    15       display: [ User, rank, AddressType, address1, city, State ] 
    16       object_actions: 
    17         _edit:    - 
    18         _delete:  - 
    19       actions: 
    20         _create:  { name: Add Address } 
    21       sort_by:    [ sfUserUser, asc ] 
    22        
    23     edit: 
    24       title: Editing Address For "%%User%%" 
    25       display: 
    26         "Details":  [ _User, rank, AddressType, address1, address2, address3, city, State, zip ] 
    27         "NONE":     [ updated_at, UpdatedBy, created_at, CreatedBy ] 
    28       actions: 
    29           _save: - 
    30           _save_and_add: - 
    31           _save_and_list: - 
    32           _list: - 
    33           _delete: - 
     4    model_class:           sfUserAddress 
     5    theme:                 admin 
     6    non_verbose_templates: true 
     7    with_show:             false 
     8    singular:              ~ 
     9    plural:                ~ 
     10    route_prefix:          sf_user_address 
     11    with_doctrine_route:     1 
     12 
     13    config: 
     14      actions: ~ 
     15      fields:  ~ 
     16      list:    ~ 
     17      filter:  ~ 
     18      form:    ~ 
     19      edit:    ~ 
     20      new:     ~ 
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserAddressType/actions/actions.class.php

    r12393 r15667  
    11<?php 
     2 
     3require_once dirname(__FILE__).'/../lib/sfUserAddressTypeGeneratorConfiguration.class.php'; 
     4require_once dirname(__FILE__).'/../lib/sfUserAddressTypeGeneratorHelper.class.php'; 
    25 
    36/** 
    47 * sfUserAddressType actions. 
    58 * 
    6  * @package    sfDoctrineUserPlugin 
     9 * @package    americanhealthplans 
    710 * @subpackage sfUserAddressType 
    811 * @author     Stephen Ostrow <sostrow@sowebdesigns.com> 
    9  * @version    SVN: $Id: actions.class.php 1415 2006-06-11 08:33:51Z fabien $ 
     12 * @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $ 
    1013 */ 
    11 class sfUserAddressTypeActions extends autosfUserAddressTypeActions 
     14class sfUserAddressTypeActions extends autoSfUserAddressTypeActions 
    1215{ 
    1316} 
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserAddressType/config/generator.yml

    r12393 r15667  
    11generator: 
    2   class:              sfDoctrineAdminGenerator 
     2  class: sfDoctrineGenerator 
    33  param: 
    4     model_class:      sfUserAddressType 
    5     theme:            default 
     4    model_class:           sfUserAddressType 
     5    theme:                 admin 
     6    non_verbose_templates: true 
     7    with_show:             false 
     8    singular:              ~ 
     9    plural:                ~ 
     10    route_prefix:          sf_user_address_type 
     11    with_doctrine_route:     1 
     12 
     13    config: 
     14      actions: ~ 
     15      fields:  ~ 
     16      list:    ~ 
     17      filter:  ~ 
     18      form:    ~ 
     19      edit:    ~ 
     20      new:     ~ 
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserBilling/actions/actions.class.php

    r12393 r15667  
    11<?php 
     2 
     3require_once dirname(__FILE__).'/../lib/sfUserBillingGeneratorConfiguration.class.php'; 
     4require_once dirname(__FILE__).'/../lib/sfUserBillingGeneratorHelper.class.php'; 
    25 
    36/** 
    47 * sfUserBilling actions. 
    58 * 
    6  * @package    sfDoctrineUserPlugin 
     9 * @package    americanhealthplans 
    710 * @subpackage sfUserBilling 
    811 * @author     Stephen Ostrow <sostrow@sowebdesigns.com> 
    9  * @version    SVN: $Id: actions.class.php 1415 2006-06-11 08:33:51Z fabien $ 
     12 * @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $ 
    1013 */ 
    11 class sfUserBillingActions extends autosfUserBillingActions 
     14class sfUserBillingActions extends autoSfUserBillingActions 
    1215{ 
    13   public function executeAjaxSave() 
    14   { 
    15     $this->forward('sfUserBilling', 'ajaxEdit'); 
    16   } 
    17  
    18   public function executeAjaxEdit () 
    19   { 
    20     $this->sf_user_billing = $this->getsfUserBillingOrCreate(); 
    21      
    22     if ( !$this->sf_user_billing['id'] && $this->hasRequestParameter('sf_user_id') ) 
    23       $this->sf_user_billing->set('user_id', $this->getRequestParameter('sf_user_id')); 
    24  
    25     if ($this->getRequest()->getMethod() == sfRequest::POST) 
    26     { 
    27       $this->updatesfUserBillingFromRequest(); 
    28  
    29       $this->savesfUserBilling($this->sf_user_billing); 
    30  
    31       $this->setFlash('notice', 'Your modifications have been saved'); 
    32  
    33       $this->sf_user_user = $this->sf_user_billing['User']; 
    34       $this->setTemplate('ajaxList'); 
    35       return sfView::SUCCESS; 
    36     } 
    37     else 
    38     { 
    39       $this->addJavascriptsForEdit(); 
    40  
    41       $this->labels = $this->getLabels(); 
    42     } 
    43      
    44     // temporary fix to avoid using a distinct editSuccess.php template 
    45     sfLoader::loadHelpers(array('Helper', 'ObjectDoctrineAdmin')); 
    46   } 
    47  
    48   public function executeAjaxDelete () 
    49   { 
    50     $this->sf_user_billing = Doctrine::getTable('sfUserBilling')->find($this->getRequestParameter('id')); 
    51     $this->sf_user_user = $this->sf_user_billing['User']; 
    52      
    53     $this->forward404Unless($this->sf_user_billing); 
    54  
    55     try 
    56     { 
    57       $this->deletesfUserBilling($this->sf_user_billing); 
    58     } 
    59     catch (Doctrine_Exception $e) 
    60     { 
    61       $this->getRequest()->setError('delete', 'Could not delete the selected Sf user billing. Make sure it does not have any associated items.'); 
    62       return $this->forward('sfUserBilling', 'list'); 
    63     } 
    64  
    65     $this->setTemplate('ajaxList'); 
    66     return sfView::SUCCESS; 
    67   } 
    6816} 
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserBilling/config/generator.yml

    r12393 r15667  
    11generator: 
    2   class:              sfDoctrineAdminGenerator 
     2  class: sfDoctrineGenerator 
    33  param: 
    4     model_class:      sfUserBilling 
    5     theme:            default 
    6        
    7     fields: 
    8       updated_at: { type: plain, params: date_format='MM/dd/yy hh:mm a' } 
    9       UpdatedBy: { type: plain } 
    10       created_at: { type: plain, params: date_format='MM/dd/yy hh:mm a' } 
    11       CreatedBy: { type: plain } 
    12        
    13     list: 
    14       title: Billings for Users 
    15       display: [ User, rank, name, address1, city, state, method, CreditCardType.abbreviation, check_type ] 
    16       object_actions: 
    17         _edit:    - 
    18         _delete:  - 
    19       actions: 
    20         _create:  { name: Add Address } 
    21       sort_by:    [ sfUserUser, asc ] 
    22        
    23     edit: 
    24       title: Editing Billing For "%%User%%" 
    25       display: 
    26         "Details":  [ _User, rank, name, address1, address2, city, state, zip, method, rejects ] 
    27         "Credit Card": [ credit_card_number, credit_card_exp_month, credit_card_exp_year, credit_card_cvm ] 
    28         "Check": [ check_type, check_number, check_routing_number, check_account_number, check_bank_name, check_branch_state, dl_number, dl_state ] 
    29         "NONE":     [ updated_at, UpdatedBy, created_at, CreatedBy ] 
    30       fields: 
    31         check_type: 
    32           params: 
    33             disabled=true 
    34             date_format='MM/dd/yy' 
    35             include_blank=true 
    36             include_custom=Choose from the list 
    37       actions: 
    38           _save: - 
    39           _save_and_add: - 
    40           _save_and_list: - 
    41           _list: - 
    42           _delete: - 
     4    model_class:           sfUserBilling 
     5    theme:                 admin 
     6    non_verbose_templates: true 
     7    with_show:             false 
     8    singular:              ~ 
     9    plural:                ~ 
     10    route_prefix:          sf_user_billing 
     11    with_doctrine_route:     1 
     12 
     13    config: 
     14      actions: ~ 
     15      fields:  ~ 
     16      list:    ~ 
     17      filter:  ~ 
     18      form:    ~ 
     19      edit:    ~ 
     20      new:     ~ 
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserCountry/actions/actions.class.php

    r15642 r15667  
    11<?php 
     2 
     3require_once dirname(__FILE__).'/../lib/sfUserCountryGeneratorConfiguration.class.php'; 
     4require_once dirname(__FILE__).'/../lib/sfUserCountryGeneratorHelper.class.php'; 
    25 
    36/** 
    47 * sfUserCountry actions. 
    58 * 
    6  * @package    sfDoctrineUserPlugin 
     9 * @package    americanhealthplans 
    710 * @subpackage sfUserCountry 
    811 * @author     Stephen Ostrow <sostrow@sowebdesigns.com> 
    9  * @version    SVN: $Id: actions.class.php 1415 2006-06-11 08:33:51Z fabien $ 
     12 * @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $ 
    1013 */ 
    11 require_once(dirname(__FILE__).'/../lib/BasesfUserCountryActions.class.php'); 
    12 require_once dirname(__FILE__).'/../lib/sfUserCountryGeneratorConfiguration.class.php'; 
    13 require_once dirname(__FILE__).'/../lib/sfUserCountryGeneratorHelper.class.php'; 
    14 class sfUserCountryActions extends BasesfUserCountryActions 
     14class sfUserCountryActions extends autoSfUserCountryActions 
    1515{ 
    1616} 
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserCountry/config/generator.yml

    r15643 r15667  
    11generator: 
    2   class:              sfDoctrineGenerator 
     2  class: sfDoctrineGenerator 
    33  param: 
    4     model_class:      sfUserCountry 
    5     theme:            admin 
     4    model_class:           sfUserCountry 
     5    theme:                 admin 
    66    non_verbose_templates: true 
    77    with_show:             false 
     
    1010    route_prefix:          sf_user_country 
    1111    with_doctrine_route:     1 
     12 
     13    config: 
     14      actions: ~ 
     15      fields:  ~ 
     16      list:    ~ 
     17      filter:  ~ 
     18      form:    ~ 
     19      edit:    ~ 
     20      new:     ~ 
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserCountry/lib/sfUserCountryGeneratorConfiguration.class.php

    r15642 r15667  
    22 
    33/** 
    4  * sfSettings module configuration. 
     4 * sfUserCountry module configuration. 
    55 * 
    6  * @package    sfDoctrineSettingsPlugin 
    7  * @subpackage sfSettings 
     6 * @package    americanhealthplans 
     7 * @subpackage sfUserCountry 
    88 * @author     Stephen Ostrow <sostrow@sowebdesigns.com> 
    9  * @version    SVN: $Id
     9 * @version    SVN: $Id: configuration.php 12474 2008-10-31 10:41:27Z fabien
    1010 */ 
    1111class sfUserCountryGeneratorConfiguration extends BaseSfUserCountryGeneratorConfiguration 
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserCountry/lib/sfUserCountryGeneratorHelper.class.php

    r15642 r15667  
    22 
    33/** 
    4  * sfSettings module helper. 
     4 * sfUserCountry module helper. 
    55 * 
    6  * @package    sfDoctrineSettingsPlugin 
    7  * @subpackage sfSettings 
     6 * @package    americanhealthplans 
     7 * @subpackage sfUserCountry 
    88 * @author     Stephen Ostrow <sostrow@sowebdesigns.com> 
    9  * @version    SVN: $Id
     9 * @version    SVN: $Id: helper.php 12474 2008-10-31 10:41:27Z fabien
    1010 */ 
    1111class sfUserCountryGeneratorHelper extends BaseSfUserCountryGeneratorHelper 
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserCreditCardType/actions/actions.class.php

    r12393 r15667  
    11<?php 
     2 
     3require_once dirname(__FILE__).'/../lib/sfUserCreditCardTypeGeneratorConfiguration.class.php'; 
     4require_once dirname(__FILE__).'/../lib/sfUserCreditCardTypeGeneratorHelper.class.php'; 
    25 
    36/** 
    47 * sfUserCreditCardType actions. 
    58 * 
    6  * @package    sfDoctrineUserPlugin 
     9 * @package    americanhealthplans 
    710 * @subpackage sfUserCreditCardType 
    811 * @author     Stephen Ostrow <sostrow@sowebdesigns.com> 
    9  * @version    SVN: $Id: actions.class.php 1415 2006-06-11 08:33:51Z fabien $ 
     12 * @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $ 
    1013 */ 
    11 class sfUserCreditCardTypeActions extends autosfUserCreditCardTypeActions 
     14class sfUserCreditCardTypeActions extends autoSfUserCreditCardTypeActions 
    1215{ 
    1316} 
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserCreditCardType/config/generator.yml

    r12393 r15667  
    11generator: 
    2   class:              sfDoctrineAdminGenerator 
     2  class: sfDoctrineGenerator 
    33  param: 
    4     model_class:      sfUserCreditCardType 
    5     theme:            default 
     4    model_class:           sfUserCreditCardType 
     5    theme:                 admin 
     6    non_verbose_templates: true 
     7    with_show:             false 
     8    singular:              ~ 
     9    plural:                ~ 
     10    route_prefix:          sf_user_credit_card_type 
     11    with_doctrine_route:     1 
     12 
     13    config: 
     14      actions: ~ 
     15      fields:  ~ 
     16      list:    ~ 
     17      filter:  ~ 
     18      form:    ~ 
     19      edit:    ~ 
     20      new:     ~ 
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserEmailAddress/actions/actions.class.php

    r12393 r15667  
    11<?php 
     2 
     3require_once dirname(__FILE__).'/../lib/sfUserEmailAddressGeneratorConfiguration.class.php'; 
     4require_once dirname(__FILE__).'/../lib/sfUserEmailAddressGeneratorHelper.class.php'; 
    25 
    36/** 
    47 * sfUserEmailAddress actions. 
    58 * 
    6  * @package    sfDoctrineUserPlugin 
     9 * @package    americanhealthplans 
    710 * @subpackage sfUserEmailAddress 
    811 * @author     Stephen Ostrow <sostrow@sowebdesigns.com> 
    9  * @version    SVN: $Id: actions.class.php 1415 2006-06-11 08:33:51Z fabien $ 
     12 * @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $ 
    1013 */ 
    11 class sfUserEmailAddressActions extends autosfUserEmailAddressActions 
     14class sfUserEmailAddressActions extends autoSfUserEmailAddressActions 
    1215{ 
    13   public function executeAjaxSave() 
    14   { 
    15     $this->forward('sfUserEmailAddress', 'ajaxEdit'); 
    16   } 
    17  
    18   public function executeAjaxEdit () 
    19   { 
    20     $this->sf_user_email_address = $this->getsfUserEmailAddressOrCreate(); 
    21      
    22     if ( !$this->sf_user_email_address['id'] && $this->hasRequestParameter('sf_user_id') ) 
    23       $this->sf_user_email_address->set('user_id', $this->getRequestParameter('sf_user_id')); 
    24      
    25     if ($this->getRequest()->getMethod() == sfRequest::POST) 
    26     { 
    27       $this->updatesfUserEmailAddressFromRequest(); 
    28  
    29       $this->savesfUserEmailAddress($this->sf_user_email_address); 
    30  
    31       $this->sf_user_user = $this->sf_user_email_address['User']; 
    32       $this->setTemplate('ajaxList'); 
    33       return sfView::SUCCESS; 
    34     } 
    35     else 
    36     { 
    37       $this->addJavascriptsForEdit(); 
    38  
    39       $this->labels = $this->getLabels(); 
    40     } 
    41      
    42     // temporary fix to avoid using a distinct editSuccess.php template 
    43     sfLoader::loadHelpers(array('Helper', 'ObjectDoctrineAdmin')); 
    44   } 
    45  
    46   public function executeAjaxDelete () 
    47   { 
    48     $this->sf_user_email_address = Doctrine::getTable('sfUserEmailAddress')->find($this->getRequestParameter('id')); 
    49     $this->sf_user_user = $this->sf_user_email_address['User']; 
    50      
    51     $this->forward404Unless($this->sf_user_email_address); 
    52  
    53     try 
    54     { 
    55       $this->deletesfUserEmailAddress($this->sf_user_email_address); 
    56     } 
    57     catch (Doctrine_Exception $e) 
    58     { 
    59       $this->getRequest()->setError('delete', 'Could not delete the selected Sf user email address. Make sure it does not have any associated items.'); 
    60       return $this->forward('sfUserEmailAddress', 'list'); 
    61     } 
    62  
    63      
    64     $this->setTemplate('ajaxList'); 
    65     return sfView::SUCCESS; 
    66   }   
    6716} 
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserEmailAddress/config/generator.yml

    r12393 r15667  
    11generator: 
    2   class:              sfDoctrineAdminGenerator 
     2  class: sfDoctrineGenerator 
    33  param: 
    4     model_class:      sfUserEmailAddress 
    5     theme:            default 
     4    model_class:           sfUserEmailAddress 
     5    theme:                 admin 
     6    non_verbose_templates: true 
     7    with_show:             false 
     8    singular:              ~ 
     9    plural:                ~ 
     10    route_prefix:          sf_user_email_address 
     11    with_doctrine_route:     1 
    612 
    7     fields: 
    8       updated_at: { type: plain, params: date_format='MM/dd/yy hh:mm a' } 
    9       UpdatedBy: { type: plain } 
    10       created_at: { type: plain, params: date_format='MM/dd/yy hh:mm a' } 
    11       CreatedBy: { type: plain } 
    12        
    13     list: 
    14       title: Email Addresses for Users 
    15       display: [ User, rank, address ] 
    16       object_actions: 
    17         _edit:    - 
    18         _delete:  - 
    19       actions: 
    20         _create:  { name: Add Email Address } 
    21       sort_by:    [ sfUserUser, asc ] 
    22        
    23     edit: 
    24       title: Editing Email Address For "%%User%%" 
    25       display: 
    26         "Details":  [ _User, rank, address ] 
    27         "NONE":     [ updated_at, UpdatedBy, created_at, CreatedBy ] 
    28       actions: 
    29           _save: - 
    30           _save_and_add: - 
    31           _save_and_list: - 
    32           _list: - 
    33           _delete: - 
     13    config: 
     14      actions: ~ 
     15      fields:  ~ 
     16      list:    ~ 
     17      filter:  ~ 
     18      form:    ~ 
     19      edit:    ~ 
     20      new:     ~ 
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserImAccount/actions/actions.class.php

    r12393 r15667  
    11<?php 
     2 
     3require_once dirname(__FILE__).'/../lib/sfUserImAccountGeneratorConfiguration.class.php'; 
     4require_once dirname(__FILE__).'/../lib/sfUserImAccountGeneratorHelper.class.php'; 
    25 
    36/** 
    47 * sfUserImAccount actions. 
    58 * 
    6  * @package    sfDoctrineUserPlugin 
     9 * @package    americanhealthplans 
    710 * @subpackage sfUserImAccount 
    811 * @author     Stephen Ostrow <sostrow@sowebdesigns.com> 
    9  * @version    SVN: $Id: actions.class.php 1415 2006-06-11 08:33:51Z fabien $ 
     12 * @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $ 
    1013 */ 
    11 class sfUserImAccountActions extends autosfUserImAccountActions 
     14class sfUserImAccountActions extends autoSfUserImAccountActions 
    1215{ 
    13   public function executeAjaxSave() 
    14   { 
    15     $this->forward('sfUserImAccount', 'ajaxEdit'); 
    16   } 
    17  
    18   public function executeAjaxEdit () 
    19   { 
    20     $this->sf_user_im_account = $this->getsfUserImAccountOrCreate(); 
    21      
    22     if ( !$this->sf_user_im_account['id'] && $this->hasRequestParameter('sf_user_id') ) 
    23       $this->sf_user_im_account->set('user_id', $this->getRequestParameter('sf_user_id')); 
    24  
    25     if ($this->getRequest()->getMethod() == sfRequest::POST) 
    26     { 
    27       $this->updatesfUserImAccountFromRequest(); 
    28  
    29       $this->savesfUserImAccount($this->sf_user_im_account); 
    30  
    31 //      $this->setFlash('notice', 'Your modifications have been saved'); 
    32  
    33       $this->sf_user_user = $this->sf_user_im_account['User']; 
    34       $this->setTemplate('ajaxList'); 
    35       return sfView::SUCCESS; 
    36     } 
    37     else 
    38     { 
    39       $this->addJavascriptsForEdit(); 
    40  
    41       $this->labels = $this->getLabels(); 
    42     } 
    43      
    44     // temporary fix to avoid using a distinct editSuccess.php template 
    45     sfLoader::loadHelpers(array('Helper', 'ObjectDoctrineAdmin')); 
    46   } 
    47  
    48   public function executeAjaxDelete () 
    49   { 
    50     $this->sf_user_im_account = Doctrine::getTable('sfUserImAccount')->find($this->getRequestParameter('id')); 
    51     $this->sf_user_user = $this->sf_user_im_account['User']; 
    52      
    53     $this->forward404Unless($this->sf_user_im_account); 
    54  
    55     try 
    56     { 
    57       $this->deletesfUserImAccount($this->sf_user_im_account); 
    58     } 
    59     catch (Doctrine_Exception $e) 
    60     { 
    61       $this->getRequest()->setError('delete', 'Could not delete the selected Sf user im account. Make sure it does not have any associated items.'); 
    62       return $this->forward('sfUserImAccount', 'list'); 
    63     } 
    64      
    65     $this->setTemplate('ajaxList'); 
    66     return sfView::SUCCESS; 
    67   } 
    6816} 
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserImAccount/config/generator.yml

    r12393 r15667  
    11generator: 
    2   class:              sfDoctrineAdminGenerator 
     2  class: sfDoctrineGenerator 
    33  param: 
    4     model_class:      sfUserImAccount 
    5     theme:            default 
    6        
    7     fields: 
    8       updated_at: { type: plain, params: date_format='MM/dd/yy hh:mm a' } 
    9       UpdatedBy: { type: plain } 
    10       created_at: { type: plain, params: date_format='MM/dd/yy hh:mm a' } 
    11       CreatedBy: { type: plain } 
    12        
    13     list: 
    14       title: Instant Messaging Accounts for Users 
    15       display: [ User, rank, ImAccountType, nickname ] 
    16       object_actions: 
    17         _edit:    - 
    18         _delete:  - 
    19       actions: 
    20         _create:  { name: Add Instant Messaging Account } 
    21       sort_by:    [ sfUserUser, asc ] 
     4    model_class:           sfUserImAccount 
     5    theme:                 admin 
     6    non_verbose_templates: true 
     7    with_show:             false 
     8    singular:              ~ 
     9    plural:                ~ 
     10    route_prefix:          sf_user_im_account 
     11    with_doctrine_route:     1 
    2212 
    23     edit: 
    24       title: Editing Instant Messaging Account for User "%%User%%" 
    25       display: 
    26         "Details": [_User,  ImAccountType, rank, nickname ] 
    27         "NONE": [ updated_at, UpdatedBy, created_at, CreatedBy ] 
    28       fields: 
    29       actions: 
    30           _save: - 
    31           _save_and_add: - 
    32           _save_and_list: - 
    33           _list: - 
    34           _delete: - 
     13    config: 
     14      actions: ~ 
     15      fields:  ~ 
     16      list:    ~ 
     17      filter:  ~ 
     18      form:    ~ 
     19      edit:    ~ 
     20      new:     ~ 
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserImAccountType/actions/actions.class.php

    r12393 r15667  
    11<?php 
     2 
     3require_once dirname(__FILE__).'/../lib/sfUserImAccountTypeGeneratorConfiguration.class.php'; 
     4require_once dirname(__FILE__).'/../lib/sfUserImAccountTypeGeneratorHelper.class.php'; 
    25 
    36/** 
    47 * sfUserImAccountType actions. 
    58 * 
    6  * @package    sfDoctrineUserPlugin 
     9 * @package    americanhealthplans 
    710 * @subpackage sfUserImAccountType 
    811 * @author     Stephen Ostrow <sostrow@sowebdesigns.com> 
    9  * @version    SVN: $Id: actions.class.php 1415 2006-06-11 08:33:51Z fabien $ 
     12 * @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $ 
    1013 */ 
    11 class sfUserImAccountTypeActions extends autosfUserImAccountTypeActions 
     14class sfUserImAccountTypeActions extends autoSfUserImAccountTypeActions 
    1215{ 
    1316} 
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserImAccountType/config/generator.yml

    r12393 r15667  
    11generator: 
    2   class:              sfDoctrineAdminGenerator 
     2  class: sfDoctrineGenerator 
    33  param: 
    4     model_class:      sfUserImAccountType 
    5     theme:            default 
     4    model_class:           sfUserImAccountType 
     5    theme:                 admin 
     6    non_verbose_templates: true 
     7    with_show:             false 
     8    singular:              ~ 
     9    plural:                ~ 
     10    route_prefix:          sf_user_im_account_type 
     11    with_doctrine_route:     1 
     12 
     13    config: 
     14      actions: ~ 
     15      fields:  ~ 
     16      list:    ~ 
     17      filter:  ~ 
     18      form:    ~ 
     19      edit:    ~ 
     20      new:     ~ 
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserPhone/actions/actions.class.php

    r12393 r15667  
    11<?php 
     2 
     3require_once dirname(__FILE__).'/../lib/sfUserPhoneGeneratorConfiguration.class.php'; 
     4require_once dirname(__FILE__).'/../lib/sfUserPhoneGeneratorHelper.class.php'; 
    25 
    36/** 
    47 * sfUserPhone actions. 
    58 * 
    6  * @package    sfDoctrineUserPlugin 
     9 * @package    americanhealthplans 
    710 * @subpackage sfUserPhone 
    811 * @author     Stephen Ostrow <sostrow@sowebdesigns.com> 
    9  * @version    SVN: $Id: actions.class.php 1415 2006-06-11 08:33:51Z fabien $ 
     12 * @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $ 
    1013 */ 
    11 class sfUserPhoneActions extends autosfUserPhoneActions 
     14class sfUserPhoneActions extends autoSfUserPhoneActions 
    1215{ 
    13    
    14   public function executeAjaxSave () 
    15   { 
    16     return $this->forward('sfUserPhone', 'ajaxEdit'); 
    17   } 
    18  
    19   public function executeAjaxEdit () 
    20   { 
    21     $this->sf_user_phone = $this->getsfUserPhoneOrCreate(); 
    22      
    23     if ( !$this->sf_user_phone['id'] && $this->hasRequestParameter('sf_user_id') ) 
    24       $this->sf_user_phone->set('user_id', $this->getRequestParameter('sf_user_id')); 
    25  
    26     if ($this->getRequest()->getMethod() == sfRequest::POST) 
    27     { 
    28       $this->updatesfUserPhoneFromRequest(); 
    29  
    30       $this->savesfUserPhone($this->sf_user_phone); 
    31  
    32       $this->setFlash('notice', 'Your modifications have been saved'); 
    33  
    34       $this->sf_user_user = $this->sf_user_phone['User']; 
    35       $this->setTemplate('ajaxList'); 
    36       return sfView::SUCCESS; 
    37     } 
    38     else 
    39     { 
    40       $this->addJavascriptsForEdit(); 
    41  
    42       $this->labels = $this->getLabels(); 
    43     } 
    44      
    45     // temporary fix to avoid using a distinct editSuccess.php template 
    46     sfLoader::loadHelpers(array('Helper', 'ObjectDoctrineAdmin')); 
    47   } 
    48  
    49   public function executeAjaxDelete () 
    50   { 
    51     $this->sf_user_phone = Doctrine::getTable('sfUserPhone')->find($this->getRequestParameter('id')); 
    52     $this->sf_user_user = $this->sf_user_phone['User']; 
    53      
    54     $this->forward404Unless($this->sf_user_phone); 
    55  
    56     try 
    57     { 
    58       $this->deletesfUserPhone($this->sf_user_phone); 
    59     } 
    60     catch (Doctrine_Exception $e) 
    61     { 
    62       $this->getRequest()->setError('delete', 'Could not delete the selected Sf user phone. Make sure it does not have any associated items.'); 
    63       return $this->forward('sfUserPhone', 'list'); 
    64     } 
    65  
    66     $this->setTemplate('ajaxList'); 
    67     return sfView::SUCCESS; 
    68   } 
    69    
    70    
    7116} 
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserPhone/config/generator.yml

    r12393 r15667  
    11generator: 
    2   class:              sfDoctrineAdminGenerator 
     2  class: sfDoctrineGenerator 
    33  param: 
    4     model_class:      sfUserPhone 
    5     theme:            default 
    6        
    7     fields: 
    8       updated_at: { type: plain, params: date_format='MM/dd/yy hh:mm a' } 
    9       UpdatedBy: { type: plain } 
    10       created_at: { type: plain, params: date_format='MM/dd/yy hh:mm a' } 
    11       CreatedBy: { type: plain } 
    12        
    13     list: 
    14       title: Phones for Users 
    15       display: [ User, rank, PhoneType, number, extension ] 
    16       object_actions: 
    17         _edit:    - 
    18         _delete:  - 
    19       actions: 
    20         _create:  { name: Add Phone } 
    21       sort_by:    [ sfUserUser, asc ] 
     4    model_class:           sfUserPhone 
     5    theme:                 admin 
     6    non_verbose_templates: true 
     7    with_show:             false 
     8    singular:              ~ 
     9    plural:                ~ 
     10    route_prefix:          sf_user_phone 
     11    with_doctrine_route:     1 
    2212 
    23     edit: 
    24       title: Editing Phone for User "%%User%%" 
    25       display: 
    26         "Details": [_User,  PhoneType, rank, number, extension ] 
    27         "NONE": [ updated_at, UpdatedBy, created_at, CreatedBy ] 
    28       fields: 
    29       actions: 
    30           _save: - 
    31           _save_and_add: - 
    32           _save_and_list: - 
    33           _list: - 
    34           _delete: - 
     13    config: 
     14      actions: ~ 
     15      fields:  ~ 
     16      list:    ~ 
     17      filter:  ~ 
     18      form:    ~ 
     19      edit:    ~ 
     20      new:     ~ 
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserPhoneType/actions/actions.class.php

    r12393 r15667  
    11<?php 
     2 
     3require_once dirname(__FILE__).'/../lib/sfUserPhoneTypeGeneratorConfiguration.class.php'; 
     4require_once dirname(__FILE__).'/../lib/sfUserPhoneTypeGeneratorHelper.class.php'; 
    25 
    36/** 
    47 * sfUserPhoneType actions. 
    58 * 
    6  * @package    sfDoctrineUserPlugin 
     9 * @package    americanhealthplans 
    710 * @subpackage sfUserPhoneType 
    811 * @author     Stephen Ostrow <sostrow@sowebdesigns.com> 
    9  * @version    SVN: $Id: actions.class.php 1415 2006-06-11 08:33:51Z fabien $ 
     12 * @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $ 
    1013 */ 
    11 class sfUserPhoneTypeActions extends autosfUserPhoneTypeActions 
     14class sfUserPhoneTypeActions extends autoSfUserPhoneTypeActions 
    1215{ 
    1316} 
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserPhoneType/config/generator.yml

    r12393 r15667  
    11generator: 
    2   class:              sfDoctrineAdminGenerator 
     2  class: sfDoctrineGenerator 
    33  param: 
    4     model_class:      sfUserPhoneType 
    5     theme:            default 
     4    model_class:           sfUserPhoneType 
     5    theme:                 admin 
     6    non_verbose_templates: true 
     7    with_show:             false 
     8    singular:              ~ 
     9    plural:                ~ 
     10    route_prefix:          sf_user_phone_type 
     11    with_doctrine_route:     1 
     12 
     13    config: 
     14      actions: ~ 
     15      fields:  ~ 
     16      list:    ~ 
     17      filter:  ~ 
     18      form:    ~ 
     19      edit:    ~ 
     20      new:     ~ 
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserState/actions/actions.class.php

    r12393 r15667  
    11<?php 
     2 
     3require_once dirname(__FILE__).'/../lib/sfUserStateGeneratorConfiguration.class.php'; 
     4require_once dirname(__FILE__).'/../lib/sfUserStateGeneratorHelper.class.php'; 
    25 
    36/** 
    47 * sfUserState actions. 
    58 * 
    6  * @package    sfDoctrineUserPlugin 
     9 * @package    americanhealthplans 
    710 * @subpackage sfUserState 
    811 * @author     Stephen Ostrow <sostrow@sowebdesigns.com> 
    9  * @version    SVN: $Id: actions.class.php 1415 2006-06-11 08:33:51Z fabien $ 
     12 * @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $ 
    1013 */ 
    11 class sfUserStateActions extends autosfUserStateActions 
     14class sfUserStateActions extends autoSfUserStateActions 
    1215{ 
    1316} 
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserState/config/generator.yml

    r12393 r15667  
    11generator: 
    2   class:              sfDoctrineAdminGenerator 
     2  class: sfDoctrineGenerator 
    33  param: 
    4     model_class:      sfUserState 
    5     theme:            default 
     4    model_class:           sfUserState 
     5    theme:                 admin 
     6    non_verbose_templates: true 
     7    with_show:             false 
     8    singular:              ~ 
     9    plural:                ~ 
     10    route_prefix:          sf_user_state 
     11    with_doctrine_route:     1 
     12 
     13    config: 
     14      actions: ~ 
     15      fields:  ~ 
     16      list:    ~ 
     17      filter:  ~ 
     18      form:    ~ 
     19      edit:    ~ 
     20      new:     ~ 
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserUser/actions/actions.class.php

    r12393 r15667  
    11<?php 
     2 
     3require_once dirname(__FILE__).'/../lib/sfUserUserGeneratorConfiguration.class.php'; 
     4require_once dirname(__FILE__).'/../lib/sfUserUserGeneratorHelper.class.php'; 
    25 
    36/** 
    47 * sfUserUser actions. 
    58 * 
    6  * @package    sfDoctrineUserPlugin 
     9 * @package    americanhealthplans 
    710 * @subpackage sfUserUser 
    811 * @author     Stephen Ostrow <sostrow@sowebdesigns.com> 
    9  * @version    SVN: $Id: actions.class.php 1415 2006-06-11 08:33:51Z fabien $ 
     12 * @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $ 
    1013 */ 
    11 class sfUserUserActions extends autosfUserUserActions 
     14class sfUserUserActions extends autoSfUserUserActions 
    1215{ 
    13   public function executeSearch() 
    14   { 
    15  
    16     $search_string = trim( $this->getRequestParameter('search_string') ); 
    17      
    18     # Check for spaces for first and last names 
    19     $words = explode(" ", str_replace(',', '', $search_string)); 
    20     if ( count($words) == 1 ) 
    21     { 
    22       $query = 'first_name LIKE ? OR last_name LIKE ?'; 
    23       $params = array('%'.$words[0].'%', '%'.$words[0].'%'); 
    24     } 
    25     else 
    26     { 
    27       if ( !stristr( $search_string, ',' ) ) 
    28       { 
    29         $query = 'first_name LIKE ? AND last_name LIKE ?'; 
    30         $params = array('%'.$words[0].'%', '%'.$words[1].'%'); 
    31       } 
    32       else 
    33       { 
    34         $query = 'first_name LIKE ? AND last_name LIKE ?'; 
    35         $params = array('%'.$words[1].'%', '%'.$words[0].'%'); 
    36       } 
    37     } 
    38      
    39     $users = Doctrine_Query::create() 
    40         ->from('sfUserUser') 
    41         ->addWhere( $query, $params ) 
    42         ->execute(); 
    43          
    44     $return ="<ul>"; 
    45     $return .= "<li><b>" . count($users). " result(s) for \"$search_string\"</b></li>"; 
    46     foreach ( $users as $user ) 
    47     { 
    48       $return .= "<li><div style='display: none;'>{$user['id']}</div><div>{$user['last_name']}, {$user['first_name']}</div></li>"; 
    49     } 
    50     $return .="</li>"; 
    51      
    52     return $this->renderText($return); 
    53   } 
    54    
    55   public function executeGuardSearch() 
    56   { 
    57  
    58     $search_string = trim( $this->getRequestParameter('search_string') ); 
    59      
    60     $guard_users = Doctrine_Query::create() 
    61         ->from('sfGuardUser') 
    62         ->where( 'username LIKE ?', '%'.$search_string.'%' ) 
    63         ->execute(); 
    64          
    65     $return ="<ul>"; 
    66     $return .= "<li><b>" . count($guard_users). " result(s) for \"$search_string\"</b></li>"; 
    67     foreach ( $guard_users as $guard_user ) 
    68     { 
    69       $return .= "<li><div style='display: none;'>{$guard_user['id']}</div><div>{$guard_user['username']}</div></li>"; 
    70     } 
    71     $return .="</li>"; 
    72      
    73     return $this->renderText($return); 
    74   } 
    75    
    7616} 
  • plugins/sfDoctrineUserPlugin/branches/1.2/modules/sfUserUser/config/generator.yml

    r12393 r15667  
    11generator: 
    2   class:              sfDoctrineAdminGenerator 
     2  class: sfDoctrineGenerator 
    33  param: 
    4     model_class:      sfUserUser 
    5     theme:            default 
     4    model_class:           sfUserUser 
     5    theme:                 admin 
     6    non_verbose_templates: true 
     7    with_show:             false 
     8    singular:              ~ 
     9    plural:                ~ 
     10    route_prefix:          sf_user_user 
     11    with_doctrine_route:     1 
    612 
    7     fields: 
    8       updated_at: { type: plain, params: date_format='MM/dd/yy hh:mm a' } 
    9       UpdatedBy: { type: plain } 
    10       created_at: { type: plain, params: date_format='MM/dd/yy hh:mm a' } 
    11       CreatedBy: { type: plain } 
    12  
    13     list: 
    14       title: Users 
    15       display: [ first_name, middle_name, last_name, company, date_of_birth, created_at, updated_at ] 
    16       object_actions: 
    17           _edit: - 
    18           _delete: - 
    19       actions: 
    20           _create: { name: Add User } 
    21       sort: [ last_name, asc ] 
    22       filters: [ last_name, first_name, date_of_birth, updated_at, created_at ] 
    23       fields: 
    24         sfGuardUser: { type: plain } 
    25  
    26     edit: 
    27       title: Editing User "%%last_name%%, %%first_name%%" 
    28       display: 
    29         "Details": [_sfGuardUser,  prefix, first_name, middle_name, last_name, suffix, company, date_of_birth  ] 
    30         "NONE": [ updated_at, UpdatedBy, created_at, CreatedBy ] 
    31       fields: 
    32       actions: 
    33           _save: - 
    34           _save_and_add: - 
    35           _save_and_list: - 
    36           _list: - 
    37           _delete: - 
     13    config: 
     14      actions: ~ 
     15      fields:  ~ 
     16      list:    ~ 
     17      filter:  ~ 
     18      form:    ~ 
     19      edit:    ~ 
     20      new:     ~