FacturaScripts

EditAgente extends ComercialContactController

Controller to edit a single item from the Agente model

Table of Contents

$hasData Indicates if the main view has data or is empty. bool
$tabsPosition Tabs position in page: left, bottom. string
$active Indicates the active view. string
$codeModel Model to use with select and autocomplete filters. CodeModel
$current Indicates current view, when drawing. string
$exportManager Object to export data. ExportManager
$views List of views displayed by the controller. \FacturaScripts\Core\Lib\ExtendedController\BaseView[]|\FacturaScripts\Core\Lib\ExtendedController\ListView[]
$className Name of the class of the controller (although its in inheritance from this class, the name of the final class we will have here) string
$dataBase It provides direct access to the database. DataBase
$empresa Selected company. Empresa
$multiRequestProtection MultiRequestProtection
$permissions User permissions on this controller. ControllerPermissions
$request Request on which we can get data. Request
$response HTTP Response object. Response
$template Name of the file for the template. string|bool
$title Title of the page. string
$uri Given uri, default is empty. string
$user User logged in. User|bool
calcAgentInvoicePending() Returns the sum of the agent's total outstanding invoices. string
getModelClassName() Returns the class name of the model to use. string
getPageData() Returns basic page attributes. array
createCommissionsView() mixed
createContactView() mixed
createDocumentView() mixed
createInvoiceView() mixed
createSettlementView() mixed
createViews() Load Views mixed
editAction() bool
loadData() Load view data procedure mixed
setCustomWidgetValues() Set custom configuration when load main data mixed
setCustomWidgetValues() Set custom configuration when load main data mixed
checkSubaccountLength() Check that the subaccount length is correct. mixed
createContactsView() Add a Contact List View. mixed
createCustomerListView() Add a Customer document List View. mixed
createEmailsView() Add a Email Sent List View. mixed
createLineView() Add Product Lines from documents. mixed
createListView() Add a document List View mixed
createReceiptView() Add a receipt list view. mixed
createSubaccountsView() Add Subaccount List View. mixed
createSupplierListView() Add a Supplier document List View mixed
execPreviousAction() Run the actions that alter data before reading it. bool
getCustomerFields() Customer special fields array
getSupplierFields() Supplier special fields array
loadData() Loads the data to display. mixed
updateContact() mixed
addButton() Adds a new button to the tab. mixed
redirect() Redirect to an url or controller. mixed
addButtonApproveDocument() Adds buttons to approve documents. mixed
addButtonGroupDocument() Adds button to group documents. mixed
addButtonLockInvoice() Adds button to lock invoices. mixed
addButtonPayReceipt() Adds button to pay receipts. mixed
approveDocumentAction() Approves selected documents. bool
groupDocumentAction() Group selected documents. bool
lockInvoiceAction() Locks selected invoices. bool
payReceiptAction() Sets selected receipts as paid. bool
addHtmlView() Adds a HTML type view to the controller. mixed
addFileAction() bool
createViewDocFiles() mixed
deleteFileAction() bool
editFileAction() bool
loadDataDocFiles() mixed
unlinkFileAction() bool
validateFileActionToken() bool
getModelClassName() Returns the class name of the model to use in the editView. mixed
getModel() Pointer to the data model. mixed
getPageData() Return the basic data for this page. array
createViews() Inserts the views or tabs to display. mixed
__construct() Initialize all objects and properties. mixed
getImageUrl() string
privateCore() Runs the controller's private logic. mixed
setTabsPosition() Sets the tabs position, by default is setted to 'left', also supported 'bottom' and 'top'. mixed
addEditListView() Adds a EditList type view to the controller. mixed
addEditView() Adds a Edit type view to the controller. mixed
addGridView() Adds a Grid type view to the controller. mixed
addListView() Adds a List type view to the controller. mixed
editAction() Runs the data edit action. bool
execAfterAction() Run the controller after actions. mixed
insertAction() Runs data insert action. bool
searchGridView() Returns the key of the first GridView. string
addCustomView() mixed
getCurrentView() BaseView|ListView
getMainViewName() Returns the name assigned to the main view string
getSettings() Returns the configuration value for the indicated view. mixed
getViewModelValue() Return the value for a field in the model of the view. mixed
setCurrentView() mixed
setSettings() Set value for setting of a view mixed
autocompleteAction() Run the autocomplete action. array
checkOwnerData() Check if the active user has permission to view the information of the active record in the informed model. bool
deleteAction() Action to delete data. bool
exportAction() mixed
getAutocompleteValues() Return values from Widget Values for autocomplete action array
getOwnerFilter() Returns the where filter to apply to obtain the data created by the active user. \FacturaScripts\Core\Base\DataBase\DataBaseWhere[]
requestGet() Return array with parameters values array
validateFormToken() bool
addExtension() mixed
getTemplate() Return the template to use for this controller. string|bool
pipe() mixed
publicCore() Execute the public part of the controller. mixed
setTemplate() Set the template to use for this controller. bool
toolBox() ToolBox
url() Return the URL of the actual controller. string
checkPHPversion() mixed
getClassName() Return the name of the controller. string

