<function name="rpcf_generate_doc_for_user" id="0x7030"> <input> <integer name="doc_type_id"/> <integer name="uid" comment="Deprecated parameter" default="0" /> <integer name="base_id" comment="account_id"/> <integer name="doc_template_id" default="0"/> </input> <output> <integer name="doc_template_id"/> <integer name="static_id"/> <if variable="static_id" value="0" condition="ne"> <integer name="text_count"/> <for name="i" from="0" count="text_count"> <string name="dynamic_text" array_index="i"/> </for> <integer name="dynamic_landscape"/> </if> <if variable="static_id" value="0" condition="eq"> <integer name="dynamic_id"/> <integer name="text_count"/> <for name="i" from="0" count="text_count"> <string name="static_text" array_index="i"/> </for> <integer name="static_landscape"/> </if> </output> </function>
// Функция сделана для НОВОЙ реализации urfa_get_data()!!! function rpcf_generate_doc_for_user($doc_type_id,$acc_id,$template_id) { //0x7030 $ret=array(); if (!$this->connection->urfa_call(0x7030)) { print "Error calling function ". __FUNCTION__ ."\n"; return FALSE; } $packet=$this->connection->getPacket(); $packet->DataSetInt($doc_type_id); $packet->DataSetInt(0); $packet->DataSetInt($acc_id); $packet->DataSetInt($template_id); $this->connection->urfa_send_param($packet); if($x = $this->connection->urfa_get_data()){// $ret['template_id']=$x->DataGetInt(); $ret['static_id']=$x->DataGetInt(); if ($ret['static_id']!=0){ $count = $x->DataGetInt(); $ret['count'] = $count; for ($i=0;$i<$count;$i++) { $ret['text'][$i]=$x->DataGetString(); } $ret['dynamic_landscape']=$x->DataGetInt(); }else{ $ret['dynamic_id']=$x->DataGetInt(); $ret['count']=$x->DataGetInt(); for ($i=0;$i<$ret['count'];$i++){ $ret['text'][$i]=$x->DataGetString(); } $ret['static_landscape']=$x->DataGetInt(); } } } return $ret; }