dolibarr 20.0.0
|
Parent class of all other business classes (invoices, contracts, proposals, orders, ...) More...
Public Member Functions | |
isEmpty () | |
isEmpty We consider CommonObject isEmpty if this->id is empty | |
setErrorsFromObject ($object) | |
setErrorsFromObject | |
getTooltipContentArray ($params) | |
Return array of data to show into a tooltip. | |
getTooltipContent ($params) | |
getTooltipContent | |
errorsToString () | |
Method to output saved errors. | |
getFormatedCustomerRef ($objref) | |
Return customer ref for screen output. | |
getFormatedSupplierRef ($objref) | |
Return supplier ref for screen output. | |
getFullAddress ($withcountry=0, $sep="\n", $withregion=0, $extralangcode='') | |
Return full address of contact. | |
getLastMainDocLink ($modulepart, $initsharekey=0, $relativelink=0) | |
Return the link of last main doc file for direct public download. | |
add_contact ($fk_socpeople, $type_contact, $source='external', $notrigger=0) | |
Add a link between element $this->element and a contact. | |
copy_linked_contact ($objFrom, $source='internal') | |
Copy contact from one element to current. | |
update_contact ($rowid, $statut, $type_contact_id=0, $fk_socpeople=0) | |
Update a link to contact line. | |
delete_contact ($rowid, $notrigger=0) | |
Delete a link to contact line. | |
delete_linked_contact ($source='', $code='') | |
Delete all links between an object $this and all its contacts in llx_element_contact. | |
liste_contact ($statusoflink=-1, $source='external', $list=0, $code='', $status=-1, $arrayoftcids=array()) | |
Get array of all contacts for an object. | |
swapContactStatus ($rowid) | |
Update status of a contact linked to object. | |
liste_type_contact ($source='internal', $order='position', $option=0, $activeonly=0, $code='') | |
Return array with list of possible values for type of contacts. | |
listeTypeContacts ($source='internal', $option=0, $activeonly=0, $code='', $element='', $excludeelement='') | |
Return array with list of possible values for type of contacts. | |
getIdContact ($source, $code, $status=0) | |
Return id of contacts for a source and a contact code. | |
fetch_contact ($contactid=null) | |
Load object contact with id=$this->contact_id into $this->contact. | |
fetch_thirdparty ($force_thirdparty_id=0) | |
Load the third party of object, from id $this->socid or $this->fk_soc, into this->thirdparty. | |
fetchOneLike ($ref) | |
Looks for an object with ref matching the wildcard provided It does only work when $this->table_ref_field is set. | |
fetch_barcode () | |
Load data for barcode into properties ->barcode_type* Properties ->barcode_type that is id of barcode. | |
fetch_project () | |
Load the project with id $this->fk_project into this->project. | |
fetch_projet () | |
Load the project with id $this->fk_project into this->project. | |
fetch_product () | |
Load the product with id $this->fk_product into this->product. | |
fetch_user ($userid) | |
Load the user with id $userid into this->user. | |
fetch_origin () | |
Read linked origin object. | |
fetchObjectFrom ($table, $field, $key, $element=null) | |
Load object from specific field. | |
getValueFrom ($table, $id, $field) | |
Getter generic. | |
setValueFrom ($field, $value, $table='', $id=null, $format='', $id_field='', $fuser=null, $trigkey='', $fk_user_field='fk_user_modif') | |
Setter generic. | |
load_previous_next_ref ($filter, $fieldid, $nodbprefix=0) | |
Load properties id_previous and id_next by comparing $fieldid with $this->ref. | |
getListContactId ($source='external') | |
Return list of id of contacts of object. | |
setProject ($projectid, $notrigger=0) | |
Link element with a project. | |
setPaymentMethods ($id) | |
Change the payments methods. | |
setMulticurrencyCode ($code) | |
Change the multicurrency code. | |
setPaymentTerms ($id, $deposit_percent=null) | |
Change the payments terms. | |
setTransportMode ($id) | |
Change the transport mode methods. | |
setRetainedWarrantyPaymentTerms ($id) | |
Change the retained warranty payments terms. | |
setDeliveryAddress ($id) | |
Define delivery address. | |
setShippingMethod ($shipping_method_id, $notrigger=0, $userused=null) | |
Change the shipping method. | |
setWarehouse ($warehouse_id) | |
Change the warehouse. | |
setDocModel ($user, $modelpdf) | |
Set last model used by doc generator. | |
setBankAccount ($fk_account, $notrigger=0, $userused=null) | |
Change the bank account. | |
line_order ($renum=false, $rowidorder='ASC', $fk_parent_line=true) | |
Save a new position (field rang) for details lines. | |
getChildrenOfLine ($id, $includealltree=0) | |
Get children of line. | |
line_up ($rowid, $fk_parent_line=true) | |
Update a line to have a lower rank. | |
line_down ($rowid, $fk_parent_line=true) | |
Update a line to have a higher rank. | |
updateRangOfLine ($rowid, $rang) | |
Update position of line (rang) | |
line_ajaxorder ($rows) | |
Update position of line with ajax (rang) | |
updateLineUp ($rowid, $rang) | |
Update position of line up (rang) | |
updateLineDown ($rowid, $rang, $max) | |
Update position of line down (rang) | |
getRangOfLine ($rowid) | |
Get position of line (rang) | |
getIdOfLine ($rang) | |
Get rowid of the line relative to its position. | |
line_max ($fk_parent_line=0) | |
Get max value used for position of line (rang) | |
update_ref_ext ($ref_ext) | |
Update external ref of element. | |
update_note ($note, $suffix='', $notrigger=0) | |
Update note of element. | |
update_note_public ($note) | |
Update public note (kept for backward compatibility) | |
update_price ($exclspec=0, $roundingadjust='auto', $nodatabaseupdate=0, $seller=null) | |
Update total_ht, total_ttc, total_vat, total_localtax1, total_localtax2 for an object (sum of lines). | |
add_object_linked ($origin=null, $origin_id=null, $f_user=null, $notrigger=0) | |
Add an object link into llx_element_element. | |
getElementType () | |
Return an element type string formatted like element_element target_type and source_type. | |
fetchObjectLinked ($sourceid=null, $sourcetype='', $targetid=null, $targettype='', $clause='OR', $alsosametype=1, $orderby='sourcetype', $loadalsoobjects=1) | |
Fetch array of objects linked to current object (object of enabled modules only). | |
clearObjectLinkedCache () | |
Clear the cache saying that all linked object were already loaded. | |
updateObjectLinked ($sourceid=null, $sourcetype='', $targetid=null, $targettype='', $f_user=null, $notrigger=0) | |
Update object linked of a current object. | |
deleteObjectLinked ($sourceid=null, $sourcetype='', $targetid=null, $targettype='', $rowid=0, $f_user=null, $notrigger=0) | |
Delete all links between an object $this. | |
setStatut ($status, $elementId=null, $elementType='', $trigkey='', $fieldstatus='fk_statut') | |
Set status of an object. | |
getCanvas ($id=0, $ref='') | |
Load type of canvas of an object if it exists. | |
getSpecialCode ($lineid) | |
Get special code of a line. | |
isObjectUsed ($id=0, $entity=0) | |
Function to check if an object is used by others (by children). | |
hasProductsOrServices ($predefined=-1) | |
Function to say how many lines object contains. | |
getTotalDiscount () | |
Function that returns the total amount HT of discounts applied for all lines. | |
getTotalWeightVolume () | |
Return into unit=0, the calculated total of weight and volume of all lines * qty Calculate by adding weight and volume of each product line, so properties ->volume/volume_units/weight/weight_units must be loaded on line. | |
setExtraParameters () | |
Set extra parameters. | |
formAddObjectLine ($dateSelector, $seller, $buyer, $defaulttpldir='/core/tpl') | |
Show add free and predefined products/services form. | |
printObjectLines ($action, $seller, $buyer, $selected=0, $dateSelector=0, $defaulttpldir='/core/tpl') | |
Return HTML table for object lines TODO Move this into an output class file (htmlline.class.php) If lines are into a template, title must also be into a template But for the moment we don't know if it's possible as we keep a method available on overloaded objects. | |
printObjectLine ($action, $line, $var, $num, $i, $dateSelector, $seller, $buyer, $selected=0, $extrafields=null, $defaulttpldir='/core/tpl') | |
Return HTML content of a detail line TODO Move this into an output class file (htmlline.class.php) | |
printOriginLinesList ($restrictlist='', $selectedLines=array()) | |
Return HTML table table of source object lines TODO Move this and previous function into output html class file (htmlline.class.php). | |
printOriginLine ($line, $var, $restrictlist='', $defaulttpldir='/core/tpl', $selectedLines=array()) | |
Return HTML with a line of table array of source object lines TODO Move this and previous function into output html class file (htmlline.class.php). | |
add_element_resource ($resource_id, $resource_type, $busy=0, $mandatory=0) | |
Add resources to the current object : add entry into llx_element_resources Need $this->element & $this->id. | |
delete_resource ($rowid, $element, $notrigger=0) | |
Delete a link to resource line. | |
__clone () | |
Overwrite magic function to solve problem of cloning object that are kept as references. | |
indexFile ($destfull, $update_main_doc_field) | |
Index a file into the ECM database. | |
addThumbs ($file) | |
Build thumb. | |
delThumbs ($file) | |
Delete thumbs. | |
getDefaultCreateValueFor ($fieldname, $alternatevalue=null, $type='alphanohtml') | |
Return the default value to use for a field when showing the create form of object. | |
call_trigger ($triggerName, $user) | |
Call trigger based on this instance. | |
fetchValuesForExtraLanguages () | |
Function to get alternative languages of a data into $this->array_languages This method is NOT called by method fetch of objects but must be called separately. | |
setValuesForExtraLanguages ($onlykey='') | |
Fill array_options property of object by extrafields value (using for data sent by forms) | |
fetchNoCompute ($id) | |
Function to make a fetch but set environment to avoid to load computed values before. | |
fetch_optionals ($rowid=null, $optionsArray=null) | |
Function to get extra fields of an object into $this->array_options This method is in most cases called by method fetch of objects but you can call it separately. | |
deleteExtraFields () | |
Delete all extra fields values for the current object. | |
insertExtraFields ($trigger='', $userused=null) | |
Add/Update all extra fields values for the current object. | |
insertExtraLanguages ($trigger='', $userused=null) | |
Add/Update all extra fields values for the current object. | |
updateExtraField ($key, $trigger=null, $userused=null) | |
Update 1 extra field value for the current object. | |
getExtraField ($key) | |
Convenience method for retrieving the value of an extrafield without actually fetching it from the database. | |
setExtraField ($key, $value) | |
Convenience method for setting the value of an extrafield without actually updating it in the database. | |
updateExtraLanguages ($key, $trigger=null, $userused=null) | |
Update an extra language value for the current object. | |
showInputField ($val, $key, $value, $moreparam='', $keysuffix='', $keyprefix='', $morecss=0, $nonewbutton=0) | |
Return HTML string to put an input field into a page Code very similar with showInputField of extra fields. | |
clearFieldError ($fieldKey) | |
clear validation message result for a field | |
setFieldError ($fieldKey, $msg='') | |
set validation error message a field | |
getFieldError ($fieldKey) | |
get field error message | |
validateField ($fields, $fieldKey, $fieldValue) | |
Return validation test result for a field. | |
showOptionals ($extrafields, $mode='view', $params=null, $keysuffix='', $keyprefix='', $onetrtd='', $display_type='card') | |
Function to show lines of extrafields with output data. | |
getJSListDependancies ($type='_extra') | |
getRights () | |
Returns the rights used for this class. | |
defineBuyPrice ($unitPrice=0.0, $discountPercent=0.0, $fk_product=0) | |
Get buy price to use for margin calculation. | |
getDataToShowPhoto ($modulepart, $imagesize) | |
Function used to get the logos or photos of an object. | |
show_photos ($modulepart, $sdir, $size=0, $nbmax=0, $nbbyrow=5, $showfilename=0, $showaction=0, $maxHeight=120, $maxWidth=160, $nolink=0, $overwritetitle=0, $usesharelink=0, $cache='', $addphotorefcss='photoref') | |
Show photos of an object (nbmax maximum), into several columns. | |
isDate ($info) | |
Function test if type is date. | |
isDuration ($info) | |
Function test if type is duration. | |
isInt ($info) | |
Function test if type is integer. | |
isFloat ($info) | |
Function test if type is float. | |
isText ($info) | |
Function test if type is text. | |
setVarsFromFetchObj (&$obj) | |
Function to load data from a SQL pointer into properties of current object $this. | |
emtpyObjectVars () | |
Sets all object fields to null. | |
getFieldList ($alias='', $excludefields=array()) | |
Function to concat keys of fields. | |
createCommon (User $user, $notrigger=0) | |
Create object in the database. | |
fetchCommon ($id, $ref=null, $morewhere='', $noextrafields=0) | |
Load object in memory from the database. | |
fetchLinesCommon ($morewhere='', $noextrafields=0) | |
Load object in memory from the database. | |
updateCommon (User $user, $notrigger=0) | |
Update object into database. | |
deleteCommon (User $user, $notrigger=0, $forcechilddeletion=0) | |
Delete object in database. | |
deleteByParentField ($parentId=0, $parentField='', $filter='', $filtermode="AND") | |
Delete all child object from a parent ID. | |
deleteLineCommon (User $user, $idline, $notrigger=0) | |
Delete a line of object in database. | |
setStatusCommon ($user, $status, $notrigger=0, $triggercode='') | |
Set to a status. | |
setSignedStatusCommon ($user, $status, $notrigger=0, $triggercode='') | |
Set to a signed status. | |
initAsSpecimenCommon () | |
Initialise object with example values Id must be 0 if object instance is a specimen. | |
fetchComments () | |
Load comments linked with current task. | |
getNbComments () | |
Return nb comments already posted. | |
trimParameters ($parameters) | |
Trim object parameters. | |
getCategoriesCommon ($type_categ) | |
Sets object to given categories. | |
setCategoriesCommon ($categories, $type_categ='', $remove_existing=true) | |
Sets object to given categories. | |
cloneCategories ($fromId, $toId, $type='') | |
Copy related categories to another object. | |
deleteEcmFiles ($mode=0) | |
Delete related files of object in database. | |
Static Public Member Functions | |
static | isExistingObject ($element, $id, $ref='', $ref_ext='') |
Check if an object id or ref exists If you don't need or want to instantiate the object and just need to know if the object exists, use this method instead of fetch. | |
static | getAllItemsLinkedByObjectID ($fk_object_where, $field_select, $field_where, $table_element) |
Function used to get an array with all items linked to an object id in association table. | |
static | getCountOfItemsLinkedByObjectID ($fk_object_where, $field_where, $table_element) |
Count items linked to an object id in association table. | |
static | deleteAllItemsLinkedByObjectID ($fk_object_where, $field_where, $table_element) |
Function used to remove all items linked to an object id in association table. | |
static | commonReplaceThirdparty (DoliDB $dbs, $origin_id, $dest_id, array $tables, $ignoreerrors=0) |
Function used to replace a thirdparty id with another one. | |
static | commonReplaceProduct (DoliDB $dbs, $origin_id, $dest_id, array $tables, $ignoreerrors=0) |
Function used to replace a product id with another one. | |
Public Attributes | |
$origin_object | |
Protected Member Functions | |
deprecatedProperties () | |
Provide list of deprecated properties and replacements. | |
commonGenerateDocument ($modelspath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams=null) | |
Common function for all objects extending CommonObject for generating documents. | |
isArray ($info) | |
Function test if type is array. | |
canBeNull ($info) | |
Function test if field can be null. | |
isForcedToNullIfZero ($info) | |
Function test if field is forced to null if zero or empty. | |
isIndex ($info) | |
Function test if is indexed. | |
setSaveQuery () | |
Function to return the array of data key-value from the ->fields and all the ->properties of an object. | |
quote ($value, $fieldsentry) | |
Add quote to field value if necessary. | |
Parent class of all other business classes (invoices, contracts, proposals, orders, ...)
@phan-forbid-undeclared-magic-properties
Definition at line 49 of file commonobject.class.php.
CommonObject::__clone | ( | ) |
Overwrite magic function to solve problem of cloning object that are kept as references.
Definition at line 5650 of file commonobject.class.php.
CommonObject::add_contact | ( | $fk_socpeople, | |
$type_contact, | |||
$source = 'external', | |||
$notrigger = 0 ) |
Add a link between element $this->element and a contact.
int | $fk_socpeople | Id of thirdparty contact (if source = 'external') or id of user (if source = 'internal') to link |
int | string | $type_contact | Type of contact (code or id). Must be id or code found into table llx_c_type_contact. For example: SALESREPFOLL |
string | $source | external=Contact extern (llx_socpeople), internal=Contact intern (llx_user) |
int | $notrigger | Disable all triggers |
Definition at line 1235 of file commonobject.class.php.
References call_trigger(), dol_now(), dol_syslog(), and liste_contact().
Referenced by CommandeFournisseur\approve(), copy_linked_contact(), Commande\create(), Contrat\create(), Facture\create(), Ticket\create(), and Task\mergeContactTask().
CommonObject::add_element_resource | ( | $resource_id, | |
$resource_type, | |||
$busy = 0, | |||
$mandatory = 0 ) |
Add resources to the current object : add entry into llx_element_resources Need $this->element & $this->id.
int | $resource_id | Resource id |
string | $resource_type | 'resource' |
int | $busy | Busy or not |
int | $mandatory | Mandatory or not |
Definition at line 5573 of file commonobject.class.php.
References dol_syslog().
CommonObject::add_object_linked | ( | $origin = null, | |
$origin_id = null, | |||
$f_user = null, | |||
$notrigger = 0 ) |
Add an object link into llx_element_element.
string | $origin | Linked element type |
int | $origin_id | Linked element id |
User | $f_user | User that create |
int | $notrigger | 1=Does not execute triggers, 0=execute triggers |
Definition at line 4088 of file commonobject.class.php.
References dol_syslog().
Referenced by Asset\create(), Commande\create(), CommandeFournisseur\create(), Contrat\create(), Delivery\create(), Expedition\create(), Facture\create(), FactureFournisseur\create(), FactureFournisseurRec\create(), FactureRec\create(), Fichinter\create(), Propal\create(), Reception\create(), Subscription\create(), SupplierProposal\create(), and Asset\dispose().
CommonObject::addThumbs | ( | $file | ) |
Build thumb.
string | $file | Path file in UTF8 to original file to create thumbs from. |
Definition at line 5988 of file commonobject.class.php.
References dol_osencode(), getDefaultImageSizes(), and vignette().
Referenced by Categorie\add_photo(), and Product\add_photo().
CommonObject::call_trigger | ( | $triggerName, | |
$user ) |
Call trigger based on this instance.
Some context information may also be provided into array property this->context. NB: Error from trigger are stacked in interface->errors NB2: If return code of triggers are < 0, action calling trigger should cancel all transaction.
string | $triggerName | trigger's name to execute |
User | $user | Object user |
Reimplemented in EcmDirectory.
Definition at line 6096 of file commonobject.class.php.
References dol_print_error().
Referenced by MouvementStock\_create(), ContratLigne\active_line(), Societe\add_commercial(), add_contact(), Product\add_sousproduit(), Categorie\add_type(), Contrat\addline(), Tva\addPayment(), Paiement\addPaymentToBank(), User\addrights(), UserGroup\addrights(), Task\addTimeSpent(), CommandeFournisseur\approve(), Holiday\approve(), Partnership\approve(), Commande\availability(), Propal\availability(), CommandeFournisseur\Cancel(), Commande\cancel(), Expedition\cancel(), Commande\classifyBilled(), CommandeFournisseur\classifyBilled(), Propal\classifyBilled(), Commande\classifyUnBilled(), ContratLigne\close_line(), Propal\closeProposal(), Commande\cloture(), RecruitmentJobPosition\cloture(), SupplierProposal\cloture(), CommandeFournisseur\commande(), Account\create(), ActionComm\create(), Adherent\create(), AdherentType\create(), BonPrelevement\create(), Categorie\create(), ChargeSociales\create(), Commande\create(), CommandeFournisseur\create(), Comment\create(), CompanyBankAccount\create(), Contact\create(), Contrat\create(), Deplacement\create(), Dolresource\create(), Don\create(), EcmFiles\create(), Entrepot\create(), Expedition\create(), ExpeditionLineBatch\create(), ExpenseReport\create(), Facture\create(), FactureFournisseur\create(), FactureFournisseurRec\create(), FactureRec\create(), Fichinter\create(), Holiday\create(), Link\create(), Localtax\create(), Mailing\create(), MultiCurrency\create(), Opensurveysondage\create(), Paiement\create(), PaiementFourn\create(), PaymentDonation\create(), PaymentSalary\create(), PaymentSocialContribution\create(), PaymentVarious\create(), PaymentVAT\create(), Product\create(), ProductAttribute\create(), ProductAttributeValue\create(), ProductCustomerPrice\create(), Productlot\create(), Project\create(), Propal\create(), Reception\create(), ReceptionLineBatch\create(), Salary\create(), Societe\create(), Subscription\create(), SupplierProposal\create(), Task\create(), Ticket\create(), Tva\create(), User\create(), User\create_from_contact(), ActionComm\createFromClone(), Societe\del_commercial(), Product\del_sousproduit(), Categorie\del_type(), ActionComm\delete(), Adherent\delete(), AdherentType\delete(), BonPrelevement\delete(), Categorie\delete(), Commande\delete(), CommandeFournisseur\delete(), CommandeFournisseurLigne\delete(), Comment\delete(), CompanyBankAccount\delete(), Contact\delete(), Contrat\delete(), Delivery\delete(), Dolresource\delete(), Don\delete(), EcmFiles\delete(), Entrepot\delete(), Expedition\delete(), ExpeditionLigne\delete(), ExpenseReport\delete(), Facture\delete(), FactureFournisseur\delete(), FactureFournisseurLigneRec\delete(), FactureFournisseurRec\delete(), FactureLigne\delete(), FactureLigneRec\delete(), FactureRec\delete(), Fichinter\delete(), Holiday\delete(), Link\delete(), Localtax\delete(), Mailing\delete(), Opensurveysondage\delete(), OrderLine\delete(), Paiement\delete(), PaiementFourn\delete(), PaymentDonation\delete(), PaymentVarious\delete(), Product\delete(), ProductAttribute\delete(), ProductAttributeValue\delete(), ProductCustomerPrice\delete(), Project\delete(), Propal\delete(), PropaleLigne\delete(), Reception\delete(), ReceptionLineBatch\delete(), Societe\delete(), Subscription\delete(), SupplierInvoiceLine\delete(), SupplierProposal\delete(), SupplierProposalLine\delete(), Task\delete(), Tva\delete(), User\delete(), delete_contact(), Contrat\deleteLine(), ExpenseReport\deleteLine(), FichinterLigne\deleteLine(), AdherentType\delMultiLangs(), Product\delMultiLangs(), User\delrights(), UserGroup\delrights(), Task\delTimeSpent(), Commande\demand_reason(), Propal\demand_reason(), CommandeFournisseur\dispatchProduct(), Adherent\exclude(), CommandeFournisseurLigne\insert(), ContratLigne\insert(), ExpeditionLigne\insert(), ExpenseReportLine\insert(), FactureLigne\insert(), FichinterLigne\insert(), OrderLine\insert(), PropaleLigne\insert(), SupplierInvoiceLine\insert(), SupplierProposalLine\insert(), CommandeFournisseur\Livraison(), Societe\mergeCompany(), Task\mergeTask(), CommandeFournisseur\refuse(), ProductFournisseur\remove_product_fournisseur_price(), User\RemoveFromGroup(), Expedition\reOpen(), Reception\reOpen(), Contrat\reopen(), Propal\reopen(), SupplierProposal\reopen(), Adherent\resiliate(), Propal\set_availability(), ExpenseReport\set_cancel(), Commande\set_date(), Propal\set_date(), Propal\set_demand_reason(), Propal\set_echeance(), CommandeFournisseur\set_id_projet(), Commande\set_ref_client(), Facture\set_ref_client(), Propal\set_ref_client(), Commande\set_reopen(), Product\setAccountancyCode(), ExpenseReport\setApproved(), FactureRec\setAutoValidate(), Expedition\setBilled(), Reception\setBilled(), Propal\setCancel(), Facture\setCanceled(), FactureFournisseur\setCanceled(), Fichinter\setClose(), Project\setClose(), Expedition\setClosed(), Reception\setClosed(), Commande\setDeliveryDate(), CommandeFournisseur\setDeliveryDate(), Propal\setDeliveryDate(), ExpenseReport\setDeny(), Commande\setDiscount(), Facture\setDiscount(), Commande\setDraft(), Facture\setDraft(), FactureFournisseur\setDraft(), Fichinter\setDraft(), Propal\setDraft(), Reception\setDraft(), SupplierProposal\setDraft(), Facture\setFinal(), FactureRec\setFrequencyAndUnit(), FactureRec\setGeneratePdf(), User\SetInGroup(), FactureRec\setMaxPeriod(), FactureRec\setModelPdf(), AdherentType\setMultiLangs(), Categorie\setMultiLangs(), Product\setMultiLangs(), FactureRec\setNextDate(), ExpenseReport\setPaid(), Facture\setPaid(), FactureFournisseur\setPaid(), Adherent\setPassword(), User\setPassword(), Fichinter\setRefClient(), CommandeFournisseur\setStatus(), Contact\setstatus(), User\setstatus(), ExpenseReport\setUnpaid(), Facture\setUnpaid(), FactureFournisseur\setUnpaid(), Fichinter\setValid(), Project\setValid(), ExpenseReport\setValidate(), Account\update(), ActionComm\update(), Adherent\update(), AdherentType\update(), Categorie\update(), ChargeSociales\update(), Commande\update(), CommandeFournisseur\update(), CommandeFournisseurLigne\update(), Comment\update(), CompanyBankAccount\update(), Contact\update(), Contrat\update(), ContratLigne\update(), Dolresource\update(), Don\update(), EcmFiles\update(), Entrepot\update(), Expedition\update(), ExpeditionLigne\update(), ExpenseReport\update(), Facture\update(), FactureFournisseur\update(), FactureFournisseurLigneRec\update(), FactureFournisseurRec\update(), FactureLigne\update(), FactureLigneRec\update(), FactureRec\update(), Fichinter\update(), FichinterLigne\update(), Holiday\update(), Link\update(), Localtax\update(), Mailing\update(), Opensurveysondage\update(), OrderLine\update(), PaymentDonation\update(), PaymentVarious\update(), Product\update(), ProductAttribute\update(), ProductAttributeValue\update(), ProductCustomerPrice\update(), Productlot\update(), Project\update(), Propal\update(), PropaleLigne\update(), Reception\update(), ReceptionLineBatch\update(), Salary\update(), Societe\update(), Subscription\update(), SupplierInvoiceLine\update(), SupplierProposalLine\update(), Task\update(), Tva\update(), User\update(), UserBankAccount\update(), ProductFournisseur\update_buyprice(), Contact\update_perso(), Product\update_sousproduit(), AssetAccountancyCodes\updateAccountancyCodes(), AssetDepreciationOptions\updateDeprecationOptions(), Dolresource\updateElementResource(), Contrat\updateline(), ExpenseReport\updateline(), Product\updatePrice(), Task\updateTimeSpent(), CashControl\valid(), Commande\valid(), CommandeFournisseur\valid(), Delivery\valid(), Expedition\valid(), Propal\valid(), Reception\valid(), SupplierProposal\valid(), Don\valid_promesse(), Adherent\validate(), AssetModel\validate(), Availabilities\validate(), BOM\validate(), Calendar\validate(), ConferenceOrBooth\validate(), ConferenceOrBoothAttendee\validate(), Contrat\validate(), Evaluation\validate(), EvaluationLine\validate(), Facture\validate(), FactureFournisseur\validate(), Holiday\validate(), Job\validate(), KnowledgeRecord\validate(), Mo\validate(), MyObject\validate(), Partnership\validate(), Position\validate(), ProductFournisseurPrice\validate(), RecruitmentCandidature\validate(), RecruitmentJobPosition\validate(), Skill\validate(), Skilldet\validate(), SkillRank\validate(), StockTransfer\validate(), StockTransferLine\validate(), Target\validate(), and TimeSpent\validate().
|
protected |
Function test if field can be null.
array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string} | $info content information of field |
Definition at line 9781 of file commonobject.class.php.
CommonObject::clearFieldError | ( | $fieldKey | ) |
clear validation message result for a field
string | $fieldKey | Key of attribute to clear |
Definition at line 8608 of file commonobject.class.php.
CommonObject::clearObjectLinkedCache | ( | ) |
Clear the cache saying that all linked object were already loaded.
So next fetchObjectLinked will reload all links.
Definition at line 4352 of file commonobject.class.php.
CommonObject::cloneCategories | ( | $fromId, | |
$toId, | |||
$type = '' ) |
Copy related categories to another object.
int | $fromId | Id object source |
int | $toId | Id object cible |
string | $type | Type of category ('product', ...) |
Definition at line 11027 of file commonobject.class.php.
|
protected |
Common function for all objects extending CommonObject for generating documents.
string | $modelspath | Relative folder where generators are placed |
string | $modele | Generator to use. Caller must set it to from obj->model_pdf or from GETPOST for example. |
Translate | $outputlangs | Output language to use |
int<0,1> | $hidedetails 1 to hide details. 0 by default | |
int<0,1> | $hidedesc 1 to hide product description. 0 by default | |
int<0,1> | $hideref 1 to hide product reference. 0 by default | |
?array<string,mixed> | $moreparams Array to provide more information |
Definition at line 5676 of file commonobject.class.php.
References dol_buildpath(), dol_delete_preview(), dol_dir_list(), dol_is_file(), dol_meta_create(), dol_sanitizeFileName(), dol_sanitizePathName(), dol_syslog(), and getDolGlobalString().
Referenced by Adherent\generateDocument(), Availabilities\generateDocument(), BOM\generateDocument(), Calendar\generateDocument(), Commande\generateDocument(), CommandeFournisseur\generateDocument(), ConferenceOrBooth\generateDocument(), ConferenceOrBoothAttendee\generateDocument(), Contrat\generateDocument(), Delivery\generateDocument(), Entrepot\generateDocument(), Evaluation\generateDocument(), EvaluationLine\generateDocument(), Expedition\generateDocument(), ExpenseReport\generateDocument(), Facture\generateDocument(), FactureFournisseur\generateDocument(), Fichinter\generateDocument(), Job\generateDocument(), KnowledgeRecord\generateDocument(), Mo\generateDocument(), MouvementStock\generateDocument(), MyObject\generateDocument(), PaiementFourn\generateDocument(), Partnership\generateDocument(), Position\generateDocument(), Product\generateDocument(), ProductFournisseurPrice\generateDocument(), Productlot\generateDocument(), Project\generateDocument(), Propal\generateDocument(), Reception\generateDocument(), RecruitmentCandidature\generateDocument(), RecruitmentJobPosition\generateDocument(), Skill\generateDocument(), Skilldet\generateDocument(), SkillRank\generateDocument(), Societe\generateDocument(), StockTransfer\generateDocument(), StockTransferLine\generateDocument(), SupplierProposal\generateDocument(), Target\generateDocument(), Task\generateDocument(), TimeSpent\generateDocument(), User\generateDocument(), UserGroup\generateDocument(), and Workstation\generateDocument().
|
static |
Function used to replace a product id with another one.
This function is meant to be called from replaceProduct with the appropriate tables Column name fk_product MUST be used to identify products
DoliDB | $dbs | Database handler |
int | $origin_id | Old product id (the product to delete) |
int | $dest_id | New product id (the product that will received element of the other) |
string[] | $tables | Tables that need to be changed |
int<0,1> | $ignoreerrors Ignore errors. Return true even if errors. We need this when replacement can fails like for categories (categorie of old product may already exists on new one) |
Definition at line 9327 of file commonobject.class.php.
References Database\query().
Referenced by BOM\replaceProduct(), Commande\replaceProduct(), CommandeFournisseur\replaceProduct(), Contrat\replaceProduct(), Delivery\replaceProduct(), Facture\replaceProduct(), FactureFournisseur\replaceProduct(), FactureRec\replaceProduct(), FichinterRec\replaceProduct(), ProductFournisseur\replaceProduct(), Propal\replaceProduct(), Reception\replaceProduct(), and SupplierProposal\replaceProduct().
|
static |
Function used to replace a thirdparty id with another one.
This function is meant to be called from replaceThirdparty with the appropriate tables Column name fk_soc MUST exist.
DoliDB | $dbs | Database handler |
int | $origin_id | Old thirdparty id (the thirdparty to delete) |
int | $dest_id | New thirdparty id (the thirdparty that will received element of the other) |
string[] | $tables | Tables that need to be changed |
int<0,1> | $ignoreerrors Ignore errors. Return true even if errors. We need this when replacement can fails like for categories (categorie of old thirdparty may already exists on new one) |
Definition at line 9298 of file commonobject.class.php.
References Database\query().
Referenced by ActionComm\replaceThirdparty(), Adherent\replaceThirdparty(), Bookmark\replaceThirdparty(), Categorie\replaceThirdparty(), Commande\replaceThirdparty(), CommandeFournisseur\replaceThirdparty(), ConferenceOrBoothAttendee\replaceThirdparty(), Contact\replaceThirdparty(), Contrat\replaceThirdparty(), Delivery\replaceThirdparty(), Don\replaceThirdparty(), Expedition\replaceThirdparty(), Facture\replaceThirdparty(), FactureFournisseur\replaceThirdparty(), FactureFournisseurRec\replaceThirdparty(), FactureRec\replaceThirdparty(), Fichinter\replaceThirdparty(), FichinterRec\replaceThirdparty(), Fournisseur\replaceThirdparty(), LignePrelevement\replaceThirdparty(), Mo\replaceThirdparty(), Partnership\replaceThirdparty(), Product\replaceThirdparty(), ProductFournisseur\replaceThirdparty(), Project\replaceThirdparty(), Propal\replaceThirdparty(), Reception\replaceThirdparty(), Societe\replaceThirdparty(), SupplierProposal\replaceThirdparty(), Ticket\replaceThirdparty(), and User\replaceThirdparty().
CommonObject::copy_linked_contact | ( | $objFrom, | |
$source = 'internal' ) |
Copy contact from one element to current.
CommonObject | $objFrom | Source element |
'internal'|'external' | $source Nature of contact ('internal' or 'external') |
Definition at line 1343 of file commonobject.class.php.
References add_contact().
Referenced by AssetModel\createFromClone(), Availabilities\createFromClone(), BOM\createFromClone(), Calendar\createFromClone(), Commande\createFromClone(), ConferenceOrBoothAttendee\createFromClone(), CTicketCategory\createFromClone(), Evaluation\createFromClone(), EvaluationLine\createFromClone(), Job\createFromClone(), KnowledgeRecord\createFromClone(), Mo\createFromClone(), MyObject\createFromClone(), Partnership\createFromClone(), Position\createFromClone(), ProductFournisseurPrice\createFromClone(), RecruitmentCandidature\createFromClone(), RecruitmentJobPosition\createFromClone(), Skill\createFromClone(), Skilldet\createFromClone(), SkillRank\createFromClone(), StockTransfer\createFromClone(), StockTransferLine\createFromClone(), TimeSpent\createFromClone(), and Workstation\createFromClone().
CommonObject::createCommon | ( | User | $user, |
$notrigger = 0 ) |
Create object in the database.
User | $user | User that creates |
int<0,1> | $notrigger 0=launch triggers after, 1=disable triggers |
Definition at line 10031 of file commonobject.class.php.
References dol_hash(), dol_now(), dol_string_nospecial(), dol_syslog(), and ref.
Referenced by ActionCommReminder\create(), Asset\create(), AssetModel\create(), Availabilities\create(), BOM\create(), BOMLine\create(), Calendar\create(), CompanyPaymentMode\create(), ConferenceOrBoothAttendee\create(), CTicketCategory\create(), DefaultValues\create(), EmailCollector\create(), EmailCollectorAction\create(), EmailCollectorFilter\create(), EmailSenderProfile\create(), Evaluation\create(), EvaluationLine\create(), ExpenseReportIk\create(), ExpenseReportRule\create(), Hook\create(), Inventory\create(), InventoryLine\create(), Job\create(), KnowledgeRecord\create(), Mo\create(), MoLine\create(), MyObject\create(), Partnership\create(), PartnershipType\create(), Position\create(), ProductFournisseurPrice\create(), RecruitmentCandidature\create(), RecruitmentJobPosition\create(), Skill\create(), Skilldet\create(), SkillRank\create(), SocieteAccount\create(), StockTransfer\create(), StockTransferLine\create(), Target\create(), TimeSpent\create(), UserGroup\create(), WebsitePage\create(), Workstation\create(), and AssetDepreciationOptions\updateDeprecationOptions().
CommonObject::defineBuyPrice | ( | $unitPrice = 0.0, | |
$discountPercent = 0.0, | |||
$fk_product = 0 ) |
Get buy price to use for margin calculation.
This function is called when buy price is unknown. Set buy price = sell price if ForceBuyingPriceIfNull configured, elseif calculation MARGIN_TYPE = 'costprice' and costprice is defined, use costprice as buyprice elseif calculation MARGIN_TYPE = 'pmp' and pmp is calculated, use pmp as buyprice else set min buy price as buy price
float | $unitPrice | Product unit price |
float | $discountPercent | Line discount percent |
int | $fk_product | Product id |
Definition at line 9356 of file commonobject.class.php.
References getDolGlobalInt(), and getDolGlobalString().
Referenced by Contrat\addline(), FactureLigne\insert(), OrderLine\insert(), PropaleLigne\insert(), SupplierProposalLine\insert(), ContratLigne\update(), FactureLigne\update(), OrderLine\update(), PropaleLigne\update(), SupplierProposalLine\update(), and Contrat\updateline().
CommonObject::delete_contact | ( | $rowid, | |
$notrigger = 0 ) |
Delete a link to contact line.
int | $rowid | Id of contact link line to delete |
int | $notrigger | Disable all triggers |
Definition at line 1395 of file commonobject.class.php.
References call_trigger(), and dol_syslog().
CommonObject::delete_linked_contact | ( | $source = '', | |
$code = '' ) |
Delete all links between an object $this and all its contacts in llx_element_contact.
string | $source | '' or 'internal' or 'external' |
string | $code | Type of contact (code or id) |
Definition at line 1445 of file commonobject.class.php.
References dol_syslog(), and liste_type_contact().
Referenced by Commande\delete(), Contrat\delete(), ExpenseReport\delete(), Facture\delete(), Fichinter\delete(), Project\delete(), Propal\delete(), and Task\delete().
CommonObject::delete_resource | ( | $rowid, | |
$element, | |||
$notrigger = 0 ) |
Delete a link to resource line.
int | $rowid | Id of resource line to delete |
string | $element | element name (for trigger) TODO: use $this->element into commonobject class |
int | $notrigger | Disable all triggers |
Definition at line 5614 of file commonobject.class.php.
References dol_syslog().
|
static |
Function used to remove all items linked to an object id in association table.
int | $fk_object_where | id of object we need to remove linked items |
string | $field_where | name of field of object we need to delete linked items |
string | $table_element | name of association table |
Definition at line 4583 of file commonobject.class.php.
CommonObject::deleteByParentField | ( | $parentId = 0, | |
$parentField = '', | |||
$filter = '', | |||
$filtermode = "AND" ) |
Delete all child object from a parent ID.
int | $parentId | Parent Id |
string | $parentField | Name of Foreign key parent column |
string | $filter | Filter as an Universal Search string. Example: '((client:=:1) OR ((client:>=:2) AND (client:<=:3))) AND (client:!=:8) AND (nom:like:'a')' |
string | $filtermode | No more used |
Exception |
Definition at line 10596 of file commonobject.class.php.
References dol_syslog(), and forgeSQLFromUniversalSearchCriteria().
CommonObject::deleteCommon | ( | User | $user, |
$notrigger = 0, | |||
$forcechilddeletion = 0 ) |
Delete object in database.
User | $user | User that deletes |
int<0,1> | $notrigger 0=launch triggers after, 1=disable triggers | |
int<0,1> | $forcechilddeletion 0=no, 1=Force deletion of children |
Definition at line 10456 of file commonobject.class.php.
References dol_include_once(), and dol_syslog().
Referenced by ActionCommReminder\delete(), Asset\delete(), AssetModel\delete(), Availabilities\delete(), BOM\delete(), BOMLine\delete(), Calendar\delete(), CashControl\delete(), CompanyPaymentMode\delete(), ConferenceOrBoothAttendee\delete(), CTicketCategory\delete(), DefaultValues\delete(), EmailCollector\delete(), EmailCollectorAction\delete(), EmailCollectorFilter\delete(), EmailSenderProfile\delete(), Evaluation\delete(), EvaluationLine\delete(), ExpenseReportIk\delete(), ExpenseReportRule\delete(), Hook\delete(), Inventory\delete(), InventoryLine\delete(), Job\delete(), KnowledgeRecord\delete(), Mo\delete(), MoLine\delete(), MouvementStock\delete(), MyObject\delete(), Partnership\delete(), PartnershipType\delete(), Position\delete(), ProductFournisseurPrice\delete(), RecruitmentCandidature\delete(), RecruitmentJobPosition\delete(), Salary\delete(), Skill\delete(), Skilldet\delete(), SkillRank\delete(), SocieteAccount\delete(), StockTransfer\delete(), StockTransferLine\delete(), Target\delete(), TimeSpent\delete(), UserGroup\delete(), Website\delete(), WebsitePage\delete(), and Workstation\delete().
CommonObject::deleteEcmFiles | ( | $mode = 0 | ) |
Delete related files of object in database.
integer | $mode | 0=Use path to find record, 1=Use src_object_xxx fields (Mode 1 is recommended for new objects) |
Definition at line 11058 of file commonobject.class.php.
References ref.
Referenced by Commande\delete(), CommandeFournisseur\delete(), Don\delete(), Expedition\delete(), ExpenseReport\delete(), Facture\delete(), FactureFournisseur\delete(), Fichinter\delete(), Product\delete(), Propal\delete(), and SupplierProposal\delete().
CommonObject::deleteExtraFields | ( | ) |
Delete all extra fields values for the current object.
Definition at line 6450 of file commonobject.class.php.
References dol_syslog(), and getDolGlobalString().
Referenced by Account\delete(), ActionComm\delete(), Adherent\delete(), Categorie\delete(), Commande\delete(), CommandeFournisseur\delete(), CommandeFournisseurLigne\delete(), Contact\delete(), Contrat\delete(), Dolresource\delete(), EcmFiles\delete(), Entrepot\delete(), Expedition\delete(), ExpeditionLigne\delete(), ExpenseReport\delete(), Facture\delete(), FactureFournisseur\delete(), FactureFournisseurLigneRec\delete(), FactureFournisseurRec\delete(), FactureLigne\delete(), FactureLigneRec\delete(), FactureRec\delete(), Fichinter\delete(), OrderLine\delete(), Product\delete(), Propal\delete(), PropaleLigne\delete(), ReceptionLineBatch\delete(), Societe\delete(), SupplierInvoiceLine\delete(), SupplierProposal\delete(), SupplierProposalLine\delete(), User\delete(), and FichinterLigne\deleteLine().
CommonObject::deleteLineCommon | ( | User | $user, |
$idline, | |||
$notrigger = 0 ) |
Delete a line of object in database.
User | $user | User that delete |
int | $idline | Id of line to delete |
int | $notrigger | 0=launch triggers after, 1=disable triggers |
Definition at line 10661 of file commonobject.class.php.
References dol_syslog().
Referenced by Mo\cancelConsumedAndProducedLines(), Availabilities\deleteLine(), Calendar\deleteLine(), ConferenceOrBoothAttendee\deleteLine(), CTicketCategory\deleteLine(), Evaluation\deleteLine(), EvaluationLine\deleteLine(), Inventory\deleteLine(), Job\deleteLine(), KnowledgeRecord\deleteLine(), Mo\deleteLine(), MyObject\deleteLine(), Partnership\deleteLine(), Position\deleteLine(), RecruitmentCandidature\deleteLine(), RecruitmentJobPosition\deleteLine(), Skill\deleteLine(), Skilldet\deleteLine(), SkillRank\deleteLine(), StockTransfer\deleteLine(), StockTransferLine\deleteLine(), Target\deleteLine(), TimeSpent\deleteLine(), and Workstation\deleteLine().
CommonObject::deleteObjectLinked | ( | $sourceid = null, | |
$sourcetype = '', | |||
$targetid = null, | |||
$targettype = '', | |||
$rowid = 0, | |||
$f_user = null, | |||
$notrigger = 0 ) |
Delete all links between an object $this.
int | $sourceid | Object source id |
string | $sourcetype | Object source type |
int | $targetid | Object target id |
string | $targettype | Object target type |
int | $rowid | Row id of line to delete. If defined, other parameters are not used. |
User | $f_user | User that create |
int | $notrigger | 1=Does not execute triggers, 0= execute triggers |
Definition at line 4443 of file commonobject.class.php.
References dol_syslog().
Referenced by Expedition\cancel(), Commande\delete(), CommandeFournisseur\delete(), Contrat\delete(), Delivery\delete(), Expedition\delete(), ExpenseReport\delete(), Facture\delete(), FactureFournisseur\delete(), FactureFournisseurRec\delete(), FactureRec\delete(), Fichinter\delete(), Propal\delete(), Reception\delete(), SupplierInvoiceLine\delete(), SupplierProposal\delete(), and Asset\reopen().
CommonObject::delThumbs | ( | $file | ) |
Delete thumbs.
string | $file | Path file in UTF8 to original file to delete thumbs. |
Definition at line 6020 of file commonobject.class.php.
References dol_delete_file(), and getImageFileNameForSize().
|
protected |
Provide list of deprecated properties and replacements.
Definition at line 875 of file commonobject.class.php.
CommonObject::emtpyObjectVars | ( | ) |
Sets all object fields to null.
Useful for example in lists, when printing multiple lines and a different object os fetched for each line.
Definition at line 9964 of file commonobject.class.php.
CommonObject::errorsToString | ( | ) |
Method to output saved errors.
Definition at line 1058 of file commonobject.class.php.
Referenced by ProductAttribute\addLine(), ProductAttribute\countChildProducts(), ProductAttribute\countChildValues(), ProductAttribute\create(), ProductAttributeValue\create(), ProductAttribute\delete(), ProductAttributeValue\delete(), ProductAttribute\fetch(), ProductAttributeValue\fetch(), ProductAttribute\fetch_lines(), AssetAccountancyCodes\fetchAccountancyCodes(), AssetDepreciationOptions\fetchDeprecationOptions(), ProductAttribute\isUsed(), ProductAttributeValue\isUsed(), ProductAttribute\update(), ProductAttributeValue\update(), AssetAccountancyCodes\updateAccountancyCodes(), and AssetDepreciationOptions\updateDeprecationOptions().
CommonObject::fetch_barcode | ( | ) |
Load data for barcode into properties ->barcode_type* Properties ->barcode_type that is id of barcode.
Type is used to find other properties, but if it is not defined, ->element must be defined to know default barcode type.
Definition at line 1942 of file commonobject.class.php.
References dol_print_error(), dol_syslog(), and getDolGlobalString().
CommonObject::fetch_contact | ( | $contactid = null | ) |
Load object contact with id=$this->contact_id into $this->contact.
?int | $contactid | Id du contact. Use this->contact_id if empty. |
Definition at line 1839 of file commonobject.class.php.
CommonObject::fetch_optionals | ( | $rowid = null, | |
$optionsArray = null ) |
Function to get extra fields of an object into $this->array_options This method is in most cases called by method fetch of objects but you can call it separately.
int | $rowid | Id of line. Use the id of object if not defined. Deprecated. Function must be called without parameters. |
array{}|array{label:array<string,string>,type:array<string,string>,size:array<string,string>,default:array<string,string>,computed:array<string,string>,unique:array<string,int>,required:array<string,int>,param:array<string,mixed>,perms:array<string,mixed[]>,list:array<string,int>|array<string,string>,pos:array<string,int>,totalizable:array<string,int>,help:array<string,string>,printable:array<string,int>,enabled:array<string,int>,langfile:array<string,string>,css:array<string,string>,csslist:array<string,string>,hidden:array<string,int>,mandatoryfieldsofotherentities?:array<string,string>,loaded?:int,count:int} | $optionsArray Array resulting of call of extrafields->fetch_name_optionals_label(). Deprecated. Function must be called without parameters. |
We are in a situation where the current object has no values in its extra fields. We want to initialize all the values to null so that the array_option is accessible in other contexts (especially in document generation).
Definition at line 6311 of file commonobject.class.php.
References dol_eval(), dol_syslog(), dolDecrypt(), and rowid.
Referenced by ActionComm\createFromClone(), Facture\createFromCurrent(), Account\fetch(), ActionComm\fetch(), Adherent\fetch(), AdherentType\fetch(), Categorie\fetch(), Commande\fetch(), CommandeFournisseur\fetch(), CommandeFournisseurLigne\fetch(), Contact\fetch(), Contrat\fetch(), ContratLigne\fetch(), Delivery\fetch(), Dolresource\fetch(), Don\fetch(), EcmDirectory\fetch(), EcmFiles\fetch(), Entrepot\fetch(), Expedition\fetch(), Facture\fetch(), FactureFournisseur\fetch(), FactureFournisseurRec\fetch(), FactureLigne\fetch(), FactureRec\fetch(), Fichinter\fetch(), FichinterLigne\fetch(), Holiday\fetch(), MouvementStock\fetch(), OrderLine\fetch(), Partnership\fetch(), Product\fetch(), Productlot\fetch(), ProductStockEntrepot\fetch(), Project\fetch(), Propal\fetch(), PropaleLigne\fetch(), Reception\fetch(), ReceptionLineBatch\fetch(), Salary\fetch(), Societe\fetch(), SupplierInvoiceLine\fetch(), SupplierProposal\fetch(), Task\fetch(), Ticket\fetch(), and User\fetch().
CommonObject::fetch_origin | ( | ) |
Read linked origin object.
Set ->origin_object
Definition at line 2068 of file commonobject.class.php.
Referenced by Expedition\cancel(), Expedition\delete(), Reception\delete(), Expedition\generateDocument(), Reception\generateDocument(), Reception\getStatusDispatch(), and Reception\setDraft().
CommonObject::fetch_product | ( | ) |
Load the product with id $this->fk_product into this->product.
Definition at line 2027 of file commonobject.class.php.
Referenced by Productlot\checkSellOrEatByMandatory(), BOM\validate(), and Mo\validate().
CommonObject::fetch_project | ( | ) |
Load the project with id $this->fk_project into this->project.
Definition at line 1989 of file commonobject.class.php.
Referenced by Commande\getTooltipContentArray(), Contrat\getTooltipContentArray(), and Propal\getTooltipContentArray().
CommonObject::fetch_projet | ( | ) |
Load the project with id $this->fk_project into this->project.
Reimplemented in ConferenceOrBoothAttendee.
Definition at line 2001 of file commonobject.class.php.
CommonObject::fetch_thirdparty | ( | $force_thirdparty_id = 0 | ) |
Load the third party of object, from id $this->socid or $this->fk_soc, into this->thirdparty.
int<0,1> | $force_thirdparty_id Force thirdparty id |
Reimplemented in Paiement, and PaiementFourn.
Definition at line 1865 of file commonobject.class.php.
References getDolGlobalString().
Referenced by Propal\create(), SupplierProposal\create(), Expedition\fetch(), Reception\fetch(), Commande\getTooltipContentArray(), CommandeFournisseur\getTooltipContentArray(), Contrat\getTooltipContentArray(), Expedition\getTooltipContentArray(), Propal\getTooltipContentArray(), CommonInvoice\is_erasable(), CommonInvoice\makeStripeSepaRequest(), Contrat\reopen(), StockTransfer\update(), SupplierProposal\updateOrCreatePriceFournisseur(), Contrat\validate(), Facture\validate(), and FactureFournisseur\validate().
CommonObject::fetch_user | ( | $userid | ) |
Load the user with id $userid into this->user.
int | $userid | Id du contact |
Definition at line 2052 of file commonobject.class.php.
References user.
CommonObject::fetchComments | ( | ) |
Load comments linked with current task.
Definition at line 10874 of file commonobject.class.php.
CommonObject::fetchCommon | ( | $id, | |
$ref = null, | |||
$morewhere = '', | |||
$noextrafields = 0 ) |
Load object in memory from the database.
This does not load line. This is done by parent fetch() that call fetchCommon
int | $id | Id object |
string | $ref | Ref |
string | $morewhere | More SQL filters (' AND ...') |
int<0,1> | $noextrafields 0=Default to load extrafields, 1=No extrafields |
Definition at line 10221 of file commonobject.class.php.
Referenced by ActionCommReminder\fetch(), Asset\fetch(), AssetModel\fetch(), Availabilities\fetch(), BOM\fetch(), BOMLine\fetch(), Calendar\fetch(), CashControl\fetch(), CompanyPaymentMode\fetch(), ConferenceOrBoothAttendee\fetch(), CTicketCategory\fetch(), DefaultValues\fetch(), EmailCollector\fetch(), EmailCollectorAction\fetch(), EmailCollectorFilter\fetch(), EmailSenderProfile\fetch(), Evaluation\fetch(), EvaluationLine\fetch(), ExpenseReportIk\fetch(), ExpenseReportRule\fetch(), Hook\fetch(), Inventory\fetch(), InventoryLine\fetch(), Job\fetch(), KnowledgeRecord\fetch(), Mo\fetch(), MoLine\fetch(), MyObject\fetch(), PartnershipType\fetch(), Position\fetch(), ProductFournisseurPrice\fetch(), RecruitmentCandidature\fetch(), RecruitmentJobPosition\fetch(), Skill\fetch(), Skilldet\fetch(), SkillRank\fetch(), SocieteAccount\fetch(), StockTransfer\fetch(), StockTransferLine\fetch(), Target\fetch(), TimeSpent\fetch(), UserGroup\fetch(), Workstation\fetch(), and AssetDepreciationOptions\fetchDeprecationOptions().
CommonObject::fetchLinesCommon | ( | $morewhere = '', | |
$noextrafields = 0 ) |
Load object in memory from the database.
string | $morewhere | More SQL filters (' AND ...') |
int<0,1> | $noextrafields 0=Default to load extrafields, 1=No extrafields |
Definition at line 10285 of file commonobject.class.php.
Referenced by Availabilities\fetchLines(), BOM\fetchLines(), Calendar\fetchLines(), ConferenceOrBoothAttendee\fetchLines(), CTicketCategory\fetchLines(), Evaluation\fetchLines(), EvaluationLine\fetchLines(), Job\fetchLines(), KnowledgeRecord\fetchLines(), Mo\fetchLines(), MyObject\fetchLines(), Partnership\fetchLines(), Position\fetchLines(), RecruitmentCandidature\fetchLines(), RecruitmentJobPosition\fetchLines(), Skilldet\fetchLines(), SkillRank\fetchLines(), StockTransfer\fetchLines(), StockTransferLine\fetchLines(), Target\fetchLines(), and Workstation\fetchLines().
CommonObject::fetchNoCompute | ( | $id | ) |
Function to make a fetch but set environment to avoid to load computed values before.
int | $id | ID of object |
Definition at line 6287 of file commonobject.class.php.
CommonObject::fetchObjectFrom | ( | $table, | |
$field, | |||
$key, | |||
$element = null ) |
Load object from specific field.
string | $table | Table element or element line |
string | $field | Field selected |
string | $key | Import key |
string | $element | Element name |
Definition at line 2099 of file commonobject.class.php.
References dol_syslog().
CommonObject::fetchObjectLinked | ( | $sourceid = null, | |
$sourcetype = '', | |||
$targetid = null, | |||
$targettype = '', | |||
$clause = 'OR', | |||
$alsosametype = 1, | |||
$orderby = 'sourcetype', | |||
$loadalsoobjects = 1 ) |
Fetch array of objects linked to current object (object of enabled modules only).
Links are loaded into this->linkedObjectsIds array + this->linkedObjects array if $loadalsoobjects = 1 or $loadalsoobjects = type Possible usage for parameters:
?int | $sourceid | Object source id (if not defined, $this->id) |
string | $sourcetype | Object source type (if not defined, $this->element) |
?int | $targetid | Object target id (if not defined, $this->id) |
string | $targettype | Object target type (if not defined, $this->element) |
string | $clause | 'OR' or 'AND' clause used when both source id and target id are provided |
int<0,1> | $alsosametype 0=Return only links to object that differs from source type. 1=Include also link to objects of same type. | |
string | $orderby | SQL 'ORDER BY' clause |
int<0,1>|string | $loadalsoobjects Load also the array $this->linkedObjects. Use 0 to not load (increase performances), Use 1 to load all, Use value of type ('facture', 'facturerec', ...) to load only a type of object. |
Definition at line 4200 of file commonobject.class.php.
References $object, dol_include_once(), dol_print_error(), dol_syslog(), and getElementProperties().
Referenced by Expedition\cancel(), Facture\createFromCurrent(), CommandeFournisseur\delete(), Expedition\delete(), Delivery\getRemainingDelivered(), and Propal\InvoiceArrayList().
CommonObject::fetchOneLike | ( | $ref | ) |
Looks for an object with ref matching the wildcard provided It does only work when $this->table_ref_field is set.
string | $ref | Wildcard |
Definition at line 1906 of file commonobject.class.php.
References dol_syslog().
CommonObject::fetchValuesForExtraLanguages | ( | ) |
Function to get alternative languages of a data into $this->array_languages This method is NOT called by method fetch of objects but must be called separately.
Definition at line 6135 of file commonobject.class.php.
References dol_print_error().
Referenced by WebPortalMember\getBannerAddressForWebPortal().
CommonObject::formAddObjectLine | ( | $dateSelector, | |
$seller, | |||
$buyer, | |||
$defaulttpldir = '/core/tpl' ) |
Show add free and predefined products/services form.
int | $dateSelector | 1=Show also date range input fields |
Societe | $seller | Object thirdparty who sell |
Societe | $buyer | Object thirdparty who buy |
string | $defaulttpldir | Directory where to find the template |
Reimplemented in ProductAttribute.
Definition at line 5104 of file commonobject.class.php.
References $object, and dol_buildpath().
|
static |
Function used to get an array with all items linked to an object id in association table.
int | $fk_object_where | id of object we need to get linked items |
string | $field_select | name of field we need to get a list |
string | $field_where | name of field of object we need to get linked items |
string | $table_element | name of association table |
Definition at line 4522 of file commonobject.class.php.
References dol_syslog().
CommonObject::getCanvas | ( | $id = 0, | |
$ref = '' ) |
Load type of canvas of an object if it exists.
int | $id | Record id |
string | $ref | Record ref |
Definition at line 4742 of file commonobject.class.php.
References dol_print_error(), and getDolGlobalString().
CommonObject::getCategoriesCommon | ( | $type_categ | ) |
Sets object to given categories.
Deletes object from existing categories not supplied. Adds it to non existing supplied categories. Existing categories are left untouch.
string | $type_categ | Category type ('customer', 'supplier', 'website_page', ...) |
Definition at line 10929 of file commonobject.class.php.
CommonObject::getChildrenOfLine | ( | $id, | |
$includealltree = 0 ) |
Get children of line.
int | $id | Id of parent line |
int<0,1> | $includealltree 0 = 1st level child, 1 = All level child |
Definition at line 3363 of file commonobject.class.php.
References dol_syslog().
|
static |
Count items linked to an object id in association table.
int | $fk_object_where | id of object we need to get linked items |
string | $field_where | name of field of object we need to get linked items |
string | $table_element | name of association table |
Definition at line 4554 of file commonobject.class.php.
CommonObject::getDataToShowPhoto | ( | $modulepart, | |
$imagesize ) |
Function used to get the logos or photos of an object.
string | $modulepart | Module part |
string | $imagesize | Image size ('', 'mini' or 'small') |
Definition at line 9417 of file commonobject.class.php.
CommonObject::getDefaultCreateValueFor | ( | $fieldname, | |
$alternatevalue = null, | |||
$type = 'alphanohtml' ) |
Return the default value to use for a field when showing the create form of object.
Return values in this order: 1) If parameter is available into POST, we return it first. 2) If not but an alternate value was provided as parameter of function, we return it. 3) If not but a constant $conf->global->OBJECTELEMENT_FIELDNAME is set, we return it (It is better to use the dedicated table). 4) Return value found into database (TODO No yet implemented)
string | $fieldname | Name of field |
string | $alternatevalue | Alternate value to use |
string | $type | Type of data |
Definition at line 6046 of file commonobject.class.php.
References dol_syslog(), getDolGlobalString(), and GETPOST().
CommonObject::getElementType | ( | ) |
Return an element type string formatted like element_element target_type and source_type.
Definition at line 4168 of file commonobject.class.php.
CommonObject::getExtraField | ( | $key | ) |
Convenience method for retrieving the value of an extrafield without actually fetching it from the database.
string | $key | Name of the extrafield |
Definition at line 7240 of file commonobject.class.php.
CommonObject::getFieldError | ( | $fieldKey | ) |
get field error message
string | $fieldKey | Key of attribute |
Definition at line 8637 of file commonobject.class.php.
CommonObject::getFieldList | ( | $alias = '', | |
$excludefields = array() ) |
Function to concat keys of fields.
string | $alias | String of alias of table for fields. For example 't'. It is recommended to use '' and set alias into fields definition. |
string[] | $excludefields | Array of fields to exclude |
Definition at line 9978 of file commonobject.class.php.
Referenced by Asset\fetchAll(), AssetModel\fetchAll(), Availabilities\fetchAll(), BOM\fetchAll(), BOMLine\fetchAll(), Calendar\fetchAll(), ConferenceOrBooth\fetchAll(), ConferenceOrBoothAttendee\fetchAll(), CTicketCategory\fetchAll(), DefaultValues\fetchAll(), Evaluation\fetchAll(), EvaluationLine\fetchAll(), Job\fetchAll(), KnowledgeRecord\fetchAll(), Mo\fetchAll(), MoLine\fetchAll(), MyObject\fetchAll(), Opensurveysondage\fetchAll(), Partnership\fetchAll(), PartnershipType\fetchAll(), Position\fetchAll(), ProductFournisseurPrice\fetchAll(), RecruitmentCandidature\fetchAll(), RecruitmentJobPosition\fetchAll(), Skill\fetchAll(), Skilldet\fetchAll(), SkillRank\fetchAll(), StockTransfer\fetchAll(), StockTransferLine\fetchAll(), Target\fetchAll(), TimeSpent\fetchAll(), and Workstation\fetchAll().
CommonObject::getFormatedCustomerRef | ( | $objref | ) |
Return customer ref for screen output.
string | $objref | Customer ref |
Definition at line 1070 of file commonobject.class.php.
CommonObject::getFormatedSupplierRef | ( | $objref | ) |
Return supplier ref for screen output.
string | $objref | Supplier ref |
Definition at line 1089 of file commonobject.class.php.
CommonObject::getFullAddress | ( | $withcountry = 0, | |
$sep = "\n", | |||
$withregion = 0, | |||
$extralangcode = '' ) |
Return full address of contact.
int<0,1> | $withcountry 1=Add country into address string | |
string | $sep | Separator to use to build string |
int<0,1> | $withregion 1=Add region into address string | |
string | $extralangcode | User extralanguages as value |
Definition at line 1111 of file commonobject.class.php.
References dol_format_address(), getCountry(), and getState().
Referenced by Account\getBannerAddress(), and WebPortalMember\getBannerAddressForWebPortal().
CommonObject::getIdContact | ( | $source, | |
$code, | |||
$status = 0 ) |
Return id of contacts for a source and a contact code.
Example: contact client de facturation ('external', 'BILLING') Example: contact client de livraison ('external', 'SHIPPING') Example: contact interne suivi paiement ('internal', 'SALESREPFOLL')
string | $source | 'external' or 'internal' |
string | $code | 'BILLING', 'SHIPPING', 'SALESREPFOLL', ... |
int | $status | limited to a certain status |
Definition at line 1771 of file commonobject.class.php.
References dol_syslog().
Referenced by Contrat\getIdBillingContact(), Facture\getIdBillingContact(), Contrat\getIdServiceContact(), and Facture\getIdShippingContact().
CommonObject::getIdOfLine | ( | $rang | ) |
Get rowid of the line relative to its position.
int | $rang | Rang value |
Definition at line 3574 of file commonobject.class.php.
CommonObject::getJSListDependancies | ( | $type = '_extra' | ) |
string | $type | Type for prefix |
Definition at line 9191 of file commonobject.class.php.
CommonObject::getLastMainDocLink | ( | $modulepart, | |
$initsharekey = 0, | |||
$relativelink = 0 ) |
Return the link of last main doc file for direct public download.
string | $modulepart | Module related to document |
int | $initsharekey | Init the share key if it was not yet defined |
int | $relativelink | 0=Return full external link, 1=Return link relative to root of file |
Definition at line 1141 of file commonobject.class.php.
References getRandomPassword().
CommonObject::getListContactId | ( | $source = 'external' | ) |
Return list of id of contacts of object.
string | $source | Source of contact: external (llx_socpeople) or internal (llx_user) or thirdparty (llx_societe) |
Reimplemented in Task.
Definition at line 2514 of file commonobject.class.php.
CommonObject::getNbComments | ( | ) |
Return nb comments already posted.
Definition at line 10894 of file commonobject.class.php.
CommonObject::getRangOfLine | ( | $rowid | ) |
Get position of line (rang)
int | $rowid | Id of line |
Definition at line 3548 of file commonobject.class.php.
References dol_syslog().
CommonObject::getRights | ( | ) |
Returns the rights used for this class.
Reimplemented in CommandeFournisseur, FactureFournisseur, and Product.
Definition at line 9267 of file commonobject.class.php.
CommonObject::getSpecialCode | ( | $lineid | ) |
Get special code of a line.
int | $lineid | Id of line |
Definition at line 4788 of file commonobject.class.php.
CommonObject::getTooltipContent | ( | $params | ) |
getTooltipContent
array<string,mixed> | $params params |
Definition at line 982 of file commonobject.class.php.
References dol_eval(), getDolGlobalInt(), and getTooltipContentArray().
CommonObject::getTooltipContentArray | ( | $params | ) |
Return array of data to show into a tooltip.
This method must be implemented in each object class.
array<string,mixed> | $params params to construct tooltip data |
Reimplemented in Account, ActionComm, Adherent, AdherentType, BOM, Calendar, Categorie, Commande, CommandeFournisseur, Contact, Contrat, ContratLigne, Cronjob, Delivery, Dolresource, Entrepot, Expedition, ExpenseReport, Facture, FactureFournisseur, Fichinter, Fiscalyear, Holiday, KnowledgeRecord, Mailing, Mo, MyObject, Opensurveysondage, Partnership, PaymentSalary, Product, Productlot, Project, Propal, Salary, Societe, SocieteAccount, SupplierProposal, Task, Ticket, TimeSpent, User, UserGroup, WebPortalInvoice, WebPortalMember, WebPortalOrder, WebPortalPartnership, WebPortalPropal, and Workstation.
Definition at line 970 of file commonobject.class.php.
Referenced by getTooltipContent().
CommonObject::getTotalDiscount | ( | ) |
Function that returns the total amount HT of discounts applied for all lines.
Definition at line 4928 of file commonobject.class.php.
References dol_syslog(), and price2num().
CommonObject::getTotalWeightVolume | ( | ) |
Return into unit=0, the calculated total of weight and volume of all lines * qty Calculate by adding weight and volume of each product line, so properties ->volume/volume_units/weight/weight_units must be loaded on line.
Definition at line 4970 of file commonobject.class.php.
CommonObject::getValueFrom | ( | $table, | |
$id, | |||
$field ) |
Getter generic.
Load value from a specific field
string | $table | Table of element or element line |
int | $id | Element id |
string | $field | Field selected |
Definition at line 2141 of file commonobject.class.php.
References dol_syslog().
CommonObject::hasProductsOrServices | ( | $predefined = -1 | ) |
Function to say how many lines object contains.
int | $predefined | -1=All, 0=Count free product/service only, 1=Count predefined product/service only, 2=Count predefined product, 3=Count predefined service |
Definition at line 4894 of file commonobject.class.php.
References dol_syslog().
CommonObject::indexFile | ( | $destfull, | |
$update_main_doc_field ) |
Index a file into the ECM database.
string | $destfull | Full path of file to index |
int | $update_main_doc_field | Update field main_doc field into the table of the object. This param is set when called for a document generation if document generator hase ->update_main_doc_field set and returns ->result['fullpath']. |
Definition at line 5870 of file commonobject.class.php.
References dol_osencode(), dol_print_error(), getDolGlobalInt(), getRandomPassword(), and setEventMessages().
CommonObject::initAsSpecimenCommon | ( | ) |
Initialise object with example values Id must be 0 if object instance is a specimen.
Definition at line 10824 of file commonobject.class.php.
References dol_now().
Referenced by ActionCommReminder\initAsSpecimen(), Asset\initAsSpecimen(), AssetModel\initAsSpecimen(), Availabilities\initAsSpecimen(), BOM\initAsSpecimen(), BOMLine\initAsSpecimen(), Calendar\initAsSpecimen(), CompanyPaymentMode\initAsSpecimen(), ConferenceOrBooth\initAsSpecimen(), ConferenceOrBoothAttendee\initAsSpecimen(), CTicketCategory\initAsSpecimen(), DefaultValues\initAsSpecimen(), EmailCollector\initAsSpecimen(), EmailCollectorAction\initAsSpecimen(), EmailCollectorFilter\initAsSpecimen(), EmailSenderProfile\initAsSpecimen(), Evaluation\initAsSpecimen(), EvaluationLine\initAsSpecimen(), Hook\initAsSpecimen(), Inventory\initAsSpecimen(), Job\initAsSpecimen(), KnowledgeRecord\initAsSpecimen(), Mo\initAsSpecimen(), MyObject\initAsSpecimen(), Partnership\initAsSpecimen(), PartnershipType\initAsSpecimen(), Position\initAsSpecimen(), ProductFournisseurPrice\initAsSpecimen(), RecruitmentCandidature\initAsSpecimen(), RecruitmentJobPosition\initAsSpecimen(), Skill\initAsSpecimen(), Skilldet\initAsSpecimen(), SkillRank\initAsSpecimen(), SocieteAccount\initAsSpecimen(), StockTransfer\initAsSpecimen(), StockTransferLine\initAsSpecimen(), Target\initAsSpecimen(), TimeSpent\initAsSpecimen(), and Workstation\initAsSpecimen().
CommonObject::insertExtraFields | ( | $trigger = '', | |
$userused = null ) |
Add/Update all extra fields values for the current object.
Data to describe values to insert/update are stored into $this->array_options=array('options_codeforfield1'=>'valueforfield1', 'options_codeforfield2'=>'valueforfield2', ...) This function delete record with all extrafields and insert them again from the array $this->array_options.
string | $trigger | If defined, call also the trigger (for example COMPANY_MODIFY) |
User | $userused | Object user |
Definition at line 6490 of file commonobject.class.php.
References $object, dol_eval(), dol_hash(), dol_include_once(), dol_syslog(), dolEncrypt(), getDolGlobalString(), ExtraFields\isEmptyValue(), and price2num().
Referenced by Account\create(), ActionComm\create(), Categorie\create(), Commande\create(), CommandeFournisseur\create(), Contrat\create(), Dolresource\create(), Don\create(), Entrepot\create(), Expedition\create(), ExpenseReport\create(), Facture\create(), FactureFournisseur\create(), FactureFournisseurRec\create(), FactureRec\create(), Fichinter\create(), Holiday\create(), Productlot\create(), Project\create(), Propal\create(), Reception\create(), ReceptionLineBatch\create(), Salary\create(), SupplierProposal\create(), Task\create(), Ticket\create(), CommandeFournisseurLigne\insert(), ContratLigne\insert(), ExpeditionLigne\insert(), FactureLigne\insert(), FichinterLigne\insert(), OrderLine\insert(), PropaleLigne\insert(), SupplierInvoiceLine\insert(), SupplierProposalLine\insert(), Account\update(), ActionComm\update(), Adherent\update(), AdherentType\update(), Categorie\update(), Commande\update(), CommandeFournisseur\update(), CommandeFournisseurLigne\update(), Contact\update(), Contrat\update(), ContratLigne\update(), Dolresource\update(), Don\update(), EcmFiles\update(), Entrepot\update(), ExpeditionLigne\update(), Facture\update(), FactureFournisseur\update(), FactureFournisseurLigneRec\update(), FactureFournisseurRec\update(), FactureLigne\update(), FactureLigneRec\update(), FactureRec\update(), Fichinter\update(), FichinterLigne\update(), OrderLine\update(), Product\update(), Productlot\update(), Project\update(), Propal\update(), PropaleLigne\update(), ReceptionLineBatch\update(), Salary\update(), Societe\update(), SupplierInvoiceLine\update(), SupplierProposalLine\update(), Task\update(), and User\update().
CommonObject::insertExtraLanguages | ( | $trigger = '', | |
$userused = null ) |
Add/Update all extra fields values for the current object.
Data to describe values to insert/update are stored into $this->array_options=array('options_codeforfield1'=>'valueforfield1', 'options_codeforfield2'=>'valueforfield2', ...) This function delete record with all extrafields and insert them again from the array $this->array_options.
string | $trigger | If defined, call also the trigger (for example COMPANY_MODIFY) |
User | $userused | Object user |
Definition at line 6816 of file commonobject.class.php.
References dol_syslog(), getDolGlobalString(), and price2num().
Referenced by Societe\update().
|
protected |
Function test if type is array.
array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string} | $info content information of field |
Definition at line 9675 of file commonobject.class.php.
CommonObject::isDate | ( | $info | ) |
Function test if type is date.
array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string} | $info content information of field |
Definition at line 9693 of file commonobject.class.php.
CommonObject::isDuration | ( | $info | ) |
Function test if type is duration.
array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string} | $info content information of field |
Definition at line 9707 of file commonobject.class.php.
CommonObject::isEmpty | ( | ) |
isEmpty We consider CommonObject isEmpty if this->id is empty
Definition at line 942 of file commonobject.class.php.
|
static |
Check if an object id or ref exists If you don't need or want to instantiate the object and just need to know if the object exists, use this method instead of fetch.
string | $element | String of element ('product', 'facture', ...) |
int | $id | Id of object |
string | $ref | Ref of object to check |
string | $ref_ext | Ref ext of object to check |
Definition at line 901 of file commonobject.class.php.
References dol_syslog().
Referenced by Commande\create(), Fichinter\create(), Propal\create(), SupplierProposal\create(), FactureLigne\insert(), and SupplierInvoiceLine\insert().
CommonObject::isFloat | ( | $info | ) |
Function test if type is float.
array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string} | $info content information of field |
Definition at line 9745 of file commonobject.class.php.
|
protected |
Function test if field is forced to null if zero or empty.
array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string} | $info content information of field |
Definition at line 9799 of file commonobject.class.php.
|
protected |
Function test if is indexed.
array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string} | $info content information of field |
Definition at line 9817 of file commonobject.class.php.
CommonObject::isInt | ( | $info | ) |
Function test if type is integer.
array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string} | $info Properties of field |
Definition at line 9726 of file commonobject.class.php.
CommonObject::isObjectUsed | ( | $id = 0, | |
$entity = 0 ) |
Function to check if an object is used by others (by children).
Check is done into this->childtables. There is no check into llx_element_element.
int | $id | Force id of object |
int | $entity | Force entity to check |
Definition at line 4809 of file commonobject.class.php.
References dol_print_error().
Referenced by Product\delete(), Societe\delete(), and Task\delete().
CommonObject::isText | ( | $info | ) |
Function test if type is text.
array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string} | $info Properties of field |
Definition at line 9763 of file commonobject.class.php.
CommonObject::line_ajaxorder | ( | $rows | ) |
Update position of line with ajax (rang)
int[] | $rows | Array of rows |
Definition at line 3472 of file commonobject.class.php.
CommonObject::line_down | ( | $rowid, | |
$fk_parent_line = true ) |
Update a line to have a higher rank.
int | $rowid | Id of line |
boolean | $fk_parent_line | Table with fk_parent_line field or not |
Definition at line 3420 of file commonobject.class.php.
CommonObject::line_max | ( | $fk_parent_line = 0 | ) |
Get max value used for position of line (rang)
int | $fk_parent_line | Parent line id |
Definition at line 3600 of file commonobject.class.php.
References dol_syslog().
Referenced by BOM\addLine(), ProductAttribute\addLine(), Commande\addline(), CommandeFournisseur\addline(), Facture\addline(), FactureFournisseur\addline(), FactureRec\addline(), Propal\addline(), SupplierProposal\addline(), ExpeditionLigne\insert(), Commande\updateline(), Facture\updateline(), Propal\updateline(), and SupplierProposal\updateline().
CommonObject::line_order | ( | $renum = false, | |
$rowidorder = 'ASC', | |||
$fk_parent_line = true ) |
Save a new position (field rang) for details lines.
You can choose to set position for lines with already a position or lines without any position defined.
boolean | $renum | True to renum all already ordered lines, false to renum only not already ordered lines. |
string | $rowidorder | ASC or DESC |
boolean | $fk_parent_line | Table with fk_parent_line field or not |
Definition at line 3278 of file commonobject.class.php.
References dol_print_error(), and dol_syslog().
Referenced by Commande\addline(), CommandeFournisseur\addline(), Facture\addline(), FactureFournisseur\addline(), Propal\addline(), SupplierProposal\addline(), StockTransfer\deleteLine(), Commande\updateline(), Facture\updateline(), Propal\updateline(), and SupplierProposal\updateline().
CommonObject::line_up | ( | $rowid, | |
$fk_parent_line = true ) |
Update a line to have a lower rank.
int | $rowid | Id of line |
boolean | $fk_parent_line | Table with fk_parent_line field or not |
Definition at line 3400 of file commonobject.class.php.
CommonObject::liste_contact | ( | $statusoflink = -1, | |
$source = 'external', | |||
$list = 0, | |||
$code = '', | |||
$status = -1, | |||
$arrayoftcids = array() ) |
Get array of all contacts for an object.
int | $statusoflink | Status of links to get (-1=all). Not used. |
'external'|'thirdparty'|'internal' | $source Source of contact: 'external' or 'thirdparty' (llx_socpeople) or 'internal' (llx_user) | |
int<0,1> | $list 0:Returned array contains all properties, 1:Return array contains just id | |
string | $code | Filter on this code of contact type ('SHIPPING', 'BILLING', ...) |
int | $status | Status of user or company |
int[] | $arrayoftcids | Array with ID of type of contacts. If we provide this, we can make a ec.fk_c_type_contact in ($arrayoftcids) to avoid link on tc table. TODO Not implemented. |
Definition at line 1490 of file commonobject.class.php.
References dol_print_error(), and dol_syslog().
Referenced by add_contact(), Task\getListContactId(), and Project\restrictedProjectArea().
CommonObject::liste_type_contact | ( | $source = 'internal', | |
$order = 'position', | |||
$option = 0, | |||
$activeonly = 0, | |||
$code = '' ) |
Return array with list of possible values for type of contacts.
'internal'|'external'|'all' | $source 'internal', 'external' or 'all' | |
string | $order | Sort order by : 'position', 'code', 'rowid'... |
int<0,1> | $option 0=Return array id->label, 1=Return array code->label | |
int<0,1> | $activeonly 0=all status of contact, 1=only the active | |
string | $code | Type of contact (Example: 'CUSTOMER', 'SERVICE') |
Definition at line 1626 of file commonobject.class.php.
Referenced by delete_linked_contact().
CommonObject::listeTypeContacts | ( | $source = 'internal', | |
$option = 0, | |||
$activeonly = 0, | |||
$code = '', | |||
$element = '', | |||
$excludeelement = '' ) |
Return array with list of possible values for type of contacts.
string | $source | 'internal', 'external' or 'all' |
int<0,1> | $option 0=Return array id->label, 1=Return array code->label | |
int<0,1> | $activeonly 0=all status of contact, 1=only the active | |
string | $code | Type of contact (Example: 'CUSTOMER', 'SERVICE') |
string | $element | Filter on 1 element type |
string | $excludeelement | Exclude 1 element type. Example: 'agenda' |
Definition at line 1689 of file commonobject.class.php.
References dol_syslog().
CommonObject::load_previous_next_ref | ( | $filter, | |
$fieldid, | |||
$nodbprefix = 0 ) |
Load properties id_previous and id_next by comparing $fieldid with $this->ref.
string | $filter | Optional SQL filter. Use SQL or Universal Search Filter. Example: "(t.field1 = 'aa' OR t.field2 = 'bb')". Do not allow user input data here with this syntax. Example: "((t.field1:=:'aa') OR (t.field2:=:'bb'))". |
string | $fieldid | Name of field to use for the select MAX and MIN |
int<0,1> | $nodbprefix Do not include DB prefix to forge table name |
Definition at line 2306 of file commonobject.class.php.
References dol_print_error(), forgeSQLFromUniversalSearchCriteria(), getDolGlobalInt(), getEntity(), and ref.
CommonObject::printObjectLine | ( | $action, | |
$line, | |||
$var, | |||
$num, | |||
$i, | |||
$dateSelector, | |||
$seller, | |||
$buyer, | |||
$selected = 0, | |||
$extrafields = null, | |||
$defaulttpldir = '/core/tpl' ) |
Return HTML content of a detail line TODO Move this into an output class file (htmlline.class.php)
string | $action | GET/POST action |
CommonObjectLine | $line | Selected object line to output |
string | $var | Not used |
int | $num | Number of line (0) |
int | $i | I |
int | $dateSelector | 1=Show also date range input fields |
Societe | $seller | Object of seller third party |
Societe | $buyer | Object of buyer third party |
int | $selected | ID line selected |
Extrafields | $extrafields | Object of extrafields |
string | $defaulttpldir | Directory where to find the template (deprecated) |
Reimplemented in ProductAttribute.
Definition at line 5247 of file commonobject.class.php.
References $object, dol_buildpath(), dol_htmlentitiesbr(), dol_print_error(), getDolGlobalInt(), getDolGlobalString(), GETPOST(), price2num(), and status.
CommonObject::printObjectLines | ( | $action, | |
$seller, | |||
$buyer, | |||
$selected = 0, | |||
$dateSelector = 0, | |||
$defaulttpldir = '/core/tpl' ) |
Return HTML table for object lines TODO Move this into an output class file (htmlline.class.php) If lines are into a template, title must also be into a template But for the moment we don't know if it's possible as we keep a method available on overloaded objects.
string | $action | Action code |
Societe | $seller | Object of seller third party |
Societe | $buyer | Object of buyer third party |
int | $selected | ID line selected |
int | $dateSelector | 1=Show also date range input fields |
string | $defaulttpldir | Directory where to find the template |
Definition at line 5156 of file commonobject.class.php.
References $object, and dol_buildpath().
CommonObject::printOriginLine | ( | $line, | |
$var, | |||
$restrictlist = '', | |||
$defaulttpldir = '/core/tpl', | |||
$selectedLines = array() ) |
Return HTML with a line of table array of source object lines TODO Move this and previous function into output html class file (htmlline.class.php).
If lines are into a template, titles must also be into a template But for the moment we don't know if it's possible as we keep a method available on overloaded objects.
CommonObjectLine | $line | Line |
string | $var | Not used |
string | $restrictlist | ''=All lines, 'services'=Restrict to services only (strike line if not) |
string | $defaulttpldir | Directory where to find the template |
int[] | $selectedLines | Array of lines id for selected lines |
Reimplemented in Mo.
Definition at line 5428 of file commonobject.class.php.
References dol_buildpath(), dol_trunc(), get_date_range(), getDolGlobalInt(), img_object(), img_picto(), price(), Product\TYPE_SERVICE, and vatrate().
CommonObject::printOriginLinesList | ( | $restrictlist = '', | |
$selectedLines = array() ) |
Return HTML table table of source object lines TODO Move this and previous function into output html class file (htmlline.class.php).
If lines are into a template, title must also be into a template But for the moment we don't know if it's possible, so we keep the method available on overloaded objects.
''|'services' | $restrictlist ''=All lines, 'services'=Restrict to services only | |
int[] | $selectedLines | Array of lines id for selected lines |
Reimplemented in Mo.
Definition at line 5373 of file commonobject.class.php.
References getDolGlobalInt().
|
protected |
Add quote to field value if necessary.
string | int | $value | Value to protect |
array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string} | $fieldsentry Properties of field |
Definition at line 10004 of file commonobject.class.php.
References price2num().
CommonObject::setBankAccount | ( | $fk_account, | |
$notrigger = 0, | |||
$userused = null ) |
Change the bank account.
int | $fk_account | Id of bank account |
int | $notrigger | 0=launch triggers after, 1=disable triggers |
User | $userused | Object user |
Definition at line 3209 of file commonobject.class.php.
References dol_syslog().
CommonObject::setCategoriesCommon | ( | $categories, | |
$type_categ = '', | |||
$remove_existing = true ) |
Sets object to given categories.
Adds it to non existing supplied categories. Deletes object from existing categories not supplied (if remove_existing==true). Existing categories are left untouch.
int[] | int | $categories | Category ID or array of Categories IDs |
string | $type_categ | Category type ('customer', 'supplier', 'website_page', ...) defined into const class Categorie type |
boolean | $remove_existing | True: Remove existings categories from Object if not supplies by $categories, False: let them |
Definition at line 10952 of file commonobject.class.php.
References dol_syslog().
Referenced by WebsitePage\setCategories().
CommonObject::setDeliveryAddress | ( | $id | ) |
Define delivery address.
int | $id | Address id |
Definition at line 3056 of file commonobject.class.php.
References dol_syslog().
CommonObject::setDocModel | ( | $user, | |
$modelpdf ) |
Set last model used by doc generator.
Definition at line 3176 of file commonobject.class.php.
References dol_print_error(), dol_syslog(), and dol_trunc().
CommonObject::setErrorsFromObject | ( | $object | ) |
setErrorsFromObject
CommonObject | $object | commonobject |
Definition at line 953 of file commonobject.class.php.
References $object.
Referenced by BOM\addLine(), Account\addline(), Expedition\addline_batch(), ActionComm\createFromClone(), Calendar\createFromClone(), Commande\createFromClone(), CommandeFournisseur\createFromClone(), ConferenceOrBoothAttendee\createFromClone(), Contrat\createFromClone(), Evaluation\createFromClone(), EvaluationLine\createFromClone(), ExpenseReport\createFromClone(), Facture\createFromClone(), Fichinter\createFromClone(), Job\createFromClone(), MyObject\createFromClone(), Position\createFromClone(), Propal\createFromClone(), Skill\createFromClone(), Skilldet\createFromClone(), SkillRank\createFromClone(), SupplierProposal\createFromClone(), Target\createFromClone(), Facture\createFromContract(), Facture\createFromOrder(), Commande\createFromProposal(), BOM\deleteLine(), CommandeFournisseur\deleteLine(), StockTransferLine\doStockMovement(), Skill\fetchLines(), Calendar\getLinesArray(), Evaluation\getLinesArray(), EvaluationLine\getLinesArray(), Job\getLinesArray(), MyObject\getLinesArray(), Position\getLinesArray(), Skill\getLinesArray(), Adherent\subscription(), Adherent\subscriptionComplementaryActions(), and BOM\updateLine().
CommonObject::setExtraField | ( | $key, | |
$value ) |
Convenience method for setting the value of an extrafield without actually updating it in the database.
string | $key | Name of the extrafield |
mixed | $value | Value to be assigned to the extrafield |
Definition at line 7252 of file commonobject.class.php.
CommonObject::setExtraParameters | ( | ) |
Set extra parameters.
Definition at line 5066 of file commonobject.class.php.
References dol_syslog().
CommonObject::setFieldError | ( | $fieldKey, | |
$msg = '' ) |
set validation error message a field
string | $fieldKey | Key of attribute |
string | $msg | the field error message |
Definition at line 8621 of file commonobject.class.php.
CommonObject::setMulticurrencyCode | ( | $code | ) |
Change the multicurrency code.
string | $code | multicurrency code |
Definition at line 2676 of file commonobject.class.php.
References dol_syslog(), MultiCurrency\getIdAndTxFromCode(), and status.
CommonObject::setPaymentMethods | ( | $id | ) |
Change the payments methods.
int | $id | Id of new payment method |
Definition at line 2609 of file commonobject.class.php.
References dol_syslog(), and status.
Referenced by CommonInvoice\demande_prelevement(), and Salary\demande_prelevement().
CommonObject::setPaymentTerms | ( | $id, | |
$deposit_percent = null ) |
Change the payments terms.
int | $id | Id of new payment terms |
float | $deposit_percent | % of deposit if needed by payment terms |
Definition at line 2928 of file commonobject.class.php.
References dol_syslog(), getDictionaryValue(), and status.
CommonObject::setProject | ( | $projectid, | |
$notrigger = 0 ) |
Link element with a project.
int | $projectid | Project id to link element to |
int<0,1> | $notrigger Disable the trigger |
Definition at line 2539 of file commonobject.class.php.
References dol_print_error(), and dol_syslog().
CommonObject::setRetainedWarrantyPaymentTerms | ( | $id | ) |
Change the retained warranty payments terms.
int | $id | Id of new payment terms |
Definition at line 3024 of file commonobject.class.php.
References dol_syslog(), and status.
|
protected |
Function to return the array of data key-value from the ->fields and all the ->properties of an object.
Note: $this->${field} are set by the page that make the createCommon() or the updateCommon(). $this->${field} should be a clean and string value (so date are formatted for SQL insert).
Definition at line 9838 of file commonobject.class.php.
CommonObject::setShippingMethod | ( | $shipping_method_id, | |
$notrigger = 0, | |||
$userused = null ) |
Change the shipping method.
int | $shipping_method_id | Id of shipping method |
int | $notrigger | 0=launch triggers after, 1=disable triggers |
User | $userused | Object user |
Definition at line 3085 of file commonobject.class.php.
References dol_syslog().
CommonObject::setSignedStatusCommon | ( | $user, | |
$status, | |||
$notrigger = 0, | |||
$triggercode = '' ) |
Set to a signed status.
User | $user | Object user that modify |
int | $status | New status to set (often a constant like self\STATUS_XXX) |
int | $notrigger | 1=Does not execute triggers, 0=Execute triggers |
string | $triggercode | Trigger code to use |
Definition at line 10777 of file commonobject.class.php.
References status.
Referenced by Contrat\setSignedStatus(), and Fichinter\setSignedStatus().
CommonObject::setStatusCommon | ( | $user, | |
$status, | |||
$notrigger = 0, | |||
$triggercode = '' ) |
Set to a status.
User | $user | Object user that modify |
int | $status | New status to set (often a constant like self\STATUS_XXX) |
int | $notrigger | 1=Does not execute triggers, 0=Execute triggers |
string | $triggercode | Trigger code to use |
Definition at line 10722 of file commonobject.class.php.
References status, and statut.
Referenced by AssetModel\cancel(), Availabilities\cancel(), BOM\cancel(), Calendar\cancel(), ConferenceOrBooth\cancel(), ConferenceOrBoothAttendee\cancel(), Evaluation\cancel(), EvaluationLine\cancel(), Job\cancel(), KnowledgeRecord\cancel(), Mo\cancel(), MyObject\cancel(), Partnership\cancel(), Position\cancel(), ProductFournisseurPrice\cancel(), RecruitmentCandidature\cancel(), RecruitmentJobPosition\cancel(), Skill\cancel(), Skilldet\cancel(), SkillRank\cancel(), StockTransfer\cancel(), StockTransferLine\cancel(), Target\cancel(), TimeSpent\cancel(), Asset\dispose(), Asset\reopen(), AssetModel\reopen(), Availabilities\reopen(), BOM\reopen(), Calendar\reopen(), ConferenceOrBooth\reopen(), ConferenceOrBoothAttendee\reopen(), Don\reopen(), Evaluation\reopen(), EvaluationLine\reopen(), Job\reopen(), KnowledgeRecord\reopen(), Mo\reopen(), MyObject\reopen(), Partnership\reopen(), Position\reopen(), ProductFournisseurPrice\reopen(), RecruitmentCandidature\reopen(), RecruitmentJobPosition\reopen(), Skill\reopen(), Skilldet\reopen(), SkillRank\reopen(), StockTransfer\reopen(), StockTransferLine\reopen(), Target\reopen(), TimeSpent\reopen(), Workstation\setDisabled(), AssetModel\setDraft(), Availabilities\setDraft(), BOM\setDraft(), Calendar\setDraft(), ConferenceOrBooth\setDraft(), ConferenceOrBoothAttendee\setDraft(), Evaluation\setDraft(), EvaluationLine\setDraft(), Expedition\setDraft(), Job\setDraft(), KnowledgeRecord\setDraft(), Mo\setDraft(), MyObject\setDraft(), Partnership\setDraft(), Position\setDraft(), ProductFournisseurPrice\setDraft(), RecruitmentCandidature\setDraft(), RecruitmentJobPosition\setDraft(), Skill\setDraft(), Skilldet\setDraft(), SkillRank\setDraft(), StockTransfer\setDraft(), StockTransferLine\setDraft(), Target\setDraft(), TimeSpent\setDraft(), and Workstation\setEnabled().
CommonObject::setStatut | ( | $status, | |
$elementId = null, | |||
$elementType = '', | |||
$trigkey = '', | |||
$fieldstatus = 'fk_statut' ) |
Set status of an object.
int | $status | Status to set |
int | $elementId | Id of element to force (use this->id by default if null) |
string | $elementType | Type of element to force (use this->table_element by default) |
string | $trigkey | Trigger key to use for trigger. Use '' means automatic but it is not recommended and is deprecated. |
string | $fieldstatus | Name of status field in this->table_element |
Definition at line 4611 of file commonobject.class.php.
References dol_now(), dol_syslog(), and status.
Referenced by Delivery\create(), Inventory\setCanceled(), Inventory\setDraft(), Inventory\setRecorded(), Expedition\valid(), Reception\valid(), and Inventory\validate().
CommonObject::setTransportMode | ( | $id | ) |
Change the transport mode methods.
int | $id | Id of transport mode |
Definition at line 2983 of file commonobject.class.php.
References dol_syslog(), and status.
CommonObject::setValueFrom | ( | $field, | |
$value, | |||
$table = '', | |||
$id = null, | |||
$format = '', | |||
$id_field = '', | |||
$fuser = null, | |||
$trigkey = '', | |||
$fk_user_field = 'fk_user_modif' ) |
Setter generic.
Update a specific field into database. Warning: Trigger is run only if param trigkey is provided.
string | $field | Field to update |
mixed | $value | New value |
string | $table | To force other table element or element line (should not be used) |
int | $id | To force other object id (should not be used) |
string | $format | Data format ('text', 'int', 'date'). 'text' is used if not defined |
string | $id_field | To force rowid field name. 'rowid' is used if not defined |
User | string | $fuser | Update the user of last update field with this user. If not provided, current user is used except if value is 'none' |
string | $trigkey | Trigger key to run (in most cases something like 'XXX_MODIFY') |
string | $fk_user_field | Name of field to save user id making change |
Definition at line 2174 of file commonobject.class.php.
References dol_syslog().
Referenced by Societe\setThirdpartyType().
CommonObject::setValuesForExtraLanguages | ( | $onlykey = '' | ) |
Fill array_options property of object by extrafields value (using for data sent by forms)
string | $onlykey | Only the following key is filled. When we make update of only one language field ($action = 'update_languages'), calling page must set this to avoid to have other languages being reset. |
Definition at line 6204 of file commonobject.class.php.
References dol_eval(), dol_mktime(), GETPOST(), GETPOSTINT(), and price2num().
CommonObject::setVarsFromFetchObj | ( | & | $obj | ) |
Function to load data from a SQL pointer into properties of current object $this.
stdClass | $obj | Contain data of object from database |
Definition at line 9906 of file commonobject.class.php.
References ref.
CommonObject::setWarehouse | ( | $warehouse_id | ) |
Change the warehouse.
int | $warehouse_id | Id of warehouse |
Definition at line 3143 of file commonobject.class.php.
References dol_syslog().
CommonObject::show_photos | ( | $modulepart, | |
$sdir, | |||
$size = 0, | |||
$nbmax = 0, | |||
$nbbyrow = 5, | |||
$showfilename = 0, | |||
$showaction = 0, | |||
$maxHeight = 120, | |||
$maxWidth = 160, | |||
$nolink = 0, | |||
$overwritetitle = 0, | |||
$usesharelink = 0, | |||
$cache = '', | |||
$addphotorefcss = 'photoref' ) |
Show photos of an object (nbmax maximum), into several columns.
string | $modulepart | 'product', 'ticket', ... |
string | $sdir | Directory to scan (full absolute path) |
int<0,1>|''|'small' | $size 0 or ''=original size, 1 or 'small'=use thumbnail if possible | |
int | $nbmax | Nombre maximum de photos (0=pas de max) |
int | $nbbyrow | Number of image per line or -1 to use div separator or 0 to use no separator. Used only if size=1 or 'small'. |
int | $showfilename | 1=Show filename |
int | $showaction | 1=Show icon with action links (resize, delete) |
int | $maxHeight | Max height of original image when size='small' (so we can use original even if small requested). If 0, always use 'small' thumb image. |
int | $maxWidth | Max width of original image when size='small' |
int | $nolink | Do not add a href link to view enlarged imaged into a new tab |
int | string | $overwritetitle | Do not add title tag on image |
int | $usesharelink | Use the public shared link of image (if not available, the 'nophoto' image will be shown instead) |
string | $cache | A string if we want to use a cached version of image |
string | $addphotorefcss | Add CSS to img of photos |
Definition at line 9444 of file commonobject.class.php.
References completeFileArrayWithDatabaseInfo(), dol_dir_list(), dol_escape_htmltag(), dol_getImageSize(), dol_is_file(), dol_sort_array(), get_exdir(), getAdvancedPreviewUrl(), getDolGlobalInt(), getImageFileNameForSize(), image_format_supported(), img_delete(), img_picto(), and newToken().
Referenced by Product\getKanbanView(), ProductFournisseur\getNomUrl(), and Product\getTooltipContentArray().
CommonObject::showInputField | ( | $val, | |
$key, | |||
$value, | |||
$moreparam = '', | |||
$keysuffix = '', | |||
$keyprefix = '', | |||
$morecss = 0, | |||
$nonewbutton = 0 ) |
Return HTML string to put an input field into a page Code very similar with showInputField of extra fields.
?array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string} | $val Array of properties for field to show (used only if ->fields not defined) Array of properties of field to show | |
string | $key | Key of attribute |
string | string[] | $value | Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value, for array type must be array) |
string | $moreparam | To add more parameters on html input tag |
string | $keysuffix | Suffix string to add into name and id of field (can be used to avoid duplicate names) |
string | $keyprefix | Prefix string to add into name and id of field (can be used to avoid duplicate names) |
string | int | $morecss | Value for css to define style/length of field. May also be a numeric. |
int<0,1> | $nonewbutton Force to not show the new button on field that are links to object |
Reimplemented in Position.
Definition at line 7300 of file commonobject.class.php.
References ajax_combobox(), dol_escape_htmltag(), dol_syslog(), dol_trunc(), forgeSQLFromUniversalSearchCriteria(), getDolGlobalInt(), getDolGlobalString(), and price().
CommonObject::showOptionals | ( | $extrafields, | |
$mode = 'view', | |||
$params = null, | |||
$keysuffix = '', | |||
$keyprefix = '', | |||
$onetrtd = '', | |||
$display_type = 'card' ) |
Function to show lines of extrafields with output data.
This function is responsible to output the
and
according to correct number of columns received into $params['colspan'] or
Extrafields | $extrafields | Extrafield Object |
string | $mode | Show output ('view') or input ('create' or 'edit') for extrafield |
array<string,mixed> | $params Optional parameters. Example: array('style'=>'class="oddeven"', 'colspan'=>$colspan) | |
string | $keysuffix | Suffix string to add after name and id of field (can be used to avoid duplicate names) |
string | $keyprefix | Prefix string to add before name and id of field (can be used to avoid duplicate names) |
string | $onetrtd | All fields in same tr td. Used by objectline_create.tpl.php for example. |
string | $display_type | "card" for form display, "line" for document line display (extrafields on propal line, order line, etc...) |
Definition at line 8870 of file commonobject.class.php.
References dol_eval(), dol_mktime(), dol_syslog(), getDolGlobalString(), getPictoForType(), GETPOST(), GETPOSTINT(), and price2num().
CommonObject::swapContactStatus | ( | $rowid | ) |
Update status of a contact linked to object.
int | $rowid | Id of link between object and contact |
Definition at line 1591 of file commonobject.class.php.
References dol_print_error(), dol_syslog(), and update_contact().
CommonObject::trimParameters | ( | $parameters | ) |
Trim object parameters.
string[] | $parameters | array of parameters to trim |
Definition at line 10905 of file commonobject.class.php.
CommonObject::update_contact | ( | $rowid, | |
$statut, | |||
$type_contact_id = 0, | |||
$fk_socpeople = 0 ) |
Update a link to contact line.
int | $rowid | Id of line contact-element |
int | $statut | New status of link |
int | $type_contact_id | Id of contact type (not modified if 0) |
int | $fk_socpeople | Id of soc_people to update (not modified if 0) |
Definition at line 1365 of file commonobject.class.php.
Referenced by swapContactStatus().
CommonObject::update_note | ( | $note, | |
$suffix = '', | |||
$notrigger = 0 ) |
Update note of element.
string | $note | New value for note |
string | $suffix | '', '_public' or '_private' |
int | $notrigger | 1=Does not execute triggers, 0=execute triggers |
Definition at line 3678 of file commonobject.class.php.
References dol_syslog().
CommonObject::update_note_public | ( | $note | ) |
Update public note (kept for backward compatibility)
string | $note | New value for note |
Definition at line 3766 of file commonobject.class.php.
CommonObject::update_price | ( | $exclspec = 0, | |
$roundingadjust = 'auto', | |||
$nodatabaseupdate = 0, | |||
$seller = null ) |
Update total_ht, total_ttc, total_vat, total_localtax1, total_localtax2 for an object (sum of lines).
Must be called at end of methods addline or updateline.
int | $exclspec | >0 = Exclude special product (product_type=9) |
'none'|'auto'|'0'|'1' | $roundingadjust 'none'=Do nothing, 'auto'=Use default method (MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND if defined, or '0'), '0'=Force mode Total of rounding, '1'=Force mode Rounding of total | |
int<0,1> | $nodatabaseupdate 1=Do not update database total fields of the main object. Update only properties in memory. Can be used to save SQL when this method is called several times, so we can do it only once at end. | |
?Societe | $seller | If roundingadjust is '0' or '1' or maybe 'auto', it means we recalculate total for lines before calculating total for object and for this, we need seller object (used to analyze lines to check corrupted data). |
Definition at line 3783 of file commonobject.class.php.
References getDolGlobalString().
Referenced by Commande\addline(), CommandeFournisseur\addline(), ExpenseReport\addline(), Facture\addline(), FactureFournisseur\addline(), FactureFournisseurRec\addline(), FactureRec\addline(), Propal\addline(), SupplierProposal\addline(), Commande\create(), ExpenseReport\create(), Facture\create(), FactureFournisseur\create(), Propal\create(), SupplierProposal\create(), Commande\deleteLine(), CommandeFournisseur\deleteLine(), Delivery\deleteLine(), ExpenseReport\deleteLine(), Facture\deleteLine(), FactureFournisseur\deleteLine(), Propal\deleteLine(), SupplierProposal\deleteLine(), Commande\insert_discount(), Facture\insert_discount(), FactureFournisseur\insert_discount(), Propal\insert_discount(), SupplierProposal\insert_discount(), Commande\setDiscount(), Facture\setDiscount(), Facture\update_percent(), CommandeFournisseur\updateFromCommandeClient(), Commande\updateline(), CommandeFournisseur\updateline(), Facture\updateline(), FactureFournisseur\updateline(), FactureFournisseurRec\updateline(), FactureRec\updateline(), Propal\updateline(), SupplierProposal\updateline(), and Facture\validate().
CommonObject::update_ref_ext | ( | $ref_ext | ) |
Update external ref of element.
string | $ref_ext | Update field ref_ext |
Definition at line 3647 of file commonobject.class.php.
References dol_syslog().
CommonObject::updateCommon | ( | User | $user, |
$notrigger = 0 ) |
Update object into database.
User | $user | User that modifies |
int<0,1> | $notrigger 0=launch triggers after, 1=disable triggers |
Definition at line 10344 of file commonobject.class.php.
References dol_now(), dol_string_nospecial(), and dol_syslog().
Referenced by ActionCommReminder\update(), Asset\update(), AssetModel\update(), Availabilities\update(), BOM\update(), BOMLine\update(), BonPrelevement\update(), Calendar\update(), CashControl\update(), CompanyPaymentMode\update(), ConferenceOrBoothAttendee\update(), CTicketCategory\update(), DefaultValues\update(), EmailCollector\update(), EmailCollectorAction\update(), EmailCollectorFilter\update(), EmailSenderProfile\update(), Evaluation\update(), EvaluationLine\update(), ExpenseReportIk\update(), ExpenseReportRule\update(), Hook\update(), Inventory\update(), InventoryLine\update(), Job\update(), KnowledgeRecord\update(), Mo\update(), MoLine\update(), MyObject\update(), Partnership\update(), PartnershipType\update(), Position\update(), ProductFournisseurPrice\update(), RecruitmentCandidature\update(), RecruitmentJobPosition\update(), Skill\update(), Skilldet\update(), SkillRank\update(), SocieteAccount\update(), StockTransfer\update(), StockTransferLine\update(), Target\update(), TimeSpent\update(), UserGroup\update(), WebsitePage\update(), and Workstation\update().
CommonObject::updateExtraField | ( | $key, | |
$trigger = null, | |||
$userused = null ) |
Update 1 extra field value for the current object.
Keep other fields unchanged. Data to describe values to update are stored into $this->array_options=array('options_codeforfield1'=>'valueforfield1', 'options_codeforfield2'=>'valueforfield2', ...)
string | $key | Key of the extrafield to update (without starting 'options_') |
string | $trigger | If defined, call also the trigger (for example COMPANY_MODIFY) |
User | $userused | Object user |
Definition at line 6934 of file commonobject.class.php.
References dol_eval(), dol_hash(), dol_syslog(), dolEncrypt(), getDolGlobalString(), price2num(), and setEventMessages().
CommonObject::updateExtraLanguages | ( | $key, | |
$trigger = null, | |||
$userused = null ) |
Update an extra language value for the current object.
Data to describe values to update are stored into $this->array_options=array('options_codeforfield1'=>'valueforfield1', 'options_codeforfield2'=>'valueforfield2', ...)
string | $key | Key of the extrafield (without starting 'options_') |
string | $trigger | If defined, call also the trigger (for example COMPANY_MODIFY) |
User | $userused | Object user |
Definition at line 7267 of file commonobject.class.php.
References getDolGlobalString().
CommonObject::updateLineDown | ( | $rowid, | |
$rang, | |||
$max ) |
Update position of line down (rang)
int | $rowid | Id of line |
int | $rang | Position |
int | $max | Max |
Definition at line 3519 of file commonobject.class.php.
References dol_print_error().
CommonObject::updateLineUp | ( | $rowid, | |
$rang ) |
Update position of line up (rang)
int | $rowid | Id of line |
int | $rang | Position |
Definition at line 3488 of file commonobject.class.php.
References dol_print_error().
CommonObject::updateObjectLinked | ( | $sourceid = null, | |
$sourcetype = '', | |||
$targetid = null, | |||
$targettype = '', | |||
$f_user = null, | |||
$notrigger = 0 ) |
Update object linked of a current object.
int | $sourceid | Object source id |
string | $sourcetype | Object source type |
int | $targetid | Object target id |
string | $targettype | Object target type |
User | $f_user | User that create |
int | $notrigger | 1=Does not execute triggers, 0= execute triggers |
Definition at line 4373 of file commonobject.class.php.
References dol_syslog().
CommonObject::updateRangOfLine | ( | $rowid, | |
$rang ) |
Update position of line (rang)
int | $rowid | Id of line |
int | $rang | Position |
Definition at line 3442 of file commonobject.class.php.
References dol_print_error(), and dol_syslog().
Referenced by Commande\addline(), CommandeFournisseur\addline(), Facture\addline(), FactureFournisseur\addline(), Propal\addline(), SupplierProposal\addline(), Facture\insert_discount(), and FactureFournisseur\insert_discount().
CommonObject::validateField | ( | $fields, | |
$fieldKey, | |||
$fieldValue ) |
Return validation test result for a field.
array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string}> | $fields Array of properties of field to show | |
string | $fieldKey | Key of attribute |
string | $fieldValue | value of attribute |
Reimplemented in MyObject, and Productlot.
Definition at line 8653 of file commonobject.class.php.
Referenced by AssetDepreciationOptions\setDeprecationOptionsFromPost().
CommonObject::$origin_object |
Definition at line 285 of file commonobject.class.php.
Referenced by Reception\getStatusDispatch().