Properties

$hasData

Indicates if the main view has data or is empty.

public bool $hasData = false

$tabsPosition

Tabs position in page: left, bottom.

public string $tabsPosition

$current

Indicates current view, when drawing.

private string $current

$views

List of views displayed by the controller.

public \FacturaScripts\Core\Lib\ExtendedController\BaseView[]|\FacturaScripts\Core\Lib\ExtendedController\ListView[] $views = []

$className

Name of the class of the controller (although its in inheritance from this class, the name of the final class we will have here)

private string $className

$request

Request on which we can get data.

public Request $request

$response

HTTP Response object.

protected Response $response

$template

Name of the file for the template.

private string|bool $template

$uri

Given uri, default is empty.

public string $uri

Methods

calcAgentInvoicePending()

Returns the sum of the agent's total outstanding invoices.

public calcAgentInvoicePending( ) : string
Return values
string

getModelClassName()

Returns the class name of the model to use.

public getModelClassName( ) : string
Return values
string

getPageData()

Returns basic page attributes.

public getPageData( ) : array
Return values
array

createCommissionsView()

protected createCommissionsView( [ $viewName : string = 'ListComision' ] ) : mixed
Parameters
$viewName : string = 'ListComision'
Return values
mixed

createContactView()

protected createContactView( [ $viewName : string = 'EditContacto' ] ) : mixed
Parameters
$viewName : string = 'EditContacto'
Return values
mixed

createDocumentView()

protected createDocumentView( $viewName : string , $model : string , $label : string ) : mixed
Parameters
$viewName : string
$model : string
$label : string
Return values
mixed

createInvoiceView()

protected createInvoiceView( $viewName : string ) : mixed
Parameters
$viewName : string
Return values
mixed

createSettlementView()

protected createSettlementView( [ $viewName : string = 'ListLiquidacionComision' ] ) : mixed
Parameters
$viewName : string = 'ListLiquidacionComision'
Return values
mixed

createViews()

Load Views

protected createViews( ) : mixed
Return values
mixed

editAction()

protected editAction( ) : bool
Return values
bool

loadData()

Load view data procedure

protected loadData( $viewName : string , $view : BaseView ) : mixed
Parameters
$viewName : string
$view : BaseView
Return values
mixed

setCustomWidgetValues()

Set custom configuration when load main data

protected setCustomWidgetValues( $viewName : string ) : mixed
Parameters
$viewName : string
Return values
mixed

setCustomWidgetValues()

Set custom configuration when load main data

protected abstract setCustomWidgetValues( $viewName : string ) : mixed
Parameters
$viewName : string
Return values
mixed

checkSubaccountLength()

Check that the subaccount length is correct.

protected checkSubaccountLength( $code : string ) : mixed
Parameters
$code : string
Return values
mixed

createContactsView()

Add a Contact List View.

protected createContactsView( [ $viewName : string = 'EditDireccionContacto' ] ) : mixed
Parameters
$viewName : string = 'EditDireccionContacto'
Return values
mixed

createCustomerListView()

Add a Customer document List View.

protected createCustomerListView( $viewName : string , $model : string , $label : string ) : mixed
Parameters
$viewName : string
$model : string
$label : string
Return values
mixed

createEmailsView()

Add a Email Sent List View.

protected createEmailsView( [ $viewName : string = 'ListEmailSent' ] ) : mixed
Parameters
$viewName : string = 'ListEmailSent'
Return values
mixed

createLineView()

Add Product Lines from documents.

protected createLineView( $viewName : string , $model : string [, $label : string = 'products' ] ) : mixed
Parameters
$viewName : string
$model : string
$label : string = 'products'
Return values
mixed

createListView()

Add a document List View

private createListView( $viewName : string , $model : string , $label : string , $fields : array ) : mixed
Parameters
$viewName : string
$model : string
$label : string
$fields : array
Return values
mixed

createReceiptView()

Add a receipt list view.

protected createReceiptView( $viewName : string , $model : string ) : mixed
Parameters
$viewName : string
$model : string
Return values
mixed

