noalyss Version-9
|
Class Document corresponds to the table document. More...
Public Member Functions | |
__construct ($p_cn, $p_d_id=0) | |
Constructor. More... | |
anchor () | |
create and compute a string for reference the doc <A ...> More... | |
blank () | |
insert a minimal document and set the d_id More... | |
compute_filename ($pj, $filename) | |
Insert the receipt number into the filename , each generated file will have the name of the template (model) + receipt number) More... | |
download ($aDocument) | |
Download all documents in a ZIP files. More... | |
export_file ($p_destination_file) | |
export the file to the file system and complet $this->d_mimetype, d_filename and More... | |
generate ($p_array, $p_filename="") | |
Generate the document, Call $this->replace to replace tag by value. More... | |
get () | |
Get complete all the data member thx info from the database. More... | |
get_all ($ag_id) | |
get all the document of a given action More... | |
moveDocumentPj ($p_internal) | |
Move a document from the table document into the concerned row the document is not copied : it is only a link. More... | |
parseDocument ($p_dir, $p_file, $p_type, $p_array) | |
This function parse a document and replace all the predefined tags by a value. More... | |
remove () | |
remove a row from the table document, the lob object is not deleted because can be linked elsewhere More... | |
replace ($p_tag, $p_array) | |
replace the TAG by the real value, this value can be into the database or in $_POST The possible tags are More... | |
replace_special_tag ($p_qcode, $p_tag) | |
replace a special tag *TAGxxxx with the value from fiche_detail, the xxxx is the ad_value More... | |
saveGenerated ($p_file) | |
Save the generated Document. More... | |
send () | |
send the document More... | |
transform2pdf () | |
transform the current Document to a PDF, returns the full path of the PDF from the TMP folder More... | |
update_description ($p_desc) | |
upload ($p_ag_id) | |
upload a file into document all the needed data are in $_FILES we don't increment the seq $_FILES : array containing by default $_FILES More... | |
Static Public Member Functions | |
static | insert_existing_document ($p_ag_id, $p_lob, $p_filename, $p_mimetype, $p_description="") |
Copy a existing OID (LOB) into the table document. More... | |
static | replace_value ($p_buffer, $p_pattern, $p_value, $p_limit=-1, $p_type='OOo') |
replace a pattern with a value in the buffer , handle the change for OOo type file and amount More... | |
Data Fields | |
$ag_id | |
$d_description | |
$d_filename | |
$d_id | |
$d_lob | |
$d_mimetype | |
$d_number | |
$db | |
$md_id | |
Private Attributes | |
$counter | |
Class Document corresponds to the table document.
Definition at line 28 of file document.class.php.
Document::__construct | ( | $p_cn, | |
$p_d_id = 0 |
|||
) |
Constructor.
$p_cn | Database connection |
Definition at line 47 of file document.class.php.
References db.
Document::anchor | ( | ) |
create and compute a string for reference the doc <A ...>
Definition at line 536 of file document.class.php.
References $href, $r, and Dossier\id().
Document::blank | ( | ) |
insert a minimal document and set the d_id
Definition at line 59 of file document.class.php.
Document::compute_filename | ( | $pj, | |
$filename | |||
) |
Insert the receipt number into the filename , each generated file will have the name of the template (model) + receipt number)
type | $pj | the receipt number |
type | $filename | the name of the file |
Definition at line 80 of file document.class.php.
References $i, and noalyss_str_replace().
Referenced by generate().
Document::download | ( | $aDocument | ) |
Download all documents in a ZIP files.
The parameters is an array of Document, see DOcument::get_all
array | of Document $aDocument |
Definition at line 377 of file document.class.php.
References $dirname, $file, $i, $name, $nb_document, and db.
Document::export_file | ( | $p_destination_file | ) |
export the file to the file system and complet $this->d_mimetype, d_filename and
string | $p_destination_file | path |
Definition at line 1868 of file document.class.php.
References $ret, $row, $tmp, db, DatabaseCore\fetch_array(), and DatabaseCore\num_row().
Referenced by transform2pdf().
Document::generate | ( | $p_array, | |
$p_filename = "" |
|||
) |
Generate the document, Call $this->replace to replace tag by value.
p_array | contains the data normally it is the $_POST |
$p_filename | contains the new filename |
Definition at line 112 of file document.class.php.
References $dirname, $e, $href, $p_array, $res, $Res, $ret, $row, $type, compute_filename(), db, DatabaseCore\fetch_array(), Dossier\id(), parseDocument(), record_log(), saveGenerated(), and span().
Document::get | ( | ) |
Get complete all the data member thx info from the database.
Definition at line 629 of file document.class.php.
References $ret, $row, $sql, ag_id, db, DatabaseCore\fetch_array(), and DatabaseCore\num_row().
Document::get_all | ( | $ag_id | ) |
get all the document of a given action
$ag_id | the ag_id from action::ag_id (primary key) |
Definition at line 604 of file document.class.php.
|
static |
Copy a existing OID (LOB) into the table document.
type | $p_ag_id | Follow_Up::ag_id |
type | $p_lob | oid of existing document |
type | $p_filename | filename of existing document |
type | $p_mimetype | mimetype of existing document |
type | $p_description | Description of existing document (default empty) |
Definition at line 521 of file document.class.php.
Document::moveDocumentPj | ( | $p_internal | ) |
Move a document from the table document into the concerned row the document is not copied : it is only a link.
$p_internal | internal code |
Definition at line 1757 of file document.class.php.
Document::parseDocument | ( | $p_dir, | |
$p_file, | |||
$p_type, | |||
$p_array | |||
) |
This function parse a document and replace all the predefined tags by a value.
This functions generate diffent documents (invoice, order, letter) with the info from the database
$p_dir | directory name |
$p_file | filename |
$p_type | For the OOo document the tag are < and > instead of < and > |
$p_array | variable from $_POST |
Definition at line 230 of file document.class.php.
References $f, $msg, $p_array, $p_type, $ret, $tag, $value, noalyss_str_replace(), record_log(), replace(), and replace_value().
Referenced by generate().
Document::remove | ( | ) |
remove a row from the table document, the lob object is not deleted because can be linked elsewhere
Definition at line 1740 of file document.class.php.
Document::replace | ( | $p_tag, | |
$p_array | |||
) |
replace the TAG by the real value, this value can be into the database or in $_POST The possible tags are
$p_tag | TAG |
$p_array | data from $_POST |
Definition at line 711 of file document.class.php.
References $act, $ag_id, $aTag, $d_number, $date, $description, $f, $g_parameter, $i, $id, $p, $p_array, $poste, $profile, $qcode, $r, $ret, $status, $tiers, $tot, ATTR_DEF_ACCOUNT, ATTR_DEF_ADRESS, ATTR_DEF_BQ_NAME, ATTR_DEF_BQ_NO, ATTR_DEF_CITY, ATTR_DEF_CP, ATTR_DEF_NAME, ATTR_DEF_NUMBER_CUSTOMER, ATTR_DEF_NUMTVA, ATTR_DEF_PAYS, ATTR_DEF_STOCK, db, elseif, format_date(), noalyss_bcadd(), noalyss_bcmul(), noalyss_round(), noalyss_str_replace(), noalyss_strlentrim(), NOTFOUND, and replace_special_tag().
Referenced by parseDocument().
Document::replace_special_tag | ( | $p_qcode, | |
$p_tag | |||
) |
replace a special tag *TAGxxxx with the value from fiche_detail, the xxxx is the ad_value
$p_qcode | qcode of the card |
$p_tag | tag to parse |
Definition at line 1775 of file document.class.php.
References $a, $array, $attr, $f, $sql, db, and isNumber().
Referenced by replace().
|
static |
replace a pattern with a value in the buffer , handle the change for OOo type file and amount
string | $p_buffer | |
string | $_pattern | |
mixed | $p_value |
Definition at line 1823 of file document.class.php.
References $check, $count, $p_type, and noalyss_str_replace().
Referenced by parseDocument().
Document::saveGenerated | ( | $p_file | ) |
Save the generated Document.
$p_file | is the generated file |
Definition at line 341 of file document.class.php.
References $doc, $sql, ag_id, and db.
Referenced by generate().
Document::send | ( | ) |
send the document
Definition at line 551 of file document.class.php.
References $file, $ret, $row, $tmp, db, DatabaseCore\fetch_array(), and DatabaseCore\num_row().
Document::transform2pdf | ( | ) |
transform the current Document to a PDF, returns the full path of the PDF from the TMP folder
Definition at line 1899 of file document.class.php.
References $d_filename, $dirname, $ext, $result, $status, export_file(), and record_log().
Document::update_description | ( | $p_desc | ) |
Definition at line 1811 of file document.class.php.
References db.
Document::upload | ( | $p_ag_id | ) |
upload a file into document all the needed data are in $_FILES we don't increment the seq $_FILES : array containing by default $_FILES
int | $p_ag_id | ACTION_GESTION.AG_ID |
Definition at line 457 of file document.class.php.
References $description, $http, $i, $name, $new_name, $sql, and db.
Document::$ag_id |
$ag_id action_gestion.ag_id (pk)
Definition at line 33 of file document.class.php.
|
private |
counter for the items ( goods )
Definition at line 40 of file document.class.php.
Document::$d_description |
Description of the file
Definition at line 37 of file document.class.php.
Document::$d_filename |
Document::$d_id |
$d_id Document id
Definition at line 32 of file document.class.php.
Document::$d_lob |
Document::$d_mimetype |
$d_mimetype
Definition at line 34 of file document.class.php.
Document::$d_number |
$d_number number of the document
Definition at line 38 of file document.class.php.
Referenced by replace().
Document::$db |
$db Database connexion
Definition at line 31 of file document.class.php.
Document::$md_id |
$md_id document's template
Definition at line 39 of file document.class.php.