FacturaScripts

EditProducto extends EditProducto
in package
uses ExtensionsTrait

Class created by Core/Internal/PluginsDeploy

Table of Contents

Constants

MODEL_NAMESPACE  = '\FacturaScripts\Dinamic\Model\\'

Properties

$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>
List of views displayed by the controller.
$dataBase  : DataBase
It provides direct access to the database.
$extensionCache  : array<string|int, mixed>
Cache for extension lookups by method name.
$extensions  : array<string|int, mixed>
Stores class extensions.
$response  : Response
HTTP Response object.

Methods

__call()  : mixed
Executes the first matched extension.
__construct()  : mixed
Starts all the objects and properties.
addButton()  : BaseView
Adds a new button to the tab.
addCustomView()  : BaseView
addExtension()  : void
clearExtensions()  : void
Clears all registered extensions.
getCurrentView()  : BaseView
getExtensions()  : array<string|int, mixed>
Returns a list of all registered extension names.
getImageUrl()  : string
getMainViewName()  : string
Returns the name assigned to the main view
getModel()  : mixed
Pointer to the data model.
getModelClassName()  : string
Returns the class name of the model to use in the editView.
getPageData()  : array<string|int, mixed>
Return the basic data for this page.
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.
hasExtension()  : bool
listView()  : ListView
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.
removeExtension()  : bool
Removes all extensions with the specified name.
request()  : Request
run()  : void
setCurrentView()  : void
setSettings()  : BaseView
Set value for setting of a view
setTabsPosition()  : void
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.
tab()  : BaseView
url()  : string
Return the URL of the actual controller.
addEditListView()  : EditListView
Adds a EditList type view to the controller.
addEditView()  : EditView
Adds an Edit type view to the controller.
addHtmlView()  : mixed
addImageAction()  : bool
Add a list of images.
addListView()  : ListView
Adds a List type view to the controller.
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.
createAttachedFile()  : int
Create the record in the AttachedFile model and returns its identifier.
createFileRelation()  : void
Create the record in the AttachedFileRelation model.
createProductImage()  : int|null
Create the record in the ProductoImagen model and returns its idproducto.
createViewDocFiles()  : void
createViews()  : mixed
Load views
createViewsPedidosClientes()  : void
createViewsPedidosProveedores()  : void
createViewsProductImages()  : void
Add view for product images.
createViewsStock()  : void
createViewsSuppliers()  : void
createViewsVariants()  : void
datalistAction()  : array<string|int, mixed>
Run the datalist action.
db()  : DataBase
deleteAction()  : bool
Action to delete data.
deleteImageAction()  : bool
Delete an image.
editAction()  : bool
Runs the data edit action.
execAfterAction()  : mixed
Run the controller after actions.
execPreviousAction()  : bool
Run the actions that alter data before reading it.
exportAction()  : mixed
getAutocompleteValues()  : array<string|int, mixed>
Return values from Widget Values for autocomplete action
getClassName()  : string
Return the name of the controller.
insertAction()  : bool
Runs data insert action.
loadCustomAttributeWidgets()  : void
loadCustomReferenceWidget()  : void
loadData()  : mixed
Load view data procedure
loadExceptionVat()  : void
loadTypes()  : void
requestGet()  : array<string|int, mixed>
Return array with parameters values
response()  : Response
selectAction()  : array<string|int, mixed>
Run the select action.
sortImagesAction()  : bool
updateNumDocs()  : void
Actualiza el número de adjuntos del documento.
validateFormToken()  : bool
widgetLibrarySearchAction()  : array<string|int, mixed>
widgetLibraryUploadAction()  : array<string|int, mixed>
widgetSubcuentaSearchAction()  : array<string|int, mixed>
widgetVarianteSearchAction()  : array<string|int, mixed>
addFileAction()  : bool
buildExtensionCache()  : void
Builds and caches sorted extensions for a method name.
deleteFileAction()  : bool
editFileAction()  : bool
loadDataDocFiles()  : void
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

$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

$extensionCache

Cache for extension lookups by method name.

protected static array<string|int, mixed> $extensionCache = []

$extensions

Stores class extensions.

protected static array<string|int, mixed> $extensions = []

Methods

__call()

Executes the first matched extension.

public __call(string $name[, array<string|int, mixed> $arguments = [] ]) : mixed
Parameters
$name : string
$arguments : array<string|int, mixed> = []
Tags
throws
BadMethodCallException

__construct()

Starts all the objects and properties.

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

addButton()

Adds a new button to the tab.

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

addExtension()

public static addExtension(mixed $extension[, int $priority = 100 ]) : void
Parameters
$extension : mixed
$priority : int = 100

Priority for all methods in this extension (0-1000, default 100)

clearExtensions()

Clears all registered extensions.

public static clearExtensions() : void

getExtensions()

Returns a list of all registered extension names.

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

getMainViewName()

Returns the name assigned to the main view

public getMainViewName() : string
Return values
string

getModelClassName()

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

public getModelClassName() : string
Return values
string

getPageData()

Return the basic data for this page.

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

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

hasExtension()

public hasExtension(mixed $name) : bool
Parameters
$name : mixed
Return values
bool

pipe()