createSubaccountsView()

Add Subaccount List View.

protected createSubaccountsView( [ $viewName : string = 'ListSubcuenta' ] ) : mixed
Parameters
$viewName : string = 'ListSubcuenta'
Return values
mixed

createSupplierListView()

Add a Supplier document List View

protected createSupplierListView( $viewName : string , $model : string , $label : string ) : mixed
Parameters
$viewName : string
$model : string
$label : string
Return values
mixed

execPreviousAction()

Run the actions that alter data before reading it.

protected execPreviousAction( $action : string ) : bool
Parameters
$action : string
Return values
bool

loadData()

Loads the data to display.

protected abstract loadData( $viewName : string , $view : BaseView ) : mixed
Parameters
$viewName : string
$view : BaseView
Return values
mixed

addButton()

Adds a new button to the tab.

public addButton( $viewName : string , $btnArray : array ) : mixed
Parameters
$viewName : string
$btnArray : array
Return values
mixed

redirect()

Redirect to an url or controller.

public redirect( $url : string , $delay : int ) : mixed
Parameters
$url : string
$delay : int
Return values
mixed

addButtonApproveDocument()

Adds buttons to approve documents.

protected addButtonApproveDocument( $viewName : string ) : mixed
Parameters
$viewName : string
Return values
mixed

addButtonGroupDocument()

Adds button to group documents.

protected addButtonGroupDocument( $viewName : string ) : mixed
Parameters
$viewName : string
Return values
mixed

addButtonLockInvoice()

Adds button to lock invoices.

protected addButtonLockInvoice( $viewName : string ) : mixed
Parameters
$viewName : string
Return values
mixed

addButtonPayReceipt()

Adds button to pay receipts.

protected addButtonPayReceipt( $viewName : string ) : mixed
Parameters
$viewName : string
Return values
mixed

payReceiptAction()

Sets selected receipts as paid.

protected payReceiptAction( $codes : mixed , $model : Receipt , $allowUpdate : bool , $dataBase : DataBase , $nick : string ) : bool
Parameters
$codes : mixed
$model : Receipt
$allowUpdate : bool
$dataBase : DataBase
$nick : string
Return values
bool

addHtmlView()

Adds a HTML type view to the controller.

protected addHtmlView( $viewName : string , $fileName : string , $modelName : string , $viewTitle : string [, $viewIcon : string = 'fab fa-html5' ] ) : mixed
Parameters
$viewName : string
$fileName : string
$modelName : string
$viewTitle : string
$viewIcon : string = 'fab fa-html5'
Return values
mixed

addFileAction()

private addFileAction( ) : bool
Return values
bool

createViewDocFiles()

protected createViewDocFiles( [ $viewName : string = 'docfiles' ] [, $template : string = 'Tab/DocFiles' ] ) : mixed
Parameters
$viewName : string = 'docfiles'
$template : string = 'Tab/DocFiles'
Return values
mixed

deleteFileAction()

private deleteFileAction( ) : bool
Return values
bool

editFileAction()

private editFileAction( ) : bool
Return values
bool

loadDataDocFiles()

private loadDataDocFiles( $view : BaseView , $model : string , $modelid : string ) : mixed
Parameters
$view : BaseView
$model : string
$modelid : string
Return values
mixed

unlinkFileAction()

private unlinkFileAction( ) : bool
Return values
bool

validateFileActionToken()

private validateFileActionToken( ) : bool
Return values
bool

getModelClassName()

Returns the class name of the model to use in the editView.

public abstract getModelClassName( ) : mixed
Return values
mixed

getModel()

Pointer to the data model.

public getModel( ) : mixed
Return values
mixed

getPageData()

Return the basic data for this page.

public getPageData( ) : array
Return values
array

createViews()

Inserts the views or tabs to display.

protected abstract createViews( ) : mixed
Return values
mixed

__construct()

Initialize all objects and properties.

public __construct( $className : string [, $uri : string = '' ] ) : mixed
Parameters
$className : string
$uri : string = ''
Return values
mixed

setTabsPosition()

Sets the tabs position, by default is setted to 'left', also supported 'bottom' and 'top'.

public setTabsPosition( $position : string ) : mixed
Parameters
$position : string
Return values
mixed

addEditListView()

Adds a EditList type view to the controller.

protected addEditListView( $viewName : string , $modelName : string , $viewTitle : string [, $viewIcon : string = 'fas fa-bars' ] ) : mixed
Parameters
$viewName : string
$modelName : string
$viewTitle : string
$viewIcon : string = 'fas fa-bars'
Return values
mixed

