FacturaScripts

EditAgente extends ComercialContactController
in package

Controller to edit a single item from the Agente model

Tags
author

Carlos Garcia Gomez [email protected]

author

Jose Antonio Cuello Principal [email protected]

collaborator

Daniel Fernández Giménez [email protected]

Table of Contents

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

Constants

MODEL_NAMESPACE

public mixed MODEL_NAMESPACE = '\\FacturaScripts\\Dinamic\\Model\\'

Properties

$hasData

Indicates if the main view has data or is empty.

public bool $hasData = false

$request

Request on which we can get data.

public Request $request

$tabsPosition

Tabs position in page: left, bottom.

public string $tabsPosition

$title

Title of the page.

public string $title

título de la página.

$uri

Given uri, default is empty.

public string $uri

$response

HTTP Response object.

protected Response $response

$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

CLASS

$current

Indicates current view, when drawing.

private string $current

$template

Name of the file for the template.

private string|false $template

nombre_archivo.html.twig

Methods

__construct()

Initialize all objects and properties.

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

addButton()

Adds a new button to the tab.

public addButton(string $viewName, array<string|int, mixed> $btnArray) : mixed
Parameters
$viewName : string
$btnArray : array<string|int, mixed>
Return values
mixed

addExtension()

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

calcAgentInvoicePending()

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

public calcAgentInvoicePending() : string
Return values
string

getImageUrl()

public getImageUrl() : string
Return values
string

getMainViewName()

Returns the name assigned to the main view

public getMainViewName() : string
Return values
string

getModel()

Pointer to the data model.

public getModel() : mixed
Return values
mixed

getModelClassName()

public getModelClassName() : string
Return values
string

getPageData()

public getPageData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getSettings()

Returns the configuration value for the indicated view.

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

getTemplate()

Return the template to use for this controller.

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

getViewModelValue()

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

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

pipe()

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

pipeFalse()

public pipeFalse(string $name, array<string|int, mixed> ...$arguments) : bool
Parameters
$name : string
$arguments : array<string|int, mixed>
Return values
bool

publicCore()

Execute the public part of the controller.

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

redirect()

Redirect to an url or controller.

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

setCurrentView()

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

setSettings()

Set value for setting of a view

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

setTabsPosition()

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

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

setTemplate()

Set the template to use for this controller.

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

url()

Return the URL of the actual controller.

public url() : string
Return values
string

addButtonApproveDocument()

Adds buttons to approve documents.

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

addButtonGenerateAccountingInvoices()

Adds button to lock invoices.

protected addButtonGenerateAccountingInvoices(string $viewName[, string|null $code = null ]) : void
Parameters
$viewName : string
$code : string|null = null
Return values
void

addButtonGroupDocument()

Adds button to group documents.

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

addButtonLockInvoice()

Adds button to lock invoices.

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

addButtonPayReceipt()

Adds button to pay receipts.

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

addEditListView()

Adds a EditList type view to the controller.

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

addEditView()

Adds an Edit type view to the controller.

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

addHtmlView()

Adds an HTML type view to the controller.

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

addListView()

Adds a List type view to the controller.

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

autocompleteAction()

Run the autocomplete action.

protected autocompleteAction() : array<string|int, mixed>

Returns a JSON string for the searched values.

Return values
array<string|int, mixed>

checkOwnerData()

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

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

checkSubaccountLength()

Check that the subaccount length is correct.

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

createContactsView()

Add a Contact List View.

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

createContactView()

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

createCustomerListView()

Add a Customer document List View.

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

createCustomerView()

protected createCustomerView([string $viewName = 'ListCliente' ]) : mixed
Parameters
$viewName : string = 'ListCliente'
Return values
mixed

createDocumentView()

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

createEmailsView()

Add a Email Sent List View.

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

createInvoiceView()

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

createLineView()

Add Product Lines from documents.

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

createReceiptView()

Add a receipt list view.

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

createSubaccountsView()

Add Subaccount List View.

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

createSupplierListView()

Add a Supplier document List View

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

createViewDocFiles()

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

createViews()

Load Views

protected createViews() : mixed
Return values
mixed

deleteAction()

Action to delete data.

protected deleteAction() : bool
Return values
bool

editAction()

protected editAction() : bool
Return values
bool

execAfterAction()

Run the controller after actions.

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

execPreviousAction()

Run the actions that alter data before reading it.

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

exportAction()

protected exportAction() : mixed
Return values
mixed

generateAccountingEntriesAction()

protected generateAccountingEntriesAction(mixed $model, mixed $allowUpdate, mixed $dataBase) : bool
Parameters
$model : mixed
$allowUpdate : mixed
$dataBase : mixed
Return values
bool

getAutocompleteValues()

Return values from Widget Values for autocomplete action

protected getAutocompleteValues(string $viewName, string $fieldName) : array<string|int, mixed>
Parameters
$viewName : string
$fieldName : string
Return values
array<string|int, mixed>

getClassName()

Return the name of the controller.

protected getClassName() : string
Return values
string

insertAction()

Runs data insert action.

protected insertAction() : bool
Return values
bool

loadData()

Load view data procedure

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

payReceiptAction()

Sets selected receipts as paid.

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

requestGet()

Return array with parameters values

protected requestGet(array<string|int, mixed> $keys) : array<string|int, mixed>
Parameters
$keys : array<string|int, mixed>
Return values
array<string|int, mixed>

selectAction()

Run the select action.

protected selectAction() : array<string|int, mixed>

Returns a JSON string for the searched values.

Return values
array<string|int, mixed>

setCustomWidgetValues()

Set custom configuration when load main data

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

updateNumDocs()

Actualiza el número de adjuntos del documento.

protected updateNumDocs() : void
Return values
void

validateFormToken()

Check request token. Returns an error if: - the token does not exist - the token is invalid - the token is duplicated

protected validateFormToken() : bool
Return values
bool

addFileAction()

private addFileAction() : bool
Return values
bool

checkPHPversion()

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

createListView()

Add a document List View

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

deleteFileAction()

private deleteFileAction() : bool
Return values
bool

editFileAction()

private editFileAction() : bool
Return values
bool

getCustomerFields()

Customer special fields

private getCustomerFields() : array<string|int, mixed>
Return values
array<string|int, mixed>

getSupplierFields()

Supplier special fields

private getSupplierFields() : array<string|int, mixed>
Return values
array<string|int, mixed>

loadDataDocFiles()

private loadDataDocFiles(BaseView $view, string $model, string $modelid) : 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

Search results