Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
freedom_util.php File Reference

Go to the source code of this file.

Namespaces

 FDL
 

Functions

 GetSqlCond2 ($Table, $column)
 
 GetSqlCond ($Table, $column, $integer=false)
 
 first ($a)
 
 notEmpty ($a)
 
 HandleXmlError ($errno, $errstr, $errfile, $errline)
 
 clearCacheDoc ($id=0)
 
 new_Doc ($dbaccess, $id= '', $latest=false)
 
 createDoc ($dbaccess, $fromid, $control=true, $defaultvalues=true, $temporary=false)
 
 createTmpDoc ($dbaccess, $fromid, $defaultvalue=true)
 
 getFromId ($dbaccess, $id)
 
 getFromName ($dbaccess, $id)
 
 getFamFromId ($dbaccess, $id)
 
 getDocTitle ($id, $latest=true)
 
 getDocProperties ($id, $latest=true, array $prop=array("title"))
 
 getTDoc ($dbaccess, $id, $sqlfilters=array(), $result=array())
 
 getv (&$t, $k, $d="")
 
 getvs (&$t)
 
 tordered ($a, $b)
 
 cmp_cvorder3 ($a, $b)
 
 controlTdoc (&$tdoc, $aclname)
 
 getDocObject ($dbaccess, $v, $k=0)
 
 getNextDbObject ($dbaccess, $res)
 
 getNextDoc ($dbaccess, &$tres)
 
 countDocs (&$tres)
 
 getFamIdFromName ($dbaccess, $name)
 
 getIdFromTitle ($dbaccess, $title, $famid="", $only=false)
 
 getIdFromName ($dbaccess, $name)
 
 getInitidFromName ($name)
 
 getNameFromId ($dbaccess, $id)
 
 setFamidInLayout (Action &$action)
 
 getDocFromUserId ($dbaccess, $userid)
 
 getFamTitle (&$tdoc)
 
 isFixedDoc ($dbaccess, $id)
 
 fixMultipleAliveDocument (Doc &$doc)
 
 ComputeVisibility ($vis, $fvis, $ffvis= '')
 
 getLatestTDoc ($dbaccess, $initid, $sqlfilters=array(), $fromid=false)
 
 getLatestDocIds ($dbaccess, $ids)
 
 getLatestDocId ($dbaccess, $initid)
 
 getRevTDoc ($dbaccess, $initid, $rev)
 
 getLatestRevisionNumber ($dbaccess, $initid, $fromid=0)
 
 createAutoFolder (&$doc)
 
 getMyProfil ($dbaccess, $create=true)
 
 xt_innerXML (&$node)
 
 cleanhtml ($html)
 

Function Documentation

cleanhtml (   $html)
Parameters
$html
Returns
mixed
Deprecated:

Definition at line 1048 of file freedom_util.php.

clearCacheDoc (   $id = 0)

clear all cache used by new_doc function

Parameters
int$iddocument identifier : limit to destroy cache of only this document
Returns
void

Definition at line 94 of file freedom_util.php.

+ Here is the call graph for this function:

cmp_cvorder3 (   $a,
  $b 
)

Definition at line 500 of file freedom_util.php.

ComputeVisibility (   $vis,
  $fvis,
  $ffvis = '' 
)

Definition at line 811 of file freedom_util.php.

controlTdoc ( $tdoc,
  $aclname 
)

control privilege for a document in the array form the array must provide from getTdoc the function is equivalent of Doc::Control

Parameters
array$tdocdocument
string$aclnameidentifier of the privilege to test
Returns
bool true if current user has privilege

Definition at line 515 of file freedom_util.php.

+ Here is the call graph for this function:

countDocs ( $tres)

count returned document in sql select ressources

Parameters
array$tresof ressources return Doc the next doc (false if the end)

Definition at line 593 of file freedom_util.php.

createAutoFolder ( $doc)

Create default folder for a family with default constraint

Parameters
Doc$Docthe family object document
Returns
int id of new folder (false if error)

Definition at line 983 of file freedom_util.php.

+ Here is the call graph for this function:

createDoc (   $dbaccess,
  $fromid,
  $control = true,
  $defaultvalues = true,
  $temporary = false 
)

create a new document object in type concordance

the document is set with default values and default profil of the family

Parameters
string$dbaccessdatabase specification
string$fromididentifier of the family document (the number or internal name)
bool$controlif false don't control the user hability to create this kind of document
bool$defaultvaluesif false not affect default values
bool$temporaryif true create document as temporary doc (use Doc::createTmpDoc instead)
See Also
createTmpDoc to create temporary/working document
$myDoc=createDoc("", "SOCIETY");
if ($myDoc) {
$myDoc->setValue("si_name", "my company");
$err=$myDoc->store();
}
Returns
Doc may be return false if no hability to create the document

Definition at line 211 of file freedom_util.php.

+ Here is the call graph for this function:

createTmpDoc (   $dbaccess,
  $fromid,
  $defaultvalue = true 
)

create a temporary document object in type concordance

the document is set with default values and has no profil the create privilege is not tested in this case

Parameters
string$dbaccessdatabase specification
string$fromididentifier of the family document (the number or internal name)
bool$defaultvalueset to false to not set default values
Returns
Doc may be return false if no hability to create the document

Definition at line 262 of file freedom_util.php.

+ Here is the call graph for this function:

first (   $a)

return first element of array

Parameters
array$a
Returns
string the first, false is empty

Definition at line 63 of file freedom_util.php.

fixMultipleAliveDocument ( Doc $doc)

lock oldest alive revision in case of conflict

Parameters
Doc$doc

Definition at line 789 of file freedom_util.php.

+ Here is the call graph for this function:

getDocFromUserId (   $dbaccess,
  $userid 
)

return freedom user document in concordance with what user id

Parameters
string$dbaccessdatabase specification
int$useridwhat user identifier
Returns
Doc the user document

Definition at line 744 of file freedom_util.php.

+ Here is the call graph for this function:

getDocObject (   $dbaccess,
  $v,
  $k = 0 
)

get document object from array document values

Parameters
string$dbaccessdatabase specification
array$vvalues of document
Returns
Doc the document object

Definition at line 542 of file freedom_util.php.

+ Here is the call graph for this function:

getDocProperties (   $id,
  $latest = true,
array  $prop = array(    "title") 
)

get some properties for a document

Parameters
$id
bool$latest
array$propproperties list to retrieve
Returns
array|null of indexed properties's values - empty array if not found

Definition at line 372 of file freedom_util.php.

+ Here is the call graph for this function:

getDocTitle (   $id,
  $latest = true 
)

get document title from document identifier

Parameters
int | string$iddocument identifier
bool$latestset to false for a fixed id or true for latest
Returns
string

Definition at line 348 of file freedom_util.php.

+ Here is the call graph for this function:

getFamFromId (   $dbaccess,
  $id 
)

return from id for family document

Parameters
string$dbaccessdatabase specification
int$ididentifier of the object
Returns
int false if error occured

Definition at line 326 of file freedom_util.php.

+ Here is the call graph for this function:

getFamIdFromName (   $dbaccess,
  $name 
)

return the identifier of a family from internal name

Parameters
string$dbaccessdatabase specification
string$nameinternal family name
Returns
int 0 if not found

Definition at line 607 of file freedom_util.php.

getFamTitle ( $tdoc)

Definition at line 766 of file freedom_util.php.

getFromId (   $dbaccess,
  $id 
)