addEditView()

Adds a Edit type view to the controller.

protected addEditView( $viewName : string , $modelName : string , $viewTitle : string [, $viewIcon : string = 'fas fa-edit' ] ) : mixed
Parameters
$viewName : string
$modelName : string
$viewTitle : string
$viewIcon : string = 'fas fa-edit'
Return values
mixed

addGridView()

Adds a Grid type view to the controller.

protected addGridView( $master : array , $detail : array , $viewTitle : string [, $viewIcon : string = 'fas fa-list-alt' ] ) : mixed

Master/Detail params: ['name' = 'viewName', 'model' => 'modelName']

Parameters
$master : array
$detail : array
$viewTitle : string
$viewIcon : string = 'fas fa-list-alt'
Tags
deprecated

will be removed in the next year

Return values
mixed

addListView()

Adds a List type view to the controller.

protected addListView( $viewName : string , $modelName : string , $viewTitle : string [, $viewIcon : string = 'fas fa-list' ] ) : mixed
Parameters
$viewName : string
$modelName : string
$viewTitle : string
$viewIcon : string = 'fas fa-list'
Return values
mixed

editAction()

Runs the data edit action.

protected editAction( ) : bool
Return values
bool

execAfterAction()

Run the controller after actions.

protected execAfterAction( $action : string ) : mixed
Parameters
$action : string
Return values
mixed

insertAction()

Runs data insert action.

protected insertAction( ) : bool
Return values
bool

searchGridView()

Returns the key of the first GridView.

private searchGridView( ) : string
Return values
string

getMainViewName()

Returns the name assigned to the main view

public getMainViewName( ) : string
Return values
string

getSettings()

Returns the configuration value for the indicated view.

public getSettings( $viewName : string , $property : string ) : mixed
Parameters
$viewName : string
$property : string
Return values
mixed

getViewModelValue()

Return the value for a field in the model of the view.

public getViewModelValue( $viewName : string , $fieldName : string ) : mixed
Parameters
$viewName : string
$fieldName : string
Return values
mixed

setCurrentView()

public setCurrentView( $viewName : string ) : mixed
Parameters
$viewName : string
Return values
mixed

setSettings()

Set value for setting of a view

public setSettings( $viewName : string , $property : string , $value : mixed ) : mixed
Parameters
$viewName : string
$property : string
$value : mixed
Return values
mixed

autocompleteAction()

Run the autocomplete action.

protected autocompleteAction( ) : array

Returns a JSON string for the searched values.

Return values
array

checkOwnerData()

Check if the active user has permission to view the information of the active record in the informed model.

protected checkOwnerData( $model : object ) : bool
Parameters
$model : object
Return values
bool

deleteAction()

Action to delete data.

protected deleteAction( ) : bool
Return values
bool

exportAction()

protected exportAction( ) : mixed
Return values
mixed

getAutocompleteValues()

Return values from Widget Values for autocomplete action

protected getAutocompleteValues( $viewName : string , $fieldName : string ) : array
Parameters
$viewName : string
$fieldName : string
Return values
array

getOwnerFilter()

Returns the where filter to apply to obtain the data created by the active user.

protected getOwnerFilter( $model : object ) : \FacturaScripts\Core\Base\DataBase\DataBaseWhere[]
Parameters
$model : object
Return values
\FacturaScripts\Core\Base\DataBase\DataBaseWhere[]

requestGet()

Return array with parameters values

protected requestGet( $keys : array ) : array
Parameters
$keys : array
Return values
array

validateFormToken()

protected validateFormToken( ) : bool
Return values
bool

addExtension()

public static addExtension( $extension : mixed ) : mixed
Parameters
$extension : mixed
Return values
mixed

getTemplate()

Return the template to use for this controller.

public getTemplate( ) : string|bool
Return values
string|bool

pipe()

public pipe( $name : string , ...$arguments : array ) : mixed
Parameters
$name : string
$arguments : array
Return values
mixed

publicCore()

Execute the public part of the controller.

public publicCore( &$response : Response ) : mixed
Parameters
$response : Response
Return values
mixed

setTemplate()

Set the template to use for this controller.

public setTemplate( $template : string|bool ) : bool
Parameters
$template : string|bool
Return values
bool

url()

Return the URL of the actual controller.

public url( ) : string
Return values
string

checkPHPversion()

private checkPHPversion( $min : float ) : mixed
Parameters
$min : float
Return values
mixed

getClassName()

Return the name of the controller.

protected getClassName( ) : string
Return values
string

Search results