Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • None
  • system
    • base
    • caching
    • console
    • db
      • ar
      • schema
    • validators
    • web
      • actions
      • auth
      • helpers
      • widgets
        • captcha
        • pagers
  • zii
    • widgets
      • grid

Classes

  • QuotesController
  • Overview
  • Package
  • Class
  • Tree

Class QuotesController

The Quotes module lets users send people a quote with a list of products. Quotes can be converted to invoices.

Quotes can be created, updated, deleted, and converted into invoices from the contacts view. The code for that is in the file components/InlineQuotes.php and is heavily based on ajax calls to this controller.

The function actionConvertToInvoice handles both ajax and non-ajax calls. If called via ajax, it will return the list of quotes for the contact id passed in the ajax call.

CComponent
Extended by CBaseController
Extended by CController
Extended by X2Controller
Extended by x2base
Extended by QuotesController
Package: application\modules\quotes\controllers
Author: David Visbal, Demitri Morgan <demitri@x2engine.com>
Located at x2engine/protected/modules/quotes/controllers/QuotesController.php
Methods summary
public array
# behaviors( )

Returns a list of behaviors that this controller should behave as. The return value should be an array of behavior configurations indexed by behavior names. Each behavior configuration can be either a string specifying the behavior class or an array of the following structure:

'behaviorName'=>array(
    'class'=>'path.to.BehaviorClass',
    'property1'=>'value1',
    'property2'=>'value2',
)

Returns a list of behaviors that this controller should behave as. The return value should be an array of behavior configurations indexed by behavior names. Each behavior configuration can be either a string specifying the behavior class or an array of the following structure:

'behaviorName'=>array(
    'class'=>'path.to.BehaviorClass',
    'property1'=>'value1',
    'property2'=>'value2',
)

Note, the behavior classes must implement IBehavior or extend from CBehavior. Behaviors declared in this method will be attached to the controller when it is instantiated.

For more details about behaviors, see CComponent.

Returns

array
the behavior configurations (behavior name=>behavior configuration)

Overrides

x2base::behaviors()
public
# actionView( integer $id )

Displays a particular model.

Displays a particular model.

Parameters

$id
integer
$id the ID of the model to be displayed
public
# actionCreate( boolean $quick = false, mixed $duplicate = false )

Creates a new model.

Creates a new model.

If creation is successful, the browser will be redirected to the 'view' page.

Parameters

$quick
boolean
$quick If true, this indicates the action is being requested via AJAX
$duplicate
public
# actionUpdate( integer $id, mixed $quick = 0 )

Updates a particular model. If update is successful, the browser will be redirected to the 'view' page.

Updates a particular model. If update is successful, the browser will be redirected to the 'view' page.

Parameters

$id
integer
$id the ID of the model to be updated
$quick
public
# actionPrint( mixed $id, mixed $inline = false )

Print a quote using a template or the legacy print view.

Print a quote using a template or the legacy print view.

public type
# getPrintQuote( integer $id = null, boolean $email = false )

Generate presentation markup for the quote.

Generate presentation markup for the quote.

Parameters

$id
integer
$id ID of the quote for which to create a presentation
$email
boolean
$email Parameter passed to the item table markup generator

Returns

type
public
# actionIndex( )

Lists all models.

Lists all models.

public
# actionIndexInvoice( )

Lists all models.

Lists all models.

This is a separate list for invoices. An invoice is a quote with field type='invoice'. The only difference is that when listing, printing, or emailing an invoice, we call it an invoice instead of a quote.

public
# delete( mixed $id )
public
# actionDelete( mixed $id )
public
# actionConvertToInvoice( mixed $id )

Convert the Quote into an Invoice
An invoice is a quote with field type='invoice'. The only difference is that
when listing, printing, or emailing an invoice, we call it an invoice instead
of a quote.

Convert the Quote into an Invoice An invoice is a quote with field type='invoice'. The only difference is that when listing, printing, or emailing an invoice, we call it an invoice instead of a quote.

Parameters

$id
mixed
$id id of the quote to convert to invoice
public
# actionViewInline( type $recordId, mixed $recordType )

Obtain the markup for the inline quotes widget.

Obtain the markup for the inline quotes widget.

Parameters

$recordId
type
$contactId Contact ID to use for displaying quotes
$recordType
public
# updateQuote( mixed $model, mixed $oldAttributes, mixed $products )
public
# actionQuickDelete( mixed $id )
public
# actionAddProduct( mixed $id )
public
# actionDeleteProduct( mixed $id )
public
# actionGetTerms( )
public
# actionGetItems( mixed $term )
public
# insertMenu( array $selectOptions = array(), X2Model $model = null, array $menuParams = null )

Create a menu for Quotes

Create a menu for Quotes

Parameters

$selectOptions
array
Menu options to remove
$model
X2Model
Model object passed to the view
$menuParams
array
Additional menu parameters
Methods inherited from x2base
actionDeleteNote(), actionGetX2ModelInput(), actionQuickView(), actionSearch(), actions(), admin(), ajaxResponse(), appLockout(), beforeAction(), checkPermissions(), cleanUpTags(), convertUrls(), create(), decodeQuotes(), denied(), encodeQuotes(), filterSetPortlets(), filters(), getCurrentWorkflow(), getDetailView(), getHistory(), getModelFromTypeAndId(), getModelsFromTypeAndId(), getModuleObj(), getPageTitle(), getPhpMailer(), index(), mailingListToString(), parseEmailTo(), performAjaxValidation(), prepareMenu(), render(), renderLayout(), renderPartialAjax(), sendUserEmail(), setPageTitle(), throwException(), update(), view(), widget()
Methods inherited from X2Controller
badRequest(), badRequestException(), getBehaviorActions(), isAjaxRequest(), redirectToLogin(), resolveViewFile(), runBehaviorBeforeActionHandlers(), setFileFields(), validateMobileRequest()
Methods inherited from CController
__construct(), accessRules(), afterAction(), afterRender(), beforeRender(), clearPageStates(), createAbsoluteUrl(), createAction(), createActionFromMap(), createUrl(), filterAccessControl(), filterAjaxOnly(), filterPostOnly(), forward(), getAction(), getActionParams(), getCachingStack(), getClips(), getId(), getLayoutFile(), getModule(), getPageState(), getRoute(), getUniqueId(), getViewFile(), getViewPath(), init(), invalidActionParams(), isCachingStackEmpty(), loadPageStates(), missingAction(), processDynamicOutput(), processOutput(), recordCachingAction(), redirect(), refresh(), renderClip(), renderDynamic(), renderDynamicInternal(), renderPartial(), renderText(), replaceDynamicOutput(), run(), runAction(), runActionWithFilters(), savePageStates(), setAction(), setPageState()
Methods inherited from CBaseController
beginCache(), beginClip(), beginContent(), beginWidget(), createWidget(), endCache(), endClip(), endContent(), endWidget(), renderFile(), renderInternal()
Methods inherited from CComponent
__call(), __get(), __isset(), __set(), __unset(), asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Constants inherited from CController
STATE_INPUT_NAME
Properties summary
public string $modelClass 'Quote'
#
Properties inherited from x2base
$actionMenu, $breadcrumbs, $layout, $leftPortlets, $leftWidgets, $menu, $noBackdrop, $portlets
Properties inherited from CController
$defaultAction
Magic properties summary
public Quote $model
#

Model class being dealt with.

Model class being dealt with.

Magic properties inherited from CController
$action, $actionParams, $cachingStack, $clips, $id, $module, $pageTitle, $route, $uniqueId, $viewPath
X2CRM Documentation API documentation generated by ApiGen 2.8.0