return from id for document (not for family (use

See Also
getFamFromId() instead)
Parameters
string$dbaccessdatabase specification
int$ididentifier of the object
Returns
int false if error occured (return -1 if family document )

Definition at line 279 of file freedom_util.php.

+ Here is the call graph for this function:

getFromName (   $dbaccess,
  $id 
)

return from name for document (not for family (use

See Also
getFamFromId() instead)
Parameters
string$dbaccessdatabase specification
int$ididentifier of the object
Returns
string false if error occured (return -1 if family document )

Definition at line 303 of file freedom_util.php.

+ Here is the call graph for this function:

getIdFromName (   $dbaccess,
  $name 
)

return the latest identifier of a document from its logical name

Parameters
string$dbaccessdatabase specification
string$namelogical name
Returns
int|false return numeric id, false if not found, if revision (name must be unique) return the latest id

Definition at line 661 of file freedom_util.php.

+ Here is the call graph for this function:

getIdFromTitle (   $dbaccess,
  $title,
  $famid = "",
  $only = false 
)

return the identifier of a document from a search with title

Parameters
string$dbaccessdatabase specification
string$namelogical name
string$famidmust be set to increase speed search
boolean$onlyset to true to not search in subfamilies
Returns
int 0 if not found, return negative first id found if multiple (name must be unique)

Definition at line 642 of file freedom_util.php.

+ Here is the call graph for this function:

getInitidFromName (   $name)

return the initial identifier of a document from its logical name

Parameters
string$name
Returns
int

Definition at line 692 of file freedom_util.php.

+ Here is the call graph for this function:

getLatestDocId (   $dbaccess,
  $initid 
)

return latest id of document from its initid or other id

Parameters
string$dbaccessdatabase specification
int$initiddocument identificator
Returns
int identifier relative to latest revision. if one or several documents document not exists the identifier not appear in result so the array count of result can be lesser than parameter

Definition at line 909 of file freedom_util.php.

+ Here is the call graph for this function:

getLatestDocIds (   $dbaccess,
  $ids 
)

return identificators according to latest revision the order is not the same as parameters. The key of result containt initial id

Parameters
string$dbaccessdatabase specification
array$idsarray of document identificators
Returns
array identifier relative to latest revision. if one or several documents document not exists the identifier not appear in result so the array count of result can be lesser than parameter

Definition at line 885 of file freedom_util.php.

+ Here is the call graph for this function:

getLatestRevisionNumber (   $dbaccess,
  $initid,
  $fromid = 0 
)

return really latest revision number use only for debug mode

Parameters
string$dbaccessdatabase specification
int$initidinitial identifier of the document
int$fromidfamily identicator of document
Returns
int latest revision if found. False if initid not available

Definition at line 960 of file freedom_util.php.

+ Here is the call graph for this function:

getLatestTDoc (   $dbaccess,
  $initid,
  $sqlfilters = array(),
  $fromid = false 
)

return doc array of latest revision of initid

Parameters
string$dbaccessdatabase specification
string$initidinitial identifier of the document
array$sqlfiltersadd sql supply condition
Returns
array values array if found. False if initid not avalaible

Definition at line 837 of file freedom_util.php.

+ Here is the call graph for this function:

getMyProfil (   $dbaccess,
  $create = true 
)

get personal profil

return the profil named "PERSONAL-PROFIL-<$uid>" the document return is a folder profil that can be use also for "normal" documents

Returns
PDir may be return false if no hability to create the document

Definition at line 1005 of file freedom_util.php.

+ Here is the call graph for this function:

getNameFromId (   $dbaccess,
  $id 
)

return the logical name of a document from its initial identifier

Parameters
string$dbaccessdatabase specification
string$idinitial identifier
Returns
string empty if not found

Definition at line 705 of file freedom_util.php.

+ Here is the call graph for this function:

getNextDbObject (   $dbaccess,
  $res 
)

return the next document in sql select ressources use with "ITEM" type searches direct in QueryDb return Doc the next doc (false if the end)

Definition at line 564 of file freedom_util.php.

+ Here is the call graph for this function:

getNextDoc (   $dbaccess,
$tres 
)

return the next document in sql select ressources use with "ITEM" type searches with getChildDoc return Doc the next doc (false if the end)

Definition at line 575 of file freedom_util.php.

+ Here is the call graph for this function:

getRevTDoc (   $dbaccess,
  $initid,
  $rev 
)

return doc array of specific revision of document initid

Parameters
string$dbaccessdatabase specification
string$initidinitial identifier of the document
int$revrevision number
Returns
array values array if found. False if initid not avalaible

Definition at line 931 of file freedom_util.php.

+ Here is the call graph for this function:

GetSqlCond (   $Table,
  $column,
  $integer = false 
)

Definition at line 38 of file freedom_util.php.

GetSqlCond2 (   $Table,
  $column 
)

Definition at line 22 of file freedom_util.php.

getTDoc (   $dbaccess,
  $id,
  $sqlfilters = array(),
  $result = array() 
)

return document table value

Parameters
string$dbaccessdatabase specification
int$ididentifier of the object
array$sqlfiltersadd sql supply condition
array$result
Returns
array false if error occured or if cocument not found

Definition at line 398 of file freedom_util.php.

+ Here is the call graph for this function:

getv ( $t,
  $k,
  $d = "" 
)

return the value of an doc array item

Parameters
array&$tthe array where get value
string$kthe index of the value
string$ddefault value if not found or if it is empty
Returns
string

Definition at line 447 of file freedom_util.php.

getvs ( $t)

complete all values of an doc array item

Parameters
array&$tthe array where get value
Returns
string

Definition at line 472 of file freedom_util.php.

HandleXmlError (   $errno,
  $errstr,
  $errfile,
  $errline 
)

function use by Doc::getOOoValue() use to trap XML parsing error : raise exception

Parameters
int$errnoerror number
string$errstrerror message
string$errfile
string$errlineerror line
Returns
bool

Definition at line 83 of file freedom_util.php.

isFixedDoc (   $dbaccess,
  $id 
)

verify in database if document is fixed

Returns
bool

Definition at line 777 of file freedom_util.php.

+ Here is the call graph for this function:

new_Doc (   $dbaccess,
  $id = '',
  $latest = false 
)

return document object in type concordance

Parameters
string$dbaccessdatabase specification
int | string$ididentifier of the object
bool$latestif true set to latest revision of doc
$myDoc=new_doc("", $myIdentifier);
if ($myDoc->isAlive()) {
print $myDoc->getTitle();
} else {
printf("%s not found",$myIdentifier);
}
Returns
Doc object

Definition at line 119 of file freedom_util.php.

+ Here is the call graph for this function:

notEmpty (   $a)

Definition at line 70 of file freedom_util.php.

setFamidInLayout ( Action $action)

Definition at line 726 of file freedom_util.php.

+ Here is the call graph for this function:

tordered (   $a,
  $b 
)

use to usort attributes

Parameters
BasicAttribute$a
BasicAttribute$b

Definition at line 488 of file freedom_util.php.

xt_innerXML ( $node)
Parameters
DomElement$node
Returns
bool

Definition at line 1035 of file freedom_util.php.

← centre documentaire © anakeen