public pipe(string $name, array<string|int, mixed> ...$arguments) : mixed
Parameters
$name : string
$arguments : array<string|int, 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

redirect()

Redirect to an url or controller.

public redirect(string $url[, int $delay = 0 ]) : mixed
Parameters
$url : string
$delay : int = 0

removeExtension()

Removes all extensions with the specified name.

public static removeExtension(string $name) : bool
Parameters
$name : string
Return values
bool

True if at least one extension was removed

setCurrentView()

public setCurrentView(string $viewName) : void
Parameters
$viewName : string

setSettings()

Set value for setting of a view

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

setTabsPosition()

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

public setTabsPosition(string $position) : void
Parameters
$position : string

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

addEditListView()

Adds a EditList type view to the controller.

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

addEditView()

Adds an Edit type view to the controller.

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

addHtmlView()

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

addImageAction()

Add a list of images.

protected addImageAction() : bool
Return values
bool

addListView()

Adds a List type view to the controller.

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

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

createAttachedFile()

Create the record in the AttachedFile model and returns its identifier.

protected createAttachedFile(string $path) : int
Parameters
$path : string
Return values
int

createFileRelation()

Create the record in the AttachedFileRelation model.

protected createFileRelation(int $idproduct, int $idfile) : void
Parameters
$idproduct : int
$idfile : int

createProductImage()

Create the record in the ProductoImagen model and returns its idproducto.

protected createProductImage(int $idfile) : int|null
Parameters
$idfile : int
Return values
int|null

createViewDocFiles()

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

createViews()

Load views

protected createViews() : mixed

createViewsPedidosClientes()

protected createViewsPedidosClientes([string $viewName = 'ListLineaPedidoCliente' ]) : void
Parameters
$viewName : string = 'ListLineaPedidoCliente'

createViewsPedidosProveedores()

protected createViewsPedidosProveedores([string $viewName = 'ListLineaPedidoProveedor' ]) : void
Parameters
$viewName : string = 'ListLineaPedidoProveedor'

createViewsProductImages()

Add view for product images.

protected createViewsProductImages([string $viewName = 'EditProductoImagen' ]) : void
Parameters
$viewName : string = 'EditProductoImagen'

createViewsStock()

protected createViewsStock([string $viewName = 'EditStock' ]) : void
Parameters
$viewName : string = 'EditStock'

createViewsSuppliers()

protected createViewsSuppliers([string $viewName = 'EditProductoProveedor' ]) : void
Parameters
$viewName : string = 'EditProductoProveedor'

createViewsVariants()

protected createViewsVariants([string $viewName = 'EditVariante' ]) : void
Parameters
$viewName : string = 'EditVariante'

datalistAction()

Run the datalist action.

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

Returns a JSON string for the searched values.

Return values
array<string|int, mixed>

deleteAction()

Action to delete data.

protected deleteAction() : bool
Return values
bool

deleteImageAction()

Delete an image.

protected deleteImageAction() : bool
Return values
bool

editAction()

Runs the data edit action.

protected editAction() : bool
Return values
bool

execAfterAction()

Run the controller after actions.

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

execPreviousAction()

Run the actions that alter data before reading it.

protected execPreviousAction(string $action) : bool
Parameters
$action : string
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

loadCustomAttributeWidgets()

protected loadCustomAttributeWidgets(string $viewName) : void
Parameters
$viewName : string

loadCustomReferenceWidget()

protected loadCustomReferenceWidget(string $viewName) : void
Parameters
$viewName : string

loadData()

Load view data procedure

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

loadExceptionVat()

protected loadExceptionVat(string $viewName) : void
Parameters
$viewName : string

loadTypes()

protected loadTypes(string $viewName) : void
Parameters
$viewName : string

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>

sortImagesAction()

protected sortImagesAction() : bool
Return values
bool

updateNumDocs()

Actualiza el número de adjuntos del documento.

protected updateNumDocs() : void

validateFormToken()

protected abstract validateFormToken() : bool
Return values
bool

widgetLibrarySearchAction()

protected widgetLibrarySearchAction() : array<string|int, mixed>
Return values
array<string|int, mixed>

widgetLibraryUploadAction()

protected widgetLibraryUploadAction() : array<string|int, mixed>
Return values
array<string|int, mixed>

widgetSubcuentaSearchAction()

protected widgetSubcuentaSearchAction() : array<string|int, mixed>
Return values
array<string|int, mixed>

widgetVarianteSearchAction()

protected widgetVarianteSearchAction() : array<string|int, mixed>
Return values
array<string|int, mixed>

addFileAction()

private addFileAction() : bool
Return values
bool

buildExtensionCache()

Builds and caches sorted extensions for a method name.

private buildExtensionCache(string $name) : void
Parameters
$name : string

deleteFileAction()

private deleteFileAction() : bool
Return values
bool

editFileAction()

private editFileAction() : bool
Return values
bool

loadDataDocFiles()

private loadDataDocFiles(BaseView $view, string $model, string $modelid) : void
Parameters
$view : BaseView
$model : string
$modelid : string

unlinkFileAction()

private unlinkFileAction() : bool
Return values
bool

validateFileActionToken()

private validateFileActionToken() : bool
Return values
bool

        
On this page

Search results