Portale v2
Webservice REST
Handler: include/Webservices/CustomerPortal.php
NomeName |
ParametriParameters |
DescrizioneDescription |
| portal.info |
|
PermetteAllows diyou ottenereto informazioniobtain sullainformation licenzaon ethe ilicense loghiand utilizzatilogos dall'installazioneused diby the connected vtenext collegata.installation. |
| portal.login |
Body
. username: string (*)
. password: string (*)
. language: string
|
PermetteAllows diyou eseguireto illog loginin nelto portalethe clienticustomer fornendoportal l'by providing the email (username) e laand password delof contatto.the Ilcontact. servizioThe restituisceservice l'returns the accesskey dato utilizzarebe nelleused chiamatein successivesubsequent comecalls as a header (Authorization). |
| portal.logout |
Headers
. Authorization
|
PermetteAllows diyou eseguire ilto logout delthe contattocontact dalfrom portale.the portal. |
| portal.send_mail_for_password |
Body
. email: string (*)
. language: string
|
PermetteAllows ilyou recuperoto dellarecover the password diof una contatto del portale.contact. |
| portal.modules_list |
Headers
. Authorization
Body
. language: string (*)
|
PermetteAllows diyou ottenereto unaobtain listaa dilist moduliof abilitatimodules perenabled ilfor profilothe delcontact's contatto.profile. |
| portal.get_list |
Headers
. Authorization
Body
. module: string (*)
. language: string
. folderid: int
|
PermetteAllows diyou ottenereto laobtain listathe deilist recordof direcords unof moduloa filtratimodule perfiltered laby visibilitàthe delvisibility contatto/aziendaof delthe contatto.contact/contact's Ilcompany. parametroThe "folderid" vieneparameter utilizzatois dalused moduloby the Documents permodule ottenereto iget documentithe didocuments unaof cartellaa specifica.specific folder. |
| portal.get_blocks |
Headers
. Authorization
Body
. module: string (*)
. language: string
. mode: string (edit, create, detail, list) (*)
|
PermetteAllows diyou ottenereto laobtain listathe deilist blocchiof ethe deiblocks relativiand campithe direlated unfields moduloof filtratia permodule lafiltered visibilitàby delthe profilo.profile visibility. |
| portal.get_record |
Headers
. Authorization
Body
. module: string (*)
. id: int (*)
|
SeIf ilthe contattocontact hahas ivisibility permessipermissions difor visibilitàthe perindicated ilrecord, recordit indicato,allows permetteyou dito ottenereobtain iits suoi dati.data.
|
| portal.save_record |
Headers
. Authorization
Body
. module: string (*)
. id: int (*)
. values: encoded (*)
|
SeIf ilthe contattocontact hahas iwrite permessipermissions difor scritturathe perindicated ilrecord, recordit indicato,allows permetteits il suo salvataggio.saving. |
| portal.delete_record |
Headers
. Authorization
Body
. module: string (*)
. id: int (*)
|
SeIf ilthe contattocontact hahas idelete permessipermissions difor eliminazionethe perindicated ilrecord, recordit indicato,allows permetteits la sua cancellazione.deletion. |
| portal.write_ticket_comment |
Headers
. Authorization
Body
. id: int (*)
. comment: string (*)
|
PermetteAllows layou scritturato diwrite una commentocomment all'internowithin delthe ticketindicated indicato.ticket. |
| portal.get_attachments |
Headers
. Authorization
Body
. id: int (*)
|
PermetteAllows diyou ottenereto laobtain listathe deilist documentiof deldocuments of the specified record specificatofiltered filtratiby perthe lavisibility visibilitàof delthe contatto/aziendacontact/contact's del contatto.company. |
| portal.download_attachment |
Headers
. Authorization
Body
. relid: int (*)
. docid: int
|
SeIf ilthe contattocontact hahas ilpermission permessoto diview visualizzarethe l'allegatoattachment (relid), permetteit ilallows suoits download. |
| portal.upload_attachment |
Headers
. Authorization
Body
. relid: int (*)
. title: string (*)
|
PermetteAllows ilthe caricamentouploading diof unan allegatoattachment relazionatorelated alto the specified record specificato (relid). SiYou puòcan indicareindicate ilthe nomename (title) delof documentothe chedocument verràthat generato.will be generated. |
| portal.provide_confidential_info |
Headers
. Authorization
Body
. id: int (*)
. comments: string
. data: string (*)
. request_commentid: int (*)
|
PermetteAllows diyou rispondereto adrespond unato richiestaa direquest informazionifor confidenziali.confidential Ilinformation. parametroThe "id" indicaparameter l'idindicates delthe ticket,ticket ilid, parametrothe "comments" indicaparameter ilindicates commentothe nonunencrypted cifrato,comment, il parametrothe "data" indicaparameter laindicates rispostathe confidenzialeconfidential eresponse, iland parametrothe "request_commentid" indicaparameter l'indicates the id delof commentothe acomment cuito fornirewhich lathe rispostaconfidential confidenziale.response should be provided . |
| portal.get_home_widgets |
Headers
. Authorization
Body
. language: string
|
PermetteAllows diyou ottenereto iobtain widgetthe configuratiwidgets nelconfigured profiloin associatothe alprofile contatto.associated with the contact. |
| portal.save_authenticate_cookie |
Headers
. Authorization
Body
. contactid: int (*)
|
FornisceProvides unan hash dato memorizzarebe stored in una cookie perto permettereremember dithe ricordarecontact's l'accesso del contatto.login. |
| portal.check_authenticate_cookie |
Headers
. Authorization
Body
. contactid: int (*)
. hash: string (*)
|
PermetteAllows diyou verificareto l'verify the hash utilizzatoused perto ricordareremember l'accessothe delcontact's contatto.login. |
| portal.change_password |
Headers
. Authorization
Body
. username: string (*)
. old_password: string (*)
. password: string (*)
. language: string
|
PermetteAllows diyou cambiareto lachange passwordthe delcontact's contatto.password. |
RegistrareRegister una nuovonew REST webservice REST
QuestoThis script devemust esserebe eseguitorun in una file all'interno diwithin vtenext (es.e.g. plugins/script/script.php).
$parameters = ['param1' => 'string', 'param2' => 'encoded'];
$perm = 'read'; // read, write, readwrite
SDK::setRestOperation('portal.foo', 'include/Webservices/CustomerPortal.php', 'CustomerPortalRestApi.foo', $parameters, $perm);
EstendereExtend unan webserviceexisting REST esistentewebservice
QuestoThis script devemust esserebe eseguitorun in una file all'interno diwithin vtenext (es.e.g. "plugins/script/script.php").
SDK::setClass('CustomerPortalRestApi', 'CustomerPortalRestApi2', 'modules/SDK/src/CustomerPortalRestApi2.php');
CreareCreate una nuovonew file dato posizionareplace all'interno diinside vtenext (es.e.g. "modules/SDK/src/CustomerPortalRestApi2.php").
<?php
require_once('include/Webservices/CustomerPortal.php');
class CustomerPortalRestApi2 extends CustomerPortalRestApi {
function get_list($module, $language, $folderid = 0) {
// return parent::get_list($module, $language, $folderid);
// your custom code here
}
}
StrutturaStructure delleof cartelle/filemain principalifolders/files
LaThe cartellaportal delfolder portaleis silocated trovaat: in: VTE_ROOT/portal/v2
LeThe cartelle/filemain principalifolders/files delof nuovothe portalenew sono:portal are:
NomeFolder/file cartella/filename |
DescrizioneDescription |
| app |
ContieneContains ithe filefiles eand lethe logichelogic perof ilthe funzionamento del portale.portal. |
| app/controllers |
ContieneContains ithe filefiles chethat gestisconomanage lethe azioni diportal's default del portaleactions (es.e.g. Login, Logout, Edit, Detail, ecc.etc.). |
| app/fields |
ContieneContains ithe filefiles chethat gestisconomanage ithe campiportal deimodule moduli del portale.fields. |
| app/modules |
Contiene delle logicheContains custom dilogic alcuniof moduli disome vtenext modules (es.e.g. Documents, Processes, HelpDesk, ecc.etc.). |
| app/PortalModule.php |
ClasseClass chethat gestiscemanages lethe azioniactions deiof modulithe delportal portalemodules (es.e.g. Create, Detail, Edit, ecc.etc.). LaThe classeclass puòcan esserebe estesaextended perto modificarechange i comportamenti dithe default dibehaviors unof modulo.a module. |
| config |
ContieneContains ithe fileportal diconfiguration configurazione del portale.files. |
| public |
ContieneContains ithe fileportal's pubblicipublic del portalefiles (es.e.g. index.php, css, javascript, immagini,images, ecc.etc.). |
| resources |
ContieneContains lethe risorseresources utilizzateused dalby portalethe comeportal isuch fileas pertranslation le traduzionifiles (lang) eand i templatetemplates (templates). |
| sdk |
LaThe cartellafolder èis utilizzataused perto inserireinsert nuovenew personalizzazionicustomizations perfor ilthe cliente.customer. |
| storage |
ContieneContains itemporary file temporaneifiles (es.e.g. cache, logs, ecc.etc.). |
| vendor |
ContieneContains lethe librerieexternal esternelibraries utilizzateused dalby portale.the portal. |
Request lifecycle
ConfigurazionePortal del portaleconfiguration
IlThe portal configuration file diis configurazione del portale si trovalocated in "config/portal.config.php".
PerTo sovrascrivereoverwrite ithe parametriparameters deve essere utilizzato il filethe "config/sdk.config.php" altrimenti,file must be used otherwise, in casocase diof aggiornamentoupdating dellathe versioneversion diof vtenext, lethe modifichechanges potrebberocould esserebe perse.lost.
EccoHere lais listathe deilist parametriof supportatiparameters dalsupported nuovoby portale:the new portal:
ParametroParameter |
TipoType |
Default |
DescrizioneDescription |
| portal_url |
String |
$PORTAL_URL (config.inc.php) |
IndicaIndicates l'the URL delof portalethe clienti.customer Seportal. laIf cartellathe delportal portalefolder siis trovainside all'internothe dellavtenext root directorydirectory, dithe vtenext,variable lawill variabilebe verràset impostatato conthe ilvalue valoreof della variabilethe $PORTAL_URL impostatavariable nelset filein the config.inc.php.php file. |
| vte_url |
String |
$site_URL (config.inc.php) |
IndicaIndicates l'the URL diof vtenext eand vieneis utilizzatoused perto ottenereobtain iits relatividata dativia tramite lethe rest API. SeIf lathe cartellaportal delfolder portaleis siinside trovathe all'interno dellavtenext root directorydirectory, dithe vtenext,variable lawill variabilebe verràset impostatato conthe ilvalue valoreof della variabilethe $site_URL impostatavariable nelset filein the config.inc.php.php file. |
|
|
String |
|
IndicaIndicates lathe linguadefault predefinitalanguage utilizzataused nelin portalethe clienti.customer Ilportal. valoreThe puòvalue esserecan sostituitobe conreplaced unawith linguaa supportatasupported language (vedi parametrosee "languages") parameter). |
|
|
Array |
['en_us' => 'US English', 'it_it' => 'IT Italiano']
|
IndicaIndicates lethe linguelanguages supportatesupported nelin portalethe clienti.customer portal.
PerTo aggiungereadd unaa nuovanew lingualanguage siyou deveneed creareto uncreate nuovoa new file nellain cartellathe resources/lang.lang folder. |
|
|
Bool |
false |
QuestaThis configurazioneconfiguration indicaindicates sewhether glierrors errorishould devonobe esseredisplayed visualizzatior onot. meno.If Sethe l'ambienteenvironment èis diproduction, produzione,the ilvalue valorewill verràbe impostatoset suto true perto disabilitaredisable laerror visualizzazionedisplay. degliIf errori.the Seenvironment l'ambienteis èdevelopment, dithe sviluppo,value ilwill valorebe verràset impostato suto false perto consentireallow laerrors visualizzazioneto degli errori.appear. |
|
|
String |
|
IndicaIndicates ilthe modulodefault predefinitomodule dato caricareload dopoafter l'accessologging alinto portale.the Ilportal. valoreThe puòvalue esserecan sostituitobe conreplaced ilwith nomethe delname moduloof desideratothe desired module (devemust esserebe abilitatoenabled dafrom profilo)profile). SeIf ilthe parametroparameter èis vuoto,empty, verràthe caricata laportal home delwill portale.be loaded. |
|
|
String |
assets/img/VTENEXT_favicon.ico
|
IndicaIndicates ilthe percorsopath dellaof faviconthe dafavicon. caricareThe nelvalue portaleis clienti.relative Ilto valorethe èpublic relativo alla cartella public.folder. |
|
|
String |
assets/img/VTENEXT_login.png
|
IndicaIndicates ilthe percorsopath delof the logo dato caricareload all'internoon dellathe paginalogin dipage. login.The Ilvalue valoreis èrelative relativoto allathe cartellapublic public.folder.
[UPDATE] IlThe logo devemust esserebe caricatoloaded nelle impostazioni diin vtenext settings > Loghi.Logos.
|
|
|
String |
|
IndicaIndicates ilthe percorsopath delloof sfondothe dabackground caricareto all'internoload dellaon paginathe dilogin login.page. IlThe valorevalue èis relativorelative allato cartellathe public.public folder. |
|
|
String |
assets/img/VTENEXT_toggle.png
|
IndicaIndicates ilthe percorsopath dell'iconaof dathe caricareicon nellato barraload lateralein minimizzata.the Ilminimized valoresidebar. èThe relativovalue allais cartellarelative public.to the public folder. [UPDATE] L'iconaThe deveicon esseremust caricatabe nelleloaded impostazioni diin vtenext settings > Loghi.Logos. |
|
|
String |
assets/img/VTENEXT_header.png
|
IndicaIndicates ilthe percorsopath dell'iconaof dathe caricareicon nellato barraload lateralein allargata.the Ilexpanded valoresidebar. èThe relativovalue allais cartellarelative public.to the public folder. [UPDATE] L'iconaThe deveicon esseremust caricatabe nelleloaded impostazioni diin vtenext settings > Loghi.Logos. |
|
|
String |
|
IndicaIndicates ilthe logo utilizzatoused perto visualizzaredisplay lathe rispostaresponse datagiven dall'assistenzaby clienti.customer Ilsupport. valoreThe èvalue relativois allarelative cartellato public.the public folder. |
|
|
String |
|
IndicaIndicates lathe classeclass dellaof barrathe lateralemain principale.sidebar.
PuòIt averecan unahave luminositàa "dark" oor "light". brightness.
PuòIt averecan anchealso unahave variantea dicolor colore,variant, comesuch as "primary", "success", "warning", "info", "danger". |
|
|
Bool |
|
ConsenteEnable/disable dithe attivare/disattivaresearch labar barrain dithe ricercamain nella barra laterale principale.sidebar. |
|
|
String |
$csrf_secret (config.inc.php)
|
IndicaIndicates lathe chiavesecret segretakey utilizzataused perto generaregenerate una tokencsrf csrf.token. SeIf lathe cartellaportal delfolder portaleis siinside trovathe all'interno dellavtenext root directorydirectory, dithe vtenext,variable lawill variabilebe verràset impostatato conthe ilvalue valoreof della variabilethe $csrf_secret impostatavariable nelset filein the config.inc.php.php file. |
|
|
String |
|
IndicaIndicates ilthe nomename dellaof cartellathe utilizzatafolder perused ilfor caricamentouploading dei file.files. |
|
|
String |
|
IndicaIndicates l'etichettathe delprefix prefissolabel dato utilizzareuse perfor ilthe titolobrowser deltitle. browser.The Ilvalue valorecan puòbe esserereplaced sostituitowith conthe l'etichettadesired desiderata.label. |
|
|
String |
|
IndicaIndicates l'etichettathe delsuffix suffissolabel dato utilizzareuse perfor ilthe titolobrowser deltitle. browser.The Ilvalue valorecan puòbe esserereplaced sostituitowith conthe l'etichettadesired desiderata.label. |
|
|
String |
|
IndicaIndicates ilthe nomename delof the cookie utilizzatoused perto ricordareremember l'autenticazioneuser dell'utente.authentication. |
|
|
Int |
|
IndicaIndicates lathe scadenzaexpiration delof the cookie utilizzatoused perto ricordareremember l'autenticazioneuser dell'utente.authentication. IlThe valorevalue puòcan esserebe sostituitoreplaced conwith ilthe numerodesired dinumber secondiof desiderato.seconds. |
|
|
String |
|
IndicaIndicates ilthe fusodefault orariotime predefinitozone utilizzatoused nelin portalethe clienti.customer Questaportal. configurazioneThis deveconfiguration esseremust ugualebe allathe variabilesame as the $default_timezone impostatavariable nelset filein the vtenext config.inc.php di vtenext.file. |
|
|
Array |
|
ConWith questathis configurazioneconfiguration èyou possibilecan sovrascrivereoverride lethe iconedefault predefiniteicons utilizzateused perfor imodules modulienabled abilitatiin nelthe portalecustomer clienti.portal. LeThe iconedefault predefiniteform deiicons moduliare si trovanofound in app/layouts/PortalLayout.php. IThe nominames delleof iconethe siicons possonocan trovarebe quifound here https://fonts.google.com/icons. |
|
|
Array |
|
ConWith questathis configurazioneconfiguration siyou possonocan aggiungereadd nuovenew etichettelabels oor modificaremodify quelleexisting esistenti.ones.
SiYou deveneed creareto uncreate nuovoa new file nellain cartellathe sdk.sdk folder. |
|
|
Array |
|
ConWith questathis configurazioneconfiguration siyou possonocan aggiungereadd php files to load on each page (they should contain classes/functions). You need to create a new file php da caricare in ognithe paginasdk (dovrebbero contenere classi/funzioni).
Si deve creare un nuovo file nella cartella sdk.folder. |
|
|
Array |
|
ConWith questathis configurazioneconfiguration siyou possonocan aggiungereadd js dato caricareload globally. You need to create a livello globale.
Si deve creare un nuovonew file nellain cartellathe public/assets/sdk.sdk folder. |
|
|
Array |
|
ConWith questathis configurazioneconfiguration siyou possonocan aggiungereadd js dato caricareload perfor una modulospecific specifico.module.
SiYou deveneed creareto uncreate nuovoa new file nellain cartellathe public/assets/sdk.sdk folder. |
|
|
Array |
|
ConWith questathis configurazioneconfiguration siyou possonocan aggiungereadd css dato caricareload globally. You need to create a livello globale.
Si deve creare un nuovonew file nellain cartellathe public/assets/sdk.sdk folder. |
|
|
Array |
|
ConWith questathis configurazioneconfiguration siyou possonocan aggiungereadd azionicustom personalizzateactions (campo "action" nell'url)field in the URL).
L'The array rappresentarepresents un'associazionean traassociation ilbetween nomethe dell'azioneaction ename iland the file chethat contienecontains la classethe controller perclass gestireto lahandle richiesta.the request.
SiYou deveneed creareto uncreate nuovoa new file nellain cartellathe sdk.sdk folder. |
|
|
Array |
|
ConWith questathis configurazioneconfiguration siyou possonocan aggiungereadd personalizzazionicustomizations suon una modulospecific specifico.module.
L'The array rappresentarepresents un'associazionean traassociation ilbetween nomethe delmodule moduloname eand ilthe file chethat contienecontains lathe classemodule's estesaextended delclass. modulo.
SiYou deveneed creareto uncreate nuovoa new file nellain cartellathe sdk.sdk folder. |
|
|
Array |
|
ConWith questathis configurazioneconfiguration siyou possonocan aggiungereadd aggiungere voci dicustom menu personalizzateitems nellain barrathe laterale.sidebar.
SiYou deveneed creareto uncreate nuovoa new file nellain cartellathe sdk.sdk folder. |
API Reference - Classi,Main metodi,classes, funzionimethods, efunctions variabiliand principalivariables
\app\Request
MetodoMethod |
ArgomentiArguments |
DescrizioneDescription |
|
|
$keys = null, $purify = false
|
PermetteAllows diyou ottenereto unoget oone piùor parametrimore dallaparameters variabilefrom globalethe global variable $_GET. SeIf ilthe secondosecond argomentoargument èis impostatoset ato "true", ithe parametriparameters vengonoare purificatipurified attraversothrough la libreriathe HTML Purifier.Purifier Esempio:library. Example:
$request->get('foo'); $request->get(['foo', 'bar']); $request->get('foo', true);
|
|
|
$keys = null, $purify = false
|
PermetteAllows diyou ottenereto unoget oone piùor parametrimore dallaparameters variabilefrom globalethe global variable $_POST. SeIf ilthe secondosecond argomentoargument èis impostatoset ato "true", ithe parametriparameters vengonoare purificatipurified attraversothrough la libreriathe HTML Purifier.Purifier Esempio:library. Example:
$request->post('foo'); $request->post(['foo', 'bar']); $request->post('foo', true);
|
|
|
|
PermetteAllows diyou ottenereto iget filefiles caricatiuploaded attraversovia il metodothe HTTP POST emethod organizzatiand tramiteorganized lavia variabilethe globaleglobal variable $_FILES.
$request->files('attachments');
|
|
|
$keys = null, $purify = false
|
PermetteAllows diyou ottenereto unoobtain oone piùor parametrimore dallaparameters variabilefrom globalethe global variable $_COOKIE. SeIf ilthe secondosecond argomentoargument èis impostatoset ato "true", ithe parametriparameters vengonoare purificatipurified attraversothrough la libreriathe HTML Purifier.Purifier Esempio:library. Example:
$request->cookie('foo');
|
|
|
$keys = null, $purify = false
|
PermetteAllows diyou ottenereto unoget oone piùor parametrimore dallaparameters variabilefrom globalethe global variable $_SERVER. SeIf ilthe secondosecond argomentoargument èis impostatoset ato "true", ithe parametriparameters vengonoare purificatipurified attraversothrough la libreriathe HTML Purifier.Purifier Esempio:library. Example:
$request->server('');
|
|
|
|
RitornaReturns true seif ilthe metodorequest dellamethod richiesta èis GET. |
|
|
|
RitornaReturns true seif ilthe metodorequest dellamethod richiesta èis POST. |
|
|
|
RitornaReturns true seif lathe richiestarequest èis AJAX. |
|
|
|
PurificaPurify la variabilethe $input attraverso lavariable libreriathrough the HTML Purifier.Purifier library. |
\app\Response
MetodoMethod |
ArgomentiArguments |
DescrizioneDescription |
|
|
$content = '', $statusCode = 200, $headers = []
|
InizializzaInitializes una nuovo oggettonew \app\Response() conobject ilwith contenutothe dellaresponse rispostacontent ($content), ilreturn codice di ritornocode ($statusCode), e gli header diand default headers ($headers). |
|
|
|
ImpostaSet ilthe contenutocontent dellaof risposta.the response. |
|
|
|
ImpostaSet ilthe codiceresponse direturn ritorna della risposta.code. |
|
|
|
ImpostaSet una nuovonew header nellain risposta.the Conresponse. ilWith secondothe argomentosecond èargument possibileit indicareis sepossible l'headerto deveindicate sostituirewhether oppureor nonot unthe header precedentemust giàreplace impostato.a previous header already set. |
|
|
|
ImpostaSets ilthe mimeresponse delcontent contenuto della risposta.mime.
|
|
|
|
ImpostaSet ilresponse contenutocontent della risposta conwith $data convertitoconverted in formatoto JSON eformat mimeand 'application/json'. mime. |
|
|
|
EseguePerforms una redirect versoto $page. |
|
|
|
PermetteAllows lodownloading scaricamentoof di una file posizionatolocated in $fullpath. |
|
|
|
EsegueOutputs l'outputthe delcontent, contenuto,response delcode, codiceand diheaders rispostayou e degli header impostati.set. |
\app\Session
MetodoMethod |
ArgomentiArguments |
DescrizioneDescription |
|
|
|
ImpostaSet ilthe valorevalue $value conwith chiavekey $key in $_SESSION. |
|
|
|
PermetteAllows diyou ottenereto ilget valorethe convalue chiavewith key $key dafrom $_SESSION. |
|
|
$key |
PermetteAllows diyou ottenereto ilget valorethe convalue chiavewith key $key dafrom $_SESSION. Successivamente,Next, la chiavethe $key verràwill eliminatabe dadeleted from $_SESSION. |
|
|
$key |
EliminaDelete la chiavethe $key dafrom $_SESSION. |
|
|
$key |
RitornaReturns true se esiste la chiaveif $key exists in $_SESSION. |
|
|
$keys |
PermetteAllows diyou scrivereto valoriwrite multiplimultiple invalues to $_SESSION. |
|
|
|
EliminaDelete valorimultiple multiplivalues in $_SESSION. |
|
|
|
ImpostaSet la chiavethe $key comeas unan array in $_SESSION eand ilthe valorevalue $value vieneis aggiuntoadded ato quest'ultimo.it. |
\app\Config
MetodoMethod |
ArgomentiArguments |
DescrizioneDescription |
|
|
|
RitornaReturns true se esiste la chiaveif $key nellaexists configurazionein globale.the global configuration. |
|
|
|
PermetteAllows diyou ottenereto ilget valorethe convalue chiavewith key $key dallafrom configurazionethe globale.global configuration. |
|
|
|
ImpostaSet ilthe valorevalue $value conwith chiavekey $key nellain configurazionethe globale.global configuration. |
|
|
|
PermetteIt diallows ottenereyou unato listaobtain chiave-valorea conkey-value tuttalist lawith configurazioneall globale.the global configuration. |
|
|
|
PermetteAllows diyou scrivereto valoriwrite multiplimultiple nellavalues configurazioneinto globale.the global configuration. |
|
|
|
EliminaDelete la chiavethe $key dallafrom configurazionethe globale.global configuration. |
|
|
|
EliminaDelete tuttiall ivalues valorifrom dallathe configurazioneglobal globale.configuration. |
\app\PortalModule
VariabileVariable |
Default |
DescrizioneDescription |
| $hasComments |
|
IndicaIndicates sewhether ilthe modulomodule supportasupports il blocco commenti.comments. |
|
|
|
IndicaIndicates sewhether ilthe modulomodule supportasupports gli allegati.attachments. |
|
|
|
IndicaIndicates sewhether ilthe modulomodule puòcan esserebe modificatomodified (modalitàedit edit)mode). |
|
|
3 |
IndicaIndicates ilthe numeronumber diof colonnecolumns dato utilizzareuse perfor ladisplaying visualizzazione dei campifields in Create, Edit eand Detail. |
|
|
|
IndicaIndicates ilthe template utilizzatoused perfor ladisplaying visualizzazionea di una listalist (action List). |
| $referenceListTemplate |
sections/ReferenceList.tpl
|
IndicaIndicates ilthe template utilizzatoused perfor ladisplaying visualizzazionea direlated una lista relazionatalist (uitype 10). |
|
|
|
IndicaIndicates ilthe template utilizzatoused perto ladisplay visualizzazionethe deldetail dettaglioof di una record (action Detail). |
|
|
|
IndicaIndicates ilthe template utilizzatoused perto ladisplay visualizzazionethe dellaedit modificaof di una record (action Edit). |
|
|
|
IndicaIndicates ilthe template utilizzatoused perto visualizzaredisplay una errorepermission di permessoerror (es.e.g. record nonnot trovatofound oor erroripermission di permessi)errors). |
MetodoMethod |
ArgomentiArguments |
DescrizioneDescription |
|
|
|
$module indicaindicates ilthe nomename delof modulothe permodule ottenereto un'instanzaobtain dellaan classe.instance Seof ilthe moduloclass. èIf statothe estesomodule tramitehas sdkbeen alloraextended verràvia ritornataSDK un'istanzathen dellaan classeinstance estesa.of the extended class will be returned. |
|
|
|
MetodoMethod utilizzatoused perfor ladisplaying visualizzazionea di una listalist (action List). |
|
|
$viewer, $request |
QuestoThis metodomethod puòcan esserebe utilizzatoused dalleby classiextended esteseclasses perto inserire/modificareinsert/modify idata datiset impostati nellain prepareList(). |
|
|
$viewer, $request |
MetodoMethod utilizzatoused perto ladisplay visualizzazionethe dellaedit modificaof di una record (action Edit). |
|
|
$viewer, $request |
QuestoThis metodomethod puòcan esserebe utilizzatoused dalleby classiextended esteseclasses perto inserire/modificareinsert/modify ithe datidata impostatiset nellain prepareEdit(). |
|
|
|
MetodoMethod utilizzatoused perto ladisplay visualizzazionethe deldetail dettaglioof di una record (action Detail). |
|
|
$viewer, $request |
QuestoThis metodomethod puòcan esserebe utilizzatoused dalleby classiextended esteseclasses perto inserire/modificareinsert/modify idata datiset impostati nellain prepareDetail(). |
|
|
|
MetodoMethod utilizzatoused perto ilsave salvataggio di una record (action Save). |
|
|
|
QuestoThis metodomethod puòcan esserebe utilizzatoused dalleby classiextended esteseclasses perto inserire/modificareinsert/modify idata datiset impostati nellain saveRecord(). |
|
|
$module, $action = self::ACTION_LIST, $recordValues = []
|
RitornaReturns seif ilthe contattocontact hahas ilpermission permessoto diperform eseguirea unacertain determinata azione.action.
ListaList azioniof supportate:supported actions:
. ACTION_LIST
. ACTION_CREATE
. ACTION_EDIT
. ACTION_DETAIL
. ACTION_DELETE
. ACTION_SAVE
. ACTION_ADD_COMMENTS
. ACTION_UPLOAD_ATTACHMENTS
. ACTION_CHANGE_PWD
. ACTION_SOLVE_TICKET
|
\app\clients\PortalRestClient
MetodoMethod |
ArgomentiArguments |
DescrizioneDescription |
|
|
$restName, $queryParameters = [], $headers = [] |
PermetteAllows diyou eseguireto unaperform richiestaa GET versorequest to vtenext. |
|
|
$restName, $queryParameters = [], $bodyParameters = [], $headers = [] |
PermetteAllows diyou eseguireto unaperform richiestaa POST versorequest to vtenext. |
|
|
$restName, $queryParameters = [], $bodyParameters = [], $fileParameters = [], $headers = [] |
PermetteAllows diyou eseguireto unaperform richiestaa multipart POST multipartrequest versoto vtenext.
|
|
|
$restName, $queryParameters = [], $bodyParameters = [], $headers = []
|
PermetteAllows diyou eseguireto unaexecute richiestaa PATCH versorequest to vtenext. |
|
|
$restName, $queryParameters = [], $headers = []
|
PermetteAllows diyou eseguireto unaexecute richiestaa DELETE versorequest to vtenext. |
|
|
$restName, $queryParameters = [], $bodyParameters = [], $headers = []
|
PermetteAllows diyou eseguireto unaperform richiestaa POST perrequest scaricareto undownload a vtenext file di vtenext in modalitàstream stream.mode. |
Helpers
FunzioneFunction |
ArgomentiArguments |
DescrizioneDescription |
|
|
|
print_r formattatoformatted con tagwith <pre> tag |
|
|
$var |
var_dump formattatoformatted con tagwith <pre> tags |
|
|
$value, $charset = 'UTF-8'
|
CodificaEncode il valorethe $value pervalue essereto inseritobe ininserted unainto paginaan HTML.HTML page. |
|
|
|
CodificaEncode il valorethe $value pervalue essereto inseritobe all'internoplaced diinside unan attributo di unHTML tag HTML.attribute. |
|
|
|
CodificaEncode il valorethe $value pervalue essereto inseritobe all'internoplaced diinside unoa javascript <script> javascript.. |
|
|
|
CodificaEncode unaa listalist diof attributiattributes perto esserebe inseritiplaced all'internoinside dian unHTML tag HTML.tag. |
|
|
|
PermetteAllows diyou ottenereto ilget valorethe convalue chiavewith key $key dallafrom configurazionethe globale.global configuration. |
|
|
|
PermetteTranslate lathe traduzione di un'etichettalabel $key. |
|
|
|
GeneraGenerate una link perto aprireopen unaa lista.list. |
|
|
|
GeneraGenerates una link perto aprireopen lathe creazionecreation diof una record. |
|
|
|
GeneraGenerates una link perto aprireopen lathe creazionecreation diof una documento.document. |
|
|
|
GeneraGenerates una link perto aprireopen ilthe dettagliodetail diof una record. |
|
|
|
GeneraGenerates una link perto aprireopen lathe modificaediting diof una record. |
|
|
|
GeneraGenerates una link per eseguire ilto download dia un documento.document. |
|
|
|
GeneraGenerates una link perto aprireopen unaa cartellaspecific specificafolder nelin modulothe documenti.documents module. |
|
|
|
GeneraGenerate una return link di ritorno indietro (es. azionee.g. "Annulla")Cancel" action). |
|
|
|
RitornaReturns lathe lingualanguage utilizzataused nelin portale.the portal. |
|
|
|
ImpostaSet la linguathe $language nelin portale.the portal. |
|
|
|
RitornaReturns ilthe titolotitle dato impostarebe set in una paginaan HTML delpage portale.of the portal. |
|
|
|
RitornaReturns lathe traduzionetranslation delof modulothe module $module. |
|
|
|
RitornaReturns lathe traduzionesingular singolaretranslation delof modulothe module $module. |
|
|
|
RitornaReturns lathe dimensione massima dimaximum upload nelsize portale.in the portal. |
|
|
$name, $value = "", $expires_or_options, $httponly = false
|
ImpostaSet una cookie nelin portale.the portal. |
|
|
|
RimuoveRemoves una cookie dalfrom portale.the portal. |
|
|
|
RitornaReturns ilthe tokencsrf csrf.token. |
|
|
|
RitornaReturns ilthe nomename dell'of the input perfor l'inviosending delthe tokencsrf csrf.token. |
|
|
|
PermetteAllows diyou visualizzareto undisplay messaggioa ditimed erroreerror temporizzato.message. |
|
|
|
PermetteAllows diyou visualizzareto undisplay messaggioa temporizzato.timed message. |
|
|
|
RitornaReturns l'idthe delID contattoof autenticato.the authenticated contact. |
|
|
|
RitornaReturns l'the email delof contattothe autenticato.authenticated contact. |
|
|
|
RitornaReturns ilthe nomename eand cognomesurname delof contattothe autenticato.authenticated contact. |
|
|
|
PermetteAllows ilthe versionamentoversioning di fileof css eand javascript.javascript files. |
|
|
|
RitornaReturns ilthe percorsopath dellato cartellathe portal base delfolder. portale. Se viene indicatoIf $path vieneis creato e restituito un percorsospecified, a partirepath dallais cartellacreated base.and returned starting from the base folder. |
|
|
|
RitornaReturns ilthe percorsopath dellato cartellathe portal's "app" delfolder. portale. Se viene indicatoIf $path vieneis creato e restituito un percorsospecified, a partirepath dallais cartellacreated and returned starting from the "app". folder. |
|
|
|
RitornaReturns ilthe percorsopath dellato cartellathe portal's "config" delfolder. portale. Se viene indicatoIf $path vieneis creato e restituito un percorsospecified, a partirepath dallais cartellacreated and returned starting from the "config". folder. |
|
|
|
RitornaReturns ilthe percorsopath dellato cartellathe portal's "resources" delfolder. portale. Se viene indicatoIf $path vieneis creato e restituito un percorsospecified, a partirepath dallais cartellacreated and returned starting from the "resources". folder. |
|
|
|
RitornaReturns ilthe percorsopath delto the indicated language file della lingua $lang indicata.lang. |
|
|
|
RitornaReturns ilthe percorsopath dellato cartellathe portal's "storage" delfolder. portale. Se viene indicatoIf $path vieneis creato e restituito un percorsospecified, a partirepath dallais cartellacreated and returned starting from the "storage". folder. |
|
|
|
RitornaReturns ilthe percorsopath dellato cartellathe portal's "public" delfolder. portale. Se viene indicatoIf $path vieneis creato e restituito un percorsospecified, a partirepath dallais cartellacreated and returned starting from the "public". folder. |
|
|
|
RitornaReturns ilthe percorsopath dellato cartellathe divtenext vtenext.folder. Se viene indicatoIf $path vieneis creato e restituito un percorsoindicated, a partirepath dallais cartellacreated diand vtenext.returned starting from the vtenext folder. |
|
|
|
RitornaReturns ilthe percorsopath dellato cartellathe portal's "sdk" delfolder. portale. Se viene indicatoIf $path vieneis creato e restituito un percorsoindicated, a partirepath dallais cartellacreated and returned starting from the "sdk". folder. |
|
|
|
RitornaReturns ilthe percorsopath dellato cartellathe portal's "public/assets/sdk" delfolder. portale. Se viene indicatoIf $path vieneis creato e restituito un percorsospecified, a partirepath dallais cartellacreated and returned starting from the "public/assets/sdk". folder. |
|
|
|
Ritorna un percorso relativoReturns a partirerelative dallapath cartellastarting from the "public". folder. |
EsempiExamples
CreazioneCreating dia un nuovonew controller
EccoHere unis esempioan diexample comeof crearehow unto nuovocreate a new controller perto gestiremanage un'azionea custom nelaction nuovoin portalethe clienti.new customer portal.
ModificareEdit "config/sdk.config.php" inserendoto ilinsert nuovoa new controller
return [
'sdk_controllers' => [
'SampleVte' => 'controllers/SampleVteController.php',
]
];
ImplementareImplement la classethe SampleVteController class in "sdk/controllers/SampleVteController.php"
<?php
class SampleVteController extends \app\controllers\BaseController {
public function index($request) {
return $this->displaySomething($request);
}
protected function displaySomething($request) {
$parameter1 = $request->get('parameter1', true);
$parameter2 = $request->get('parameter2', true);
$this->viewer->assign('PARAMETER1', $parameter1);
$this->viewer->assign('PARAMETER2', $parameter2);
$layout = \app\LayoutFactory::getPortalLayout($this->viewer, $this->client, $request);
$output = $this->fetchWithLayout('sdk/SampleVte.tpl', $layout);
return new \app\Response($output);
}
}
CreareCreate una nuovonew template in "resources/templates/sdk/SampleVte.tpl"
{extends file='layouts/PortalLayout.tpl'}
{block name=content}
<h1>Sample Vte</h1>
{/block}
ModificareModify "config/sdk.config.php" indicandoindicating unan sdk file sdkfor perinserting l'inserimentonew dientries nuoviin vocithe nelside menù lateralemenu
return [
'sdk_controllers' => [
'SampleVte' => 'controllers/SampleVteController.php',
],
'sdk_menu' => [
'samplevte-menu.php',
]
];
ModificareEdit il filethe "sdk/samplevte-menu.php" file
<?php
return [
[
'text' => trans('SampleVte'),
'active' => false,
'prefix' => [
'type' => 'icon',
'icon_style' => 'material',
'icon_name' => 'pie_chart',
],
'action' => [
'type' => 'link',
'link_href' => "index.php?action=SampleVte",
],
],
];

EstensioneExtending dia un modulomodule
EccoHere unis esempioan diexample comeof estenderehow leto funzionalitàextend dithe unfunctionality moduloof nela nuovoform portalein clienti.the new customer portal.
ModificareEdit "config/sdk.config.php"
return [
'sdk_module' => [
'Contacts' => 'modules/ContactsModule.php',
]
];
ImplementareImplement la classethe ContactsModule class in "sdk/modules/ContactsModule.php"
<?php
class ContactsModule extends \app\PortalModule {
public $hasComments = true;
public $formColumns = 2;
public function canAddComments() {
return true;
}
}
