baseline 7.4 as-is produzione
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
<?php␍
|
||||
require_once dirname(__FILE__) . '/../CommandImpl.php';␍
|
||||
class FileMaker_Command_Add_Implementation extends FileMaker_Command_Implementation␍
|
||||
{␍
|
||||
var $_fields = array();␍
|
||||
function FileMaker_Command_Add_Implementation($V0ab34ca9, $Vc6140495, $Vf09cc7ee = array())␍
|
||||
{ ␍
|
||||
FileMaker_Command_Implementation::FileMaker_Command_Implementation($V0ab34ca9, $Vc6140495);␍
|
||||
foreach ($Vf09cc7ee as $V06e3d36f => $V2063c160) {␍
|
||||
if (!is_array($V2063c160)) {␍
|
||||
$V2063c160 = array($V2063c160);␍
|
||||
}␍
|
||||
$this->_fields[$V06e3d36f] = $V2063c160;␍
|
||||
}␍
|
||||
}␍
|
||||
function &execute()␍
|
||||
{ ␍
|
||||
if ($this->_fm->getProperty('prevalidate')) {␍
|
||||
$V9f7d0ee8 = $this->validate();␍
|
||||
if (FileMaker::isError($V9f7d0ee8)) {␍
|
||||
return $V9f7d0ee8;␍
|
||||
}␍
|
||||
} ␍
|
||||
$Vc6140495 =& $this->_fm->getLayout($this->_layout);␍
|
||||
if (FileMaker::isError($Vc6140495)) {␍
|
||||
return $Vc6140495;␍
|
||||
} ␍
|
||||
$V21ffce5b = $this->_getCommandParams(); ␍
|
||||
$V21ffce5b['-new'] = true; ␍
|
||||
foreach ($this->_fields as $V972bf3f0 => $Vee0525e4) {␍
|
||||
if (strpos($V972bf3f0, '.') !== false) {␍
|
||||
list($Vb068931c, $V11e868ac) = explode('.', $V972bf3f0, 2);␍
|
||||
$V11e868ac = '.' . $V11e868ac;␍
|
||||
} else {␍
|
||||
$Vb068931c = $V972bf3f0;␍
|
||||
$V06e3d36f = $Vc6140495->getField($V972bf3f0);␍
|
||||
if (FileMaker::isError($V06e3d36f)) {␍
|
||||
return $V06e3d36f;␍
|
||||
}␍
|
||||
if ($V06e3d36f->isGlobal()) {␍
|
||||
$V11e868ac = '.global';␍
|
||||
} else {␍
|
||||
$V11e868ac = '';␍
|
||||
}␍
|
||||
}␍
|
||||
foreach ($Vee0525e4 as $V6a992d55 => $V3a6d0284) {␍
|
||||
$V21ffce5b[$Vb068931c . '(' . ($V6a992d55 + 1) . ')' . $V11e868ac] = $V3a6d0284;␍
|
||||
}␍
|
||||
} ␍
|
||||
$V0f635d0e = $this->_fm->_execute($V21ffce5b);␍
|
||||
if (FileMaker::isError($V0f635d0e)) {␍
|
||||
return $V0f635d0e;␍
|
||||
} ␍
|
||||
return $this->_getResult($V0f635d0e);␍
|
||||
}␍
|
||||
function setField($V06e3d36f, $V2063c160, $V6d786dc7 = 0)␍
|
||||
{␍
|
||||
$this->_fields[$V06e3d36f][$V6d786dc7] = $V2063c160;␍
|
||||
return $V2063c160;␍
|
||||
}␍
|
||||
function setFieldFromTimestamp($V972bf3f0, $Vd7e6d55b, $V6d786dc7 = 0)␍
|
||||
{␍
|
||||
$Vc6140495 =& $this->_fm->getLayout($this->_layout);␍
|
||||
if (FileMaker::isError($Vc6140495)) {␍
|
||||
return $Vc6140495;␍
|
||||
}␍
|
||||
$V06e3d36f = $Vc6140495->getField($V972bf3f0);␍
|
||||
if (FileMaker::isError($V06e3d36f)) {␍
|
||||
return $V06e3d36f;␍
|
||||
}␍
|
||||
switch ($V06e3d36f->getResult()) {␍
|
||||
case 'date':␍
|
||||
return $this->setField($V972bf3f0, date('m/d/Y', $Vd7e6d55b), $V6d786dc7);␍
|
||||
case 'time':␍
|
||||
return $this->setField($V972bf3f0, date('H:i:s', $Vd7e6d55b), $V6d786dc7);␍
|
||||
case 'timestamp':␍
|
||||
return $this->setField($V972bf3f0, date('m/d/Y H:i:s', $Vd7e6d55b), $V6d786dc7);␍
|
||||
}␍
|
||||
return new FileMaker_Error($this->_fm, 'Only time, date, and timestamp fields can be set to the value of a timestamp.');␍
|
||||
}␍
|
||||
}␍
|
||||
@@ -0,0 +1,133 @@
|
||||
<?php␍
|
||||
require_once dirname(__FILE__) . '/../CommandImpl.php';␍
|
||||
class FileMaker_Command_CompoundFind_Implementation extends FileMaker_Command_Implementation␍
|
||||
{␍
|
||||
var $_findCriteria = array();␍
|
||||
var $Vd65662c5 = array();␍
|
||||
var $Va9136a07 = array();␍
|
||||
var $V83f28691;␍
|
||||
var $V85fd701e;␍
|
||||
var $V6da136ea;␍
|
||||
var $V568aa2ec;␍
|
||||
var $Vad2bfd5a = array();␍
|
||||
function FileMaker_Command_CompoundFind_Implementation($V0ab34ca9, $Vc6140495)␍
|
||||
{␍
|
||||
FileMaker_Command_Implementation::FileMaker_Command_Implementation($V0ab34ca9, $Vc6140495);␍
|
||||
}␍
|
||||
function &execute()␍
|
||||
{ ␍
|
||||
$V090cbceb= null;␍
|
||||
␍
|
||||
$V8ac10dab = 0; ␍
|
||||
$V31c3c8cf = 0;␍
|
||||
$V40677621 = 1; ␍
|
||||
$Ve2942a04 = 1; ␍
|
||||
$V21ffce5b = $this->_getCommandParams(); ␍
|
||||
$this->_setSortParams($V21ffce5b);␍
|
||||
$this->_setRangeParams($V21ffce5b);␍
|
||||
$this->_setRelatedSetsFilters($V21ffce5b); ␍
|
||||
ksort($this->Vad2bfd5a); ␍
|
||||
$V31c3c8cf=count($this->Vad2bfd5a); ␍
|
||||
foreach ($this->Vad2bfd5a as $V70a17ffa => $V9a7aa128)␍
|
||||
{ ␍
|
||||
$V15c46c6e = $V9a7aa128->_impl->_findCriteria;␍
|
||||
$V8ac10dab = count($V15c46c6e);␍
|
||||
␍
|
||||
$V090cbceb = $V090cbceb.'(';␍
|
||||
␍
|
||||
$V4111477f = 0;␍
|
||||
foreach ($V15c46c6e as $Vd1148ee8 => $Ve9de89b0) { ␍
|
||||
$V21ffce5b['-q'.$Ve2942a04] = $Vd1148ee8;␍
|
||||
$V21ffce5b['-q'.$Ve2942a04.'.'."value"] = $Ve9de89b0; ␍
|
||||
$V090cbceb=$V090cbceb.'q'.$Ve2942a04; ␍
|
||||
$Ve2942a04++;␍
|
||||
$V4111477f++; ␍
|
||||
␍
|
||||
if($V4111477f < $V8ac10dab){␍
|
||||
$V090cbceb = $V090cbceb.',';␍
|
||||
}␍
|
||||
}␍
|
||||
$V090cbceb=$V090cbceb.")"; ␍
|
||||
$V40677621++; ␍
|
||||
if($V40677621 <= $V31c3c8cf){ ␍
|
||||
$V4b22ce92 = $this->Vad2bfd5a[$V40677621];␍
|
||||
if($V4b22ce92->_impl->_omit == true){␍
|
||||
$V090cbceb = $V090cbceb.';!';␍
|
||||
}else{␍
|
||||
$V090cbceb = $V090cbceb.';';␍
|
||||
}␍
|
||||
}␍
|
||||
} ␍
|
||||
$V21ffce5b['-query'] = $V090cbceb; ␍
|
||||
$V21ffce5b['-findquery'] = true; ␍
|
||||
$V0f635d0e = $this->_fm->_execute($V21ffce5b);␍
|
||||
if (FileMaker::isError($V0f635d0e)) {␍
|
||||
return $V0f635d0e;␍
|
||||
} ␍
|
||||
return $this->_getResult($V0f635d0e);␍
|
||||
}␍
|
||||
function add($Vffbd028a, $Vd0dff0df)␍
|
||||
{␍
|
||||
$this->Vad2bfd5a[$Vffbd028a] = $Vd0dff0df;␍
|
||||
}␍
|
||||
function addSortRule($Vd1148ee8, $Vffbd028a, $V70a17ffa = null)␍
|
||||
{␍
|
||||
$this->Vd65662c5[$Vffbd028a] = $Vd1148ee8;␍
|
||||
if ($V70a17ffa !== null) {␍
|
||||
$this->Va9136a07[$Vffbd028a] = $V70a17ffa;␍
|
||||
}␍
|
||||
}␍
|
||||
function clearSortRules()␍
|
||||
{␍
|
||||
$this->Vd65662c5= array();␍
|
||||
$this->Va9136a07= array();␍
|
||||
}␍
|
||||
function setRange($V08b43519 = 0, $V2ffe4e77 = null)␍
|
||||
{␍
|
||||
$this->V83f28691= $V08b43519;␍
|
||||
$this->V85fd701e= $V2ffe4e77;␍
|
||||
}␍
|
||||
function getRange()␍
|
||||
{␍
|
||||
return array('skip' => $this->V83f28691,␍
|
||||
'max' => $this->V85fd701e);␍
|
||||
}␍
|
||||
␍
|
||||
function setRelatedSetsFilters($Vdba51d08, $V01a8ebbf = null)␍
|
||||
{␍
|
||||
$this->V6da136ea= $Vdba51d08;␍
|
||||
$this->V568aa2ec= $V01a8ebbf;␍
|
||||
}␍
|
||||
function getRelatedSetsFilters()␍
|
||||
{␍
|
||||
return array('relatedsetsfilter' => $this->V6da136ea,␍
|
||||
'relatedsetsmax' => $this->V568aa2ec);␍
|
||||
}␍
|
||||
function _setRelatedSetsFilters(&$V21ffce5b)␍
|
||||
{␍
|
||||
if ($this->V6da136ea) {␍
|
||||
$V21ffce5b['-relatedsets.filter'] = $this->V6da136ea;␍
|
||||
}␍
|
||||
if ($this->V568aa2ec) {␍
|
||||
$V21ffce5b['-relatedsets.max'] = $this->V568aa2ec;␍
|
||||
}␍
|
||||
}␍
|
||||
function _setSortParams(&$V21ffce5b)␍
|
||||
{␍
|
||||
foreach ($this->Vd65662c5 as $Vffbd028a => $Vd1148ee8) {␍
|
||||
$V21ffce5b['-sortfield.' . $Vffbd028a] = $Vd1148ee8;␍
|
||||
}␍
|
||||
foreach ($this->Va9136a07 as $Vffbd028a => $V70a17ffa) {␍
|
||||
$V21ffce5b['-sortorder.' . $Vffbd028a] = $V70a17ffa;␍
|
||||
}␍
|
||||
}␍
|
||||
function _setRangeParams(&$V21ffce5b)␍
|
||||
{␍
|
||||
if ($this->V83f28691) {␍
|
||||
$V21ffce5b['-skip'] = $this->V83f28691;␍
|
||||
}␍
|
||||
if ($this->V85fd701e) {␍
|
||||
$V21ffce5b['-max'] = $this->V85fd701e;␍
|
||||
}␍
|
||||
}␍
|
||||
}␍
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php␍
|
||||
require_once dirname(__FILE__) . '/../CommandImpl.php';␍
|
||||
class FileMaker_Command_Delete_Implementation extends FileMaker_Command_Implementation␍
|
||||
{␍
|
||||
function FileMaker_Command_Delete_Implementation($V0ab34ca9, $Vc6140495, $Va6ec9c02)␍
|
||||
{␍
|
||||
FileMaker_Command_Implementation::FileMaker_Command_Implementation($V0ab34ca9, $Vc6140495);␍
|
||||
$this->_recordId = $Va6ec9c02;␍
|
||||
}␍
|
||||
function &execute()␍
|
||||
{ ␍
|
||||
if (empty($this->_recordId)) {␍
|
||||
$Vcb5e100e = new FileMaker_Error($this->_fm, 'Delete commands require a record id.');␍
|
||||
return $Vcb5e100e;␍
|
||||
} ␍
|
||||
$V21ffce5b = $this->_getCommandParams(); ␍
|
||||
$V21ffce5b['-delete'] = true; ␍
|
||||
$V21ffce5b['-recid'] = $this->_recordId; ␍
|
||||
$V0f635d0e = $this->_fm->_execute($V21ffce5b);␍
|
||||
if (FileMaker::isError($V0f635d0e)) {␍
|
||||
return $V0f635d0e;␍
|
||||
} ␍
|
||||
return $this->_getResult($V0f635d0e);␍
|
||||
}␍
|
||||
}␍
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php␍
|
||||
require_once dirname(__FILE__) . '/../CommandImpl.php';␍
|
||||
class FileMaker_Command_Duplicate_Implementation extends FileMaker_Command_Implementation␍
|
||||
{␍
|
||||
function FileMaker_Command_Duplicate_Implementation($V0ab34ca9, $Vc6140495, $Va6ec9c02)␍
|
||||
{␍
|
||||
FileMaker_Command_Implementation::FileMaker_Command_Implementation($V0ab34ca9, $Vc6140495);␍
|
||||
$this->_recordId = $Va6ec9c02;␍
|
||||
}␍
|
||||
function &execute()␍
|
||||
{ ␍
|
||||
if (empty($this->_recordId)) {␍
|
||||
$Vcb5e100e = new FileMaker_Error($this->_fm, 'Duplicate commands require a record id.');␍
|
||||
return $Vcb5e100e;␍
|
||||
} ␍
|
||||
$V21ffce5b = $this->_getCommandParams(); ␍
|
||||
$V21ffce5b['-dup'] = true; ␍
|
||||
$V21ffce5b['-recid'] = $this->_recordId; ␍
|
||||
$V0f635d0e = $this->_fm->_execute($V21ffce5b);␍
|
||||
if (FileMaker::isError($V0f635d0e)) {␍
|
||||
return $V0f635d0e;␍
|
||||
} ␍
|
||||
return $this->_getResult($V0f635d0e);␍
|
||||
}␍
|
||||
}␍
|
||||
@@ -0,0 +1,118 @@
|
||||
<?php␍
|
||||
require_once dirname(__FILE__) . '/../CommandImpl.php';␍
|
||||
class FileMaker_Command_Edit_Implementation extends FileMaker_Command_Implementation {␍
|
||||
var $_fields = array ();␍
|
||||
var $_modificationId = null;␍
|
||||
var $V6d6e1fd2;␍
|
||||
function FileMaker_Command_Edit_Implementation($V0ab34ca9, $Vc6140495, $Va6ec9c02, $Va0af1e2b = array ()) {␍
|
||||
FileMaker_Command_Implementation::FileMaker_Command_Implementation($V0ab34ca9, $Vc6140495);␍
|
||||
$this->_recordId = $Va6ec9c02;␍
|
||||
$this->V6d6e1fd2= null;␍
|
||||
foreach ($Va0af1e2b as $V06e3d36f => $V2063c160) {␍
|
||||
if (!is_array($V2063c160)) {␍
|
||||
$V2063c160 = array (␍
|
||||
$V2063c160␍
|
||||
);␍
|
||||
}␍
|
||||
$this->_fields[$V06e3d36f] = $V2063c160;␍
|
||||
}␍
|
||||
}␍
|
||||
function & execute() { ␍
|
||||
$V21ffce5b = $this->_getCommandParams(); ␍
|
||||
if (empty ($this->_recordId)) {␍
|
||||
$Vcb5e100e = new FileMaker_Error($this->_fm, 'Edit commands require a record id.');␍
|
||||
return $Vcb5e100e;␍
|
||||
} ␍
|
||||
if (!count($this->_fields)) { ␍
|
||||
if ($this->V6d6e1fd2== null) {␍
|
||||
$Vcb5e100e = new FileMaker_Error($this->_fm, 'There are no changes to make.');␍
|
||||
return $Vcb5e100e;␍
|
||||
}␍
|
||||
} ␍
|
||||
␍
|
||||
if ($this->_fm->getProperty('prevalidate')) {␍
|
||||
$Vcb5e111f = & $this->_fm->getLayout($this->_layout);␍
|
||||
$Vb0689411 = new FileMaker_Error_Validation($this->_fm);␍
|
||||
foreach ($Vcb5e111f->getFields() as $V9f7d0ff7 => $Vc6140945) {␍
|
||||
if (isset ($this->_fields[$V9f7d0ff7])) {␍
|
||||
$V6d6e1ff1 = $this->_fields[$V9f7d0ff7];␍
|
||||
foreach ($V6d6e1ff1 as $V6d6e1ff2) {␍
|
||||
$Vb0689411 = $Vc6140945->validate($V6d6e1ff2);␍
|
||||
if (FileMaker :: isError($Vb0689411)) {␍
|
||||
return $Vb0689411;␍
|
||||
}␍
|
||||
}␍
|
||||
}␍
|
||||
}␍
|
||||
}␍
|
||||
␍
|
||||
$Vc6140495 = & $this->_fm->getLayout($this->_layout);␍
|
||||
if (FileMaker :: isError($Vc6140495)) {␍
|
||||
return $Vc6140495;␍
|
||||
} ␍
|
||||
$V21ffce5b['-edit'] = true; ␍
|
||||
if ($this->V6d6e1fd2== null) {␍
|
||||
foreach ($this->_fields as $V972bf3f0 => $Vee0525e4) {␍
|
||||
if (strpos($V972bf3f0, '.') !== false) {␍
|
||||
list ($Vb068931c, $V11e868ac) = explode('.', $V972bf3f0, 2);␍
|
||||
$V11e868ac = '.' . $V11e868ac;␍
|
||||
} else {␍
|
||||
$Vb068931c = $V972bf3f0;␍
|
||||
$V06e3d36f = $Vc6140495->getField($V972bf3f0);␍
|
||||
if (FileMaker :: isError($V06e3d36f)) {␍
|
||||
return $V06e3d36f;␍
|
||||
}␍
|
||||
if ($V06e3d36f->isGlobal()) {␍
|
||||
$V11e868ac = '.global';␍
|
||||
} else {␍
|
||||
$V11e868ac = '';␍
|
||||
}␍
|
||||
}␍
|
||||
foreach ($Vee0525e4 as $V6a992d55 => $V3a6d0284) {␍
|
||||
$V21ffce5b[$Vb068931c . '(' . ($V6a992d55 +1) . ')' . $V11e868ac] = $V3a6d0284;␍
|
||||
}␍
|
||||
}␍
|
||||
}␍
|
||||
if ($this->V6d6e1fd2!= null) {␍
|
||||
$V21ffce5b['-delete.related'] = $this->V6d6e1fd2;␍
|
||||
} ␍
|
||||
$V21ffce5b['-recid'] = $this->_recordId; ␍
|
||||
if ($this->_modificationId) {␍
|
||||
$V21ffce5b['-modid'] = $this->_modificationId;␍
|
||||
} ␍
|
||||
$V0f635d0e = $this->_fm->_execute($V21ffce5b);␍
|
||||
if (FileMaker :: isError($V0f635d0e)) {␍
|
||||
return $V0f635d0e;␍
|
||||
} ␍
|
||||
return $this->_getResult($V0f635d0e);␍
|
||||
}␍
|
||||
function setField($V06e3d36f, $V2063c160, $V6d786dc7 = 0) {␍
|
||||
$this->_fields[$V06e3d36f][$V6d786dc7] = $V2063c160;␍
|
||||
return $V2063c160;␍
|
||||
}␍
|
||||
function setFieldFromTimestamp($V06e3d36f, $Vd7e6d55b, $V6d786dc7 = 0) {␍
|
||||
$Vc6140495 = & $this->_fm->getLayout($this->_layout);␍
|
||||
if (FileMaker :: isError($Vc6140495)) {␍
|
||||
return $Vc6140495;␍
|
||||
}␍
|
||||
$V06e3d36f = & $Vc6140495->getField($V06e3d36f);␍
|
||||
if (FileMaker :: isError($V06e3d36f)) {␍
|
||||
return $V06e3d36f;␍
|
||||
}␍
|
||||
switch ($V06e3d36f->getResult()) {␍
|
||||
case 'date' :␍
|
||||
return $this->setField($V972bf3f0, date('m/d/Y', $Vd7e6d55b), $V6d786dc7);␍
|
||||
case 'time' :␍
|
||||
return $this->setField($V972bf3f0, date('H:i:s', $Vd7e6d55b), $V6d786dc7);␍
|
||||
case 'timestamp' :␍
|
||||
return $this->setField($V972bf3f0, date('m/d/Y H:i:s', $Vd7e6d55b), $V6d786dc7);␍
|
||||
}␍
|
||||
return new FileMaker_Error($this->_fm, 'Only time, date, and timestamp fields can be set to the value of a timestamp.');␍
|
||||
}␍
|
||||
function setModificationId($Vf048d909) {␍
|
||||
$this->_modificationId = $Vf048d909;␍
|
||||
}␍
|
||||
function _setdeleteRelated($V2063c160) {␍
|
||||
$this->V6d6e1fd2= $V2063c160;␍
|
||||
}␍
|
||||
}␍
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php␍
|
||||
require_once dirname(__FILE__) . '/FindImpl.php';␍
|
||||
class FileMaker_Command_FindAll_Implementation extends FileMaker_Command_Find_Implementation␍
|
||||
{␍
|
||||
function FileMaker_Command_FindAll_Implementation($V0ab34ca9, $Vc6140495) {␍
|
||||
FileMaker_Command_Find_Implementation::FileMaker_Command_Find_Implementation($V0ab34ca9, $Vc6140495);␍
|
||||
}␍
|
||||
␍
|
||||
function &execute()␍
|
||||
{ ␍
|
||||
$V21ffce5b = $this->_getCommandParams(); ␍
|
||||
$V21ffce5b['-findall'] = true; ␍
|
||||
$this->_setSortParams($V21ffce5b);␍
|
||||
$this->_setRangeParams($V21ffce5b); ␍
|
||||
$V0f635d0e = $this->_fm->_execute($V21ffce5b);␍
|
||||
if (FileMaker::isError($V0f635d0e)) {␍
|
||||
return $V0f635d0e;␍
|
||||
} ␍
|
||||
return $this->_getResult($V0f635d0e);␍
|
||||
}␍
|
||||
}␍
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php␍
|
||||
require_once dirname(__FILE__) . '/FindImpl.php';␍
|
||||
class FileMaker_Command_FindAny_Implementation extends FileMaker_Command_Find_Implementation␍
|
||||
{␍
|
||||
function FileMaker_Command_FindAny_Implementation($V0ab34ca9, $Vc6140495) {␍
|
||||
FileMaker_Command_Find_Implementation::FileMaker_Command_Find_Implementation($V0ab34ca9, $Vc6140495);␍
|
||||
}␍
|
||||
␍
|
||||
function &execute()␍
|
||||
{ ␍
|
||||
$V21ffce5b = $this->_getCommandParams(); ␍
|
||||
$V21ffce5b['-findany'] = true; ␍
|
||||
$V0f635d0e = $this->_fm->_execute($V21ffce5b);␍
|
||||
if (FileMaker::isError($V0f635d0e)) {␍
|
||||
return $V0f635d0e;␍
|
||||
} ␍
|
||||
return $this->_getResult($V0f635d0e);␍
|
||||
}␍
|
||||
}␍
|
||||
@@ -0,0 +1,120 @@
|
||||
<?php␍
|
||||
require_once dirname(__FILE__) . '/../CommandImpl.php';␍
|
||||
class FileMaker_Command_Find_Implementation extends FileMaker_Command_Implementation␍
|
||||
{␍
|
||||
var $_findCriteria = array();␍
|
||||
var $Vd65662c5 = array();␍
|
||||
var $Va9136a07 = array();␍
|
||||
var $Vf951bdce;␍
|
||||
var $V83f28691;␍
|
||||
var $V85fd701e;␍
|
||||
␍
|
||||
var $V6da136ea;␍
|
||||
var $V568aa2ec;␍
|
||||
function FileMaker_Command_Find_Implementation($V0ab34ca9, $Vc6140495)␍
|
||||
{␍
|
||||
FileMaker_Command_Implementation::FileMaker_Command_Implementation($V0ab34ca9, $Vc6140495);␍
|
||||
}␍
|
||||
function &execute()␍
|
||||
{ ␍
|
||||
$V21ffce5b = $this->_getCommandParams(); ␍
|
||||
$this->_setSortParams($V21ffce5b);␍
|
||||
$this->_setRangeParams($V21ffce5b);␍
|
||||
$this->_setRelatedSetsFilters($V21ffce5b); ␍
|
||||
if (count($this->_findCriteria) || $this->_recordId) {␍
|
||||
$V21ffce5b['-find'] = true;␍
|
||||
} else {␍
|
||||
$V21ffce5b['-findall'] = true;␍
|
||||
} ␍
|
||||
if ($this->_recordId) {␍
|
||||
$V21ffce5b['-recid'] = $this->_recordId;␍
|
||||
} ␍
|
||||
if ($this->Vf951bdce) {␍
|
||||
$V21ffce5b['-lop'] = $this->Vf951bdce;␍
|
||||
} ␍
|
||||
foreach ($this->_findCriteria as $Vd1148ee8 => $Ve9de89b0) {␍
|
||||
$V21ffce5b[$Vd1148ee8] = $Ve9de89b0;␍
|
||||
} ␍
|
||||
$V0f635d0e = $this->_fm->_execute($V21ffce5b);␍
|
||||
if (FileMaker::isError($V0f635d0e)) {␍
|
||||
return $V0f635d0e;␍
|
||||
} ␍
|
||||
return $this->_getResult($V0f635d0e);␍
|
||||
}␍
|
||||
function addFindCriterion($Vd1148ee8, $Ve9de89b0)␍
|
||||
{␍
|
||||
$this->_findCriteria[$Vd1148ee8] = $Ve9de89b0;␍
|
||||
}␍
|
||||
function clearFindCriteria()␍
|
||||
{␍
|
||||
$this->_findCriteria = array();␍
|
||||
}␍
|
||||
function addSortRule($Vd1148ee8, $Vffbd028a, $V70a17ffa = null)␍
|
||||
{␍
|
||||
$this->Vd65662c5[$Vffbd028a] = $Vd1148ee8;␍
|
||||
if ($V70a17ffa !== null) {␍
|
||||
$this->Va9136a07[$Vffbd028a] = $V70a17ffa;␍
|
||||
}␍
|
||||
}␍
|
||||
function clearSortRules()␍
|
||||
{␍
|
||||
$this->Vd65662c5= array();␍
|
||||
$this->Va9136a07= array();␍
|
||||
}␍
|
||||
function setLogicalOperator($V4b583376)␍
|
||||
{␍
|
||||
switch ($V4b583376) {␍
|
||||
case FILEMAKER_FIND_AND:␍
|
||||
case FILEMAKER_FIND_OR:␍
|
||||
$this->Vf951bdce= $V4b583376;␍
|
||||
break;␍
|
||||
}␍
|
||||
}␍
|
||||
function setRange($V08b43519 = 0, $V2ffe4e77 = null)␍
|
||||
{␍
|
||||
$this->V83f28691= $V08b43519;␍
|
||||
$this->V85fd701e= $V2ffe4e77;␍
|
||||
}␍
|
||||
function getRange()␍
|
||||
{␍
|
||||
return array('skip' => $this->V83f28691,␍
|
||||
'max' => $this->V85fd701e);␍
|
||||
}␍
|
||||
function setRelatedSetsFilters($Vdba51d08, $V01a8ebbf = null)␍
|
||||
{␍
|
||||
$this->V6da136ea= $Vdba51d08;␍
|
||||
$this->V568aa2ec= $V01a8ebbf;␍
|
||||
}␍
|
||||
function getRelatedSetsFilters()␍
|
||||
{␍
|
||||
return array('relatedsetsfilter' => $this->V6da136ea,␍
|
||||
'relatedsetsmax' => $this->V568aa2ec);␍
|
||||
}␍
|
||||
function _setRelatedSetsFilters(&$V21ffce5b)␍
|
||||
{␍
|
||||
if ($this->V6da136ea) {␍
|
||||
$V21ffce5b['-relatedsets.filter'] = $this->V6da136ea;␍
|
||||
}␍
|
||||
if ($this->V568aa2ec) {␍
|
||||
$V21ffce5b['-relatedsets.max'] = $this->V568aa2ec;␍
|
||||
}␍
|
||||
}␍
|
||||
function _setSortParams(&$V21ffce5b)␍
|
||||
{␍
|
||||
foreach ($this->Vd65662c5 as $Vffbd028a => $Vd1148ee8) {␍
|
||||
$V21ffce5b['-sortfield.' . $Vffbd028a] = $Vd1148ee8;␍
|
||||
}␍
|
||||
foreach ($this->Va9136a07 as $Vffbd028a => $V70a17ffa) {␍
|
||||
$V21ffce5b['-sortorder.' . $Vffbd028a] = $V70a17ffa;␍
|
||||
}␍
|
||||
}␍
|
||||
function _setRangeParams(&$V21ffce5b)␍
|
||||
{␍
|
||||
if ($this->V83f28691) {␍
|
||||
$V21ffce5b['-skip'] = $this->V83f28691;␍
|
||||
}␍
|
||||
if ($this->V85fd701e) {␍
|
||||
$V21ffce5b['-max'] = $this->V85fd701e;␍
|
||||
}␍
|
||||
}␍
|
||||
}␍
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php␍
|
||||
require_once dirname(__FILE__) . '/../CommandImpl.php';␍
|
||||
class FileMaker_Command_FindRequest_Implementation␍
|
||||
{␍
|
||||
var $_findCriteria = array();␍
|
||||
␍
|
||||
var $_omit;␍
|
||||
function FileMaker_Command_FindRequest_Implementation()␍
|
||||
{␍
|
||||
$this->_omit = false;␍
|
||||
}␍
|
||||
␍
|
||||
function addFindCriterion($Vd1148ee8, $Ve9de89b0)␍
|
||||
{␍
|
||||
$this->_findCriteria[$Vd1148ee8] = $Ve9de89b0;␍
|
||||
}␍
|
||||
function setOmit($V2063c160)␍
|
||||
{␍
|
||||
$this->_omit = $V2063c160;␍
|
||||
}␍
|
||||
␍
|
||||
function clearFindCriteria()␍
|
||||
{␍
|
||||
$this->_findCriteria = array();␍
|
||||
}␍
|
||||
}␍
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php␍
|
||||
require_once dirname(__FILE__) . '/../CommandImpl.php';␍
|
||||
class FileMaker_Command_PerformScript_Implementation extends FileMaker_Command_Implementation␍
|
||||
{␍
|
||||
function FileMaker_Command_PerformScript_Implementation($V0ab34ca9, $Vc6140495, $V2550889a, $V9b479e5e = null)␍
|
||||
{␍
|
||||
FileMaker_Command_Implementation::FileMaker_Command_Implementation($V0ab34ca9, $Vc6140495);␍
|
||||
$this->_script = $V2550889a;␍
|
||||
$this->_scriptParams = $V9b479e5e;␍
|
||||
}␍
|
||||
function execute()␍
|
||||
{ ␍
|
||||
$V21ffce5b = $this->_getCommandParams(); ␍
|
||||
$V21ffce5b['-findany'] = true; ␍
|
||||
$V0f635d0e = $this->_fm->_execute($V21ffce5b);␍
|
||||
if (FileMaker::isError($V0f635d0e)) {␍
|
||||
return $V0f635d0e;␍
|
||||
} ␍
|
||||
return $this->_getResult($V0f635d0e);␍
|
||||
}␍
|
||||
}␍
|
||||
@@ -0,0 +1,117 @@
|
||||
<?php␍
|
||||
require_once dirname(__FILE__) . '/../Error/Validation.php';␍
|
||||
require_once dirname(__FILE__) . '/../Result.php';␍
|
||||
class FileMaker_Command_Implementation {␍
|
||||
var $_fm;␍
|
||||
var $_layout;␍
|
||||
var $V7a2db0ea;␍
|
||||
var $_script;␍
|
||||
var $_scriptParams;␍
|
||||
var $_preReqScript;␍
|
||||
var $_preReqScriptParams;␍
|
||||
var $_preSortScript;␍
|
||||
var $_preSortScriptParams;␍
|
||||
var $V0b9a204c;␍
|
||||
var $_recordId;␍
|
||||
function FileMaker_Command_Implementation($V0ab34ca9, $Vc6140495) {␍
|
||||
$this->_fm =& $V0ab34ca9;␍
|
||||
$this->_layout = $Vc6140495; ␍
|
||||
$this->V0b9a204c= $V0ab34ca9->getProperty('recordClass');␍
|
||||
}␍
|
||||
function setResultLayout($Vc6140495) {␍
|
||||
$this->V7a2db0ea= $Vc6140495;␍
|
||||
}␍
|
||||
function setScript($V2550889a, $V9b479e5e = null) {␍
|
||||
$this->_script = $V2550889a;␍
|
||||
$this->_scriptParams = $V9b479e5e;␍
|
||||
}␍
|
||||
function setPreCommandScript($V2550889a, $V9b479e5e = null) {␍
|
||||
$this->_preReqScript = $V2550889a;␍
|
||||
$this->_preReqScriptParams = $V9b479e5e;␍
|
||||
}␍
|
||||
function setPreSortScript($V2550889a, $V9b479e5e = null) {␍
|
||||
$this->_preSortScript = $V2550889a;␍
|
||||
$this->_preSortScriptParams = $V9b479e5e;␍
|
||||
}␍
|
||||
function setRecordClass($V6f66e878) {␍
|
||||
$this->V0b9a204c= $V6f66e878;␍
|
||||
}␍
|
||||
function setRecordId($Va6ec9c02) {␍
|
||||
$this->_recordId = $Va6ec9c02;␍
|
||||
}␍
|
||||
function validate($V972bf3f0 = null) { ␍
|
||||
if (!is_a($this, 'FileMaker_Command_Add_Implementation') && !is_a($this, 'FileMaker_Command_Edit_Implementation')) {␍
|
||||
return true;␍
|
||||
}␍
|
||||
$Vc6140495 = & $this->_fm->getLayout($this->_layout);␍
|
||||
if (FileMaker :: isError($Vc6140495)) {␍
|
||||
return $Vc6140495;␍
|
||||
} ␍
|
||||
$Vcb5e100e = new FileMaker_Error_Validation($this->_fm);␍
|
||||
if ($V972bf3f0 === null) { ␍
|
||||
foreach ($Vc6140495->getFields() as $V972bf3f0 => $V06e3d36f) { ␍
|
||||
if (!isset ($this->_fields[$V972bf3f0]) || !count($this->_fields[$V972bf3f0])) {␍
|
||||
$Vf09cc7ee = array (␍
|
||||
0 => null␍
|
||||
);␍
|
||||
} else {␍
|
||||
$Vf09cc7ee = $this->_fields[$V972bf3f0];␍
|
||||
}␍
|
||||
foreach ($Vf09cc7ee as $V2063c160) {␍
|
||||
$Vcb5e100e = $V06e3d36f->validate($V2063c160, $Vcb5e100e);␍
|
||||
}␍
|
||||
}␍
|
||||
} else { ␍
|
||||
$V06e3d36f = & $Vc6140495->getField($V972bf3f0);␍
|
||||
if (FileMaker :: isError($V06e3d36f)) {␍
|
||||
return $V06e3d36f;␍
|
||||
} ␍
|
||||
if (!isset ($this->_fields[$V972bf3f0]) || !count($this->_fields[$V972bf3f0])) {␍
|
||||
$Vf09cc7ee = array (␍
|
||||
0 => null␍
|
||||
);␍
|
||||
} else {␍
|
||||
$Vf09cc7ee = $this->_fields[$V972bf3f0];␍
|
||||
}␍
|
||||
foreach ($Vf09cc7ee as $V2063c160) {␍
|
||||
$Vcb5e100e = $V06e3d36f->validate($V2063c160, $Vcb5e100e);␍
|
||||
}␍
|
||||
} ␍
|
||||
return $Vcb5e100e->numErrors() ? $Vcb5e100e : true;␍
|
||||
}␍
|
||||
function & _getResult($V0f635d0e) {␍
|
||||
$V3643b863 = new FileMaker_Parser_FMResultSet($this->_fm);␍
|
||||
$Vb4a88417 = $V3643b863->parse($V0f635d0e);␍
|
||||
if (FileMaker :: isError($Vb4a88417)) {␍
|
||||
return $Vb4a88417;␍
|
||||
}␍
|
||||
$Vd1fc8eaf = new FileMaker_Result($this->_fm);␍
|
||||
$Vb4a88417 = $V3643b863->setResult($Vd1fc8eaf, $this->V0b9a204c);␍
|
||||
if (FileMaker :: isError($Vb4a88417)) {␍
|
||||
return $Vb4a88417;␍
|
||||
}␍
|
||||
return $Vd1fc8eaf;␍
|
||||
}␍
|
||||
function _getCommandParams() { ␍
|
||||
$V21ffce5b = array (␍
|
||||
'-db' => $this->_fm->getProperty('database'␍
|
||||
), '-lay' => $this->_layout); ␍
|
||||
foreach (array (␍
|
||||
'_script' => '-script',␍
|
||||
'_preReqScript' => '-script.prefind',␍
|
||||
'_preSortScript' => '-script.presort'␍
|
||||
) as $Vb2145aac => $Veca07335) {␍
|
||||
if ($this-> $Vb2145aac) {␍
|
||||
$V21ffce5b[$Veca07335] = $this-> $Vb2145aac;␍
|
||||
$Vb2145aac .= 'Params';␍
|
||||
if ($this-> $Vb2145aac !== null) {␍
|
||||
$V21ffce5b[$Veca07335 . '.param'] = $this-> $Vb2145aac;␍
|
||||
}␍
|
||||
}␍
|
||||
} ␍
|
||||
if ($this->V7a2db0ea) {␍
|
||||
$V21ffce5b['-lay.response'] = $this->V7a2db0ea;␍
|
||||
}␍
|
||||
return $V21ffce5b;␍
|
||||
}␍
|
||||
}␍
|
||||
@@ -0,0 +1,344 @@
|
||||
<?php␍
|
||||
require_once dirname(__FILE__) . '/../Error/Validation.php';␍
|
||||
class FileMaker_Field_Implementation␍
|
||||
{␍
|
||||
var $_layout;␍
|
||||
var $_name;␍
|
||||
var $_autoEntered = false;␍
|
||||
var $_global = false;␍
|
||||
var $_maxRepeat = 1;␍
|
||||
var $_validationMask = 0;␍
|
||||
var $_validationRules = array();␍
|
||||
var $_result;␍
|
||||
var $_type;␍
|
||||
var $_valueList = null;␍
|
||||
var $_styleType;␍
|
||||
var $_maxCharacters = 0;␍
|
||||
function FileMaker_Field_Implementation(&$Vc6140495)␍
|
||||
{␍
|
||||
$this->_layout =& $Vc6140495;␍
|
||||
}␍
|
||||
function getName()␍
|
||||
{␍
|
||||
return $this->_name;␍
|
||||
}␍
|
||||
function &getLayout()␍
|
||||
{␍
|
||||
return $this->_layout;␍
|
||||
}␍
|
||||
function isAutoEntered()␍
|
||||
{␍
|
||||
return $this->_autoEntered;␍
|
||||
}␍
|
||||
function isGlobal()␍
|
||||
{␍
|
||||
return $this->_global;␍
|
||||
}␍
|
||||
function getRepetitionCount()␍
|
||||
{␍
|
||||
return $this->_maxRepeat;␍
|
||||
}␍
|
||||
function validate($V2063c160, $Vcb5e100e = null)␍
|
||||
{␍
|
||||
$V1c0c74f6 = true;␍
|
||||
if ($Vcb5e100e === null) {␍
|
||||
$V1c0c74f6 = false;␍
|
||||
$Vcb5e100e = new FileMaker_Error_Validation($this->_layout->_impl->_fm);␍
|
||||
}␍
|
||||
foreach ($this->getValidationRules() as $V981c1e7b) {␍
|
||||
switch ($V981c1e7b) {␍
|
||||
case FILEMAKER_RULE_NOTEMPTY:␍
|
||||
if (empty($V2063c160)) {␍
|
||||
$Vcb5e100e->addError($this, $V981c1e7b, $V2063c160);␍
|
||||
}␍
|
||||
break;␍
|
||||
case FILEMAKER_RULE_NUMERICONLY :␍
|
||||
if (!empty ($V2063c160)) {␍
|
||||
if ($this->checkNumericOnly($V2063c160)) {␍
|
||||
$Vcb5e100e->addError($this, $V981c1e7b, $V2063c160);␍
|
||||
}␍
|
||||
}␍
|
||||
break;␍
|
||||
case FILEMAKER_RULE_MAXCHARACTERS :␍
|
||||
if (!empty ($V2063c160)) {␍
|
||||
$V2fa47f7c = strlen($V2063c160);␍
|
||||
if ($V2fa47f7c > $this->_maxCharacters) {␍
|
||||
$Vcb5e100e->addError($this, $V981c1e7b, $V2063c160);␍
|
||||
}␍
|
||||
}␍
|
||||
break;␍
|
||||
case FILEMAKER_RULE_TIME_FIELD :␍
|
||||
if (!empty ($V2063c160)) {␍
|
||||
if (!$this->checkTimeFormat($V2063c160)) {␍
|
||||
␍
|
||||
$Vcb5e100e->addError($this, $V981c1e7b, $V2063c160);␍
|
||||
} else {␍
|
||||
$this->checkTimeValidity($V2063c160, $V981c1e7b, $Vcb5e100e, FALSE);␍
|
||||
}␍
|
||||
}␍
|
||||
break;␍
|
||||
case FILEMAKER_RULE_TIMESTAMP_FIELD :␍
|
||||
if (!empty ($V2063c160)) {␍
|
||||
if (!$this->checkTimeStampFormat($V2063c160)) {␍
|
||||
␍
|
||||
$Vcb5e100e->addError($this, $V981c1e7b, $V2063c160);␍
|
||||
} else {␍
|
||||
$this->checkDateValidity($V2063c160, $V981c1e7b, $Vcb5e100e);␍
|
||||
$this->checkTimeValidity($V2063c160, $V981c1e7b, $Vcb5e100e, FALSE);␍
|
||||
}␍
|
||||
}␍
|
||||
break;␍
|
||||
case FILEMAKER_RULE_DATE_FIELD :␍
|
||||
if (!empty ($V2063c160)) {␍
|
||||
if (!$this->checkDateFormat($V2063c160)) {␍
|
||||
␍
|
||||
$Vcb5e100e->addError($this, $V981c1e7b, $V2063c160);␍
|
||||
} else {␍
|
||||
$this->checkDateValidity($V2063c160, $V981c1e7b, $Vcb5e100e);␍
|
||||
}␍
|
||||
}␍
|
||||
break;␍
|
||||
case FILEMAKER_RULE_FOURDIGITYEAR :␍
|
||||
if (!empty ($V2063c160)) {␍
|
||||
switch ($this->_result) {␍
|
||||
case 'timestamp' : ␍
|
||||
if ($this->checkTimeStampFormatFourDigitYear($V2063c160)) { ␍
|
||||
preg_match('#^([0-9]{1,2})[-,/,\\\\]([0-9]{1,2})[-,/,\\\\]([0-9]{4})#', $V2063c160, $V9c28d32d);␍
|
||||
$V7436f942 = $V9c28d32d[1];␍
|
||||
$V628b7db0 = $V9c28d32d[2];␍
|
||||
$V84cdc76c = $V9c28d32d[3]; ␍
|
||||
if ($V84cdc76c < 1 || $V84cdc76c > 4000) {␍
|
||||
$Vcb5e100e->addError($this, $V981c1e7b, $V2063c160);␍
|
||||
} else␍
|
||||
if (!checkdate($V7436f942, $V628b7db0, $V84cdc76c)) {␍
|
||||
$Vcb5e100e->addError($this, $V981c1e7b, $V2063c160);␍
|
||||
} else { ␍
|
||||
$this->checkTimeValidity($V2063c160, $V981c1e7b, $Vcb5e100e, FALSE);␍
|
||||
}␍
|
||||
} else {␍
|
||||
␍
|
||||
$Vcb5e100e->addError($this, $V981c1e7b, $V2063c160);␍
|
||||
}␍
|
||||
break;␍
|
||||
default :␍
|
||||
preg_match('#([0-9]{1,2})[-,/,\\\\]([0-9]{1,2})[-,/,\\\\]([0-9]{1,4})#', $V2063c160, $V78f0805f);␍
|
||||
if (count($V78f0805f) != 3) {␍
|
||||
$Vcb5e100e->addError($this, $V981c1e7b, $V2063c160);␍
|
||||
} else {␍
|
||||
$V6c8f3f79 = strlen($V78f0805f[2]);␍
|
||||
if ($V6c8f3f79 != 4) { ␍
|
||||
$Vcb5e100e->addError($this, $V981c1e7b, $V2063c160);␍
|
||||
} else { ␍
|
||||
if ($V78f0805f[2] < 1 || $V78f0805f[2] > 4000) {␍
|
||||
$Vcb5e100e->addError($this, $V981c1e7b, $V2063c160);␍
|
||||
} else { ␍
|
||||
if (!checkdate($V78f0805f[0], $V78f0805f[1], $V78f0805f[2])) {␍
|
||||
$Vcb5e100e->addError($this, $V981c1e7b, $V2063c160);␍
|
||||
}␍
|
||||
}␍
|
||||
}␍
|
||||
}␍
|
||||
break;␍
|
||||
} ␍
|
||||
}␍
|
||||
break;␍
|
||||
case FILEMAKER_RULE_TIMEOFDAY :␍
|
||||
if (!empty ($V2063c160)) { ␍
|
||||
if ($this->checkTimeFormat($V2063c160)) { ␍
|
||||
$this->checkTimeValidity($V2063c160, $V981c1e7b, $Vcb5e100e, TRUE);␍
|
||||
} else {␍
|
||||
␍
|
||||
$Vcb5e100e->addError($this, $V981c1e7b, $V2063c160);␍
|
||||
}␍
|
||||
}␍
|
||||
break;␍
|
||||
} ␍
|
||||
} ␍
|
||||
if ($V1c0c74f6) {␍
|
||||
return $Vcb5e100e;␍
|
||||
} else { ␍
|
||||
return $Vcb5e100e->numErrors() ? $Vcb5e100e : true;␍
|
||||
}␍
|
||||
}␍
|
||||
␍
|
||||
function getLocalValidationRules() ␍
|
||||
{␍
|
||||
$V6b55d9ec = array ();␍
|
||||
foreach (array_keys($this->_validationRules) as $V981c1e7b) {␍
|
||||
switch ($V981c1e7b) {␍
|
||||
case FILEMAKER_RULE_NOTEMPTY :␍
|
||||
$V6b55d9ec[] = $V981c1e7b;␍
|
||||
break;␍
|
||||
case FILEMAKER_RULE_NUMERICONLY :␍
|
||||
$V6b55d9ec[] = $V981c1e7b;␍
|
||||
break;␍
|
||||
case FILEMAKER_RULE_MAXCHARACTERS :␍
|
||||
$V6b55d9ec[] = $V981c1e7b;␍
|
||||
break;␍
|
||||
case FILEMAKER_RULE_FOURDIGITYEAR :␍
|
||||
$V6b55d9ec[] = $V981c1e7b;␍
|
||||
break;␍
|
||||
case FILEMAKER_RULE_TIMEOFDAY :␍
|
||||
$V6b55d9ec[] = $V981c1e7b;␍
|
||||
break;␍
|
||||
case FILEMAKER_RULE_TIMESTAMP_FIELD :␍
|
||||
$V6b55d9ec[] = $V981c1e7b;␍
|
||||
break;␍
|
||||
case FILEMAKER_RULE_DATE_FIELD :␍
|
||||
$V6b55d9ec[] = $V981c1e7b;␍
|
||||
break;␍
|
||||
case FILEMAKER_RULE_TIME_FIELD :␍
|
||||
$V6b55d9ec[] = $V981c1e7b;␍
|
||||
break;␍
|
||||
}␍
|
||||
}␍
|
||||
return $V6b55d9ec;␍
|
||||
}␍
|
||||
function checkTimeStampFormatFourDigitYear($V2063c160) ␍
|
||||
{␍
|
||||
return (preg_match('#^[ ]*([0-9]{1,2})[-,/,\\\\]([0-9]{1,2})[-,/,\\\\]([0-9]{4})[ ]*([0-9]{1,2})[:]([0-9]{1,2})([:][0-9]{1,2})?([ ]*((AM|PM)|(am|pm)))?[ ]*$#', $V2063c160));␍
|
||||
}␍
|
||||
function checkTimeStampFormat($V2063c160) ␍
|
||||
{␍
|
||||
return (preg_match('#^[ ]*([0-9]{1,2})[-,/,\\\\]([0-9]{1,2})([-,/,\\\\]([0-9]{1,4}))?[ ]*([0-9]{1,2})[:]([0-9]{1,2})([:][0-9]{1,2})?([ ]*((AM|PM)|(am|pm)))?[ ]*$#', $V2063c160));␍
|
||||
}␍
|
||||
function checkDateFormat($V2063c160) ␍
|
||||
{␍
|
||||
return (preg_match('#^[ ]*([0-9]{1,2})[-,/,\\\\]([0-9]{1,2})([-,/,\\\\]([0-9]{1,4}))?[ ]*$#', $V2063c160));␍
|
||||
}␍
|
||||
function checkTimeFormat($V2063c160) ␍
|
||||
{␍
|
||||
return (preg_match('#^[ ]*([0-9]{1,2})[:]([0-9]{1,2})([:][0-9]{1,2})?([ ]*((AM|PM)|(am|pm)))?[ ]*$#', $V2063c160));␍
|
||||
}␍
|
||||
function checkNumericOnly($V2063c160) ␍
|
||||
{␍
|
||||
return (!is_numeric($V2063c160));␍
|
||||
}␍
|
||||
function checkDateValidity($V2063c160, $V981c1e7b, $Vcb5e100e) ␍
|
||||
{␍
|
||||
preg_match('#([0-9]{1,2})[-,/,\\\\]([0-9]{1,2})([-,/,\\\\]([0-9]{1,4}))?#', $V2063c160, $V78f0805f);␍
|
||||
if ($V78f0805f[4]) {␍
|
||||
$V6c8f3f79 = strlen($V78f0805f[4]);␍
|
||||
$V84cdc76c = $V78f0805f[4];␍
|
||||
if ($V6c8f3f79 != 4) {␍
|
||||
$V84cdc76c = $V84cdc76c +2000;␍
|
||||
} ␍
|
||||
if ($V78f0805f[4] < 1 || $V78f0805f[4] > 4000) {␍
|
||||
$Vcb5e100e->addError($this, $V981c1e7b, $V2063c160);␍
|
||||
} else { ␍
|
||||
if (!checkdate($V78f0805f[1], $V78f0805f[2], $V78f0805f[4])) {␍
|
||||
$Vcb5e100e->addError($this, $V981c1e7b, $V2063c160);␍
|
||||
}␍
|
||||
}␍
|
||||
} else {␍
|
||||
$V84cdc76c = date('Y');␍
|
||||
if (!checkdate($V78f0805f[1], $V78f0805f[2], $V84cdc76c)) {␍
|
||||
$Vcb5e100e->addError($this, $V981c1e7b, $V2063c160);␍
|
||||
}␍
|
||||
}␍
|
||||
}␍
|
||||
function checkTimeValidity($V2063c160, $V981c1e7b, $Vcb5e100e, $Vcaf85b7b) ␍
|
||||
{␍
|
||||
$V52124c01 = 0;␍
|
||||
if ($Vcaf85b7b) {␍
|
||||
$V52124c01 = 12;␍
|
||||
} else {␍
|
||||
$V52124c01 = 24;␍
|
||||
} ␍
|
||||
preg_match('#([0-9]{1,2})[:]([0-9]{1,2})[:]?([0-9]{1,2})?#', $V2063c160, $V9c28d32d);␍
|
||||
$V896c55cc = $V9c28d32d[1];␍
|
||||
$V640fd0cc = $V9c28d32d[2];␍
|
||||
if (count($V9c28d32d) >= 4) {␍
|
||||
$V783e8e29 = $V9c28d32d[3];␍
|
||||
} ␍
|
||||
if ($V896c55cc < 0 || $V896c55cc > $V52124c01) {␍
|
||||
$Vcb5e100e->addError($this, $V981c1e7b, $V2063c160);␍
|
||||
} else if ($V640fd0cc < 0 || $V640fd0cc > 59) {␍
|
||||
$Vcb5e100e->addError($this, $V981c1e7b, $V2063c160);␍
|
||||
} else␍
|
||||
if (isset($V783e8e29)) {␍
|
||||
if ($V783e8e29 < 0 || $V783e8e29 > 59)␍
|
||||
$Vcb5e100e->addError($this, $V981c1e7b, $V2063c160);␍
|
||||
}␍
|
||||
}␍
|
||||
function getValidationRules()␍
|
||||
{␍
|
||||
return array_keys($this->_validationRules);␍
|
||||
}␍
|
||||
function getValidationMask()␍
|
||||
{␍
|
||||
return $this->_validationMask;␍
|
||||
}␍
|
||||
function hasValidationRule($Ve289cc97)␍
|
||||
{␍
|
||||
return $Ve289cc97 & $this->_validationMask;␍
|
||||
}␍
|
||||
function describeValidationRule($Ve289cc97)␍
|
||||
{␍
|
||||
if (is_array($this->_validationRules[$Ve289cc97])) {␍
|
||||
return $this->_validationRules[$Ve289cc97];␍
|
||||
}␍
|
||||
return null;␍
|
||||
}␍
|
||||
function describeLocalValidationRules() ␍
|
||||
{␍
|
||||
$V6b55d9ec = array ();␍
|
||||
foreach ($this->_validationRules as $V981c1e7b => $V1dee80c7) {␍
|
||||
switch ($V981c1e7b) {␍
|
||||
case FILEMAKER_RULE_NOTEMPTY :␍
|
||||
$V6b55d9ec[$V981c1e7b] = $V1dee80c7;␍
|
||||
break;␍
|
||||
case FILEMAKER_RULE_NUMERICONLY :␍
|
||||
$V6b55d9ec[$V981c1e7b] = $V1dee80c7;␍
|
||||
break;␍
|
||||
case FILEMAKER_RULE_MAXCHARACTERS :␍
|
||||
$V6b55d9ec[$V981c1e7b] = $V1dee80c7;␍
|
||||
break;␍
|
||||
case FILEMAKER_RULE_FOURDIGITYEAR :␍
|
||||
$V6b55d9ec[$V981c1e7b] = $V1dee80c7;␍
|
||||
break;␍
|
||||
case FILEMAKER_RULE_TIMEOFDAY :␍
|
||||
$V6b55d9ec[$V981c1e7b] = $V1dee80c7;␍
|
||||
break;␍
|
||||
case FILEMAKER_RULE_TIMESTAMP_FIELD :␍
|
||||
$V6b55d9ec[$V981c1e7b] = $V1dee80c7;␍
|
||||
break;␍
|
||||
case FILEMAKER_RULE_DATE_FIELD :␍
|
||||
$V6b55d9ec[$V981c1e7b] = $V1dee80c7;␍
|
||||
break;␍
|
||||
case FILEMAKER_RULE_TIME_FIELD :␍
|
||||
$V6b55d9ec[$V981c1e7b] = $V1dee80c7;␍
|
||||
break;␍
|
||||
}␍
|
||||
}␍
|
||||
return $V6b55d9ec;␍
|
||||
}␍
|
||||
function describeValidationRules()␍
|
||||
{␍
|
||||
return $this->_validationRules;␍
|
||||
}␍
|
||||
function getResult()␍
|
||||
{␍
|
||||
return $this->_result;␍
|
||||
}␍
|
||||
function getType()␍
|
||||
{␍
|
||||
return $this->_type;␍
|
||||
}␍
|
||||
function getValueList($Vd33e904c = null)␍
|
||||
{␍
|
||||
$Vb4a88417 = $this->_layout->loadExtendedInfo($Vd33e904c);␍
|
||||
if (FileMaker::isError($Vb4a88417)) {␍
|
||||
return $Vb4a88417;␍
|
||||
}␍
|
||||
return $this->_layout->getValueList($this->_valueList);␍
|
||||
}␍
|
||||
function getStyleType()␍
|
||||
{␍
|
||||
$Vb4a88417 = $this->_layout->loadExtendedInfo();␍
|
||||
if (FileMaker::isError($Vb4a88417)) {␍
|
||||
return $Vb4a88417;␍
|
||||
}␍
|
||||
return $this->_styleType;␍
|
||||
}␍
|
||||
}␍
|
||||
@@ -0,0 +1,466 @@
|
||||
<?php␍
|
||||
require_once dirname(__FILE__) . '/Parser/FMResultSet.php';␍
|
||||
class FileMaker_Implementation␍
|
||||
{␍
|
||||
var $V73ee434e = array('charset' => 'utf-8');␍
|
||||
var $Vea4b3413 = null;␍
|
||||
␍
|
||||
var $V9a3dcbce;␍
|
||||
function getAPIVersion()␍
|
||||
{␍
|
||||
return '1.1';␍
|
||||
}␍
|
||||
static function getMinServerVersion()␍
|
||||
{␍
|
||||
return '10.0.0.0';␍
|
||||
}␍
|
||||
function FileMaker_Implementation($V11e0eed8, $Vccd0e374, $V14c4b06b, $V5f4dcc3b)␍
|
||||
{␍
|
||||
$V07cc694b = time();␍
|
||||
if ((@include dirname(__FILE__) . '/../conf/filemaker-api.php') && isset($__FM_CONFIG)) {␍
|
||||
foreach ($__FM_CONFIG as $V23a5b8ab => $V2063c160) {␍
|
||||
$this->setProperty($V23a5b8ab, $V2063c160);␍
|
||||
}␍
|
||||
}␍
|
||||
if (!is_null($Vccd0e374)) {␍
|
||||
$this->setProperty('hostspec', $Vccd0e374);␍
|
||||
}␍
|
||||
if (!is_null($V11e0eed8)) {␍
|
||||
$this->setProperty('database', $V11e0eed8);␍
|
||||
}␍
|
||||
if (!is_null($V14c4b06b)) {␍
|
||||
$this->setProperty('username', $V14c4b06b);␍
|
||||
}␍
|
||||
if (!is_null($V5f4dcc3b)) {␍
|
||||
$this->setProperty('password', $V5f4dcc3b);␍
|
||||
}␍
|
||||
}␍
|
||||
function setProperty($V23a5b8ab, $V2063c160)␍
|
||||
{␍
|
||||
$this->V73ee434e[$V23a5b8ab] = $V2063c160;␍
|
||||
}␍
|
||||
function getProperty($V23a5b8ab)␍
|
||||
{␍
|
||||
return isset($this->V73ee434e[$V23a5b8ab]) ? $this->V73ee434e[$V23a5b8ab] : null;␍
|
||||
}␍
|
||||
function getProperties()␍
|
||||
{␍
|
||||
return $this->V73ee434e;␍
|
||||
}␍
|
||||
function setLogger(&$V6db435f3)␍
|
||||
{␍
|
||||
if (!is_a($V6db435f3, 'Log')) {␍
|
||||
return new FileMaker_Error($this, 'setLogger() must be passed an instance of PEAR::Log');␍
|
||||
}␍
|
||||
$this->Vea4b3413=& $V6db435f3;␍
|
||||
}␍
|
||||
function log($V78e73102, $Vc9e9a848)␍
|
||||
{␍
|
||||
if ($this->Vea4b3413=== null) {␍
|
||||
return;␍
|
||||
}␍
|
||||
$Ve4aa4dcd = $this->getProperty('logLevel');␍
|
||||
if ($Ve4aa4dcd === null || $Vc9e9a848 > $Ve4aa4dcd) {␍
|
||||
return;␍
|
||||
}␍
|
||||
switch ($Vc9e9a848) {␍
|
||||
case FILEMAKER_LOG_DEBUG:␍
|
||||
$this->Vea4b3413->log($V78e73102, PEAR_LOG_DEBUG);␍
|
||||
break;␍
|
||||
case FILEMAKER_LOG_INFO:␍
|
||||
$this->Vea4b3413->log($V78e73102, PEAR_LOG_INFO);␍
|
||||
break;␍
|
||||
case FILEMAKER_LOG_ERR:␍
|
||||
$this->Vea4b3413->log($V78e73102, PEAR_LOG_ERR);␍
|
||||
break;␍
|
||||
}␍
|
||||
}␍
|
||||
function toOutputCharset($V1d770934)␍
|
||||
{␍
|
||||
if (strtolower($this->getProperty('charset')) != 'iso-8859-1') {␍
|
||||
return $V1d770934;␍
|
||||
}␍
|
||||
if (is_array($V1d770934)) {␍
|
||||
$Vfa816edb = array();␍
|
||||
foreach ($V1d770934 as $V3c6e0b8a => $V3a6d0284) {␍
|
||||
$Vfa816edb[$this->toOutputCharset($V3c6e0b8a)] = $this->toOutputCharset($V3a6d0284);␍
|
||||
}␍
|
||||
return $Vfa816edb;␍
|
||||
}␍
|
||||
if (!is_string($V1d770934)) {␍
|
||||
return $V1d770934;␍
|
||||
}␍
|
||||
return utf8_decode($V1d770934);␍
|
||||
}␍
|
||||
function &newAddCommand($Vc6140495, $Vf09cc7ee = array())␍
|
||||
{␍
|
||||
require_once dirname(__FILE__) . '/../Command/Add.php';␍
|
||||
$Vab4d0a65 = new FileMaker_Command_Add($this, $Vc6140495, $Vf09cc7ee);␍
|
||||
return $Vab4d0a65;␍
|
||||
}␍
|
||||
function &newEditCommand($Vc6140495, $Va6ec9c02, $Va0af1e2b = array())␍
|
||||
{␍
|
||||
require_once dirname(__FILE__) . '/../Command/Edit.php';␍
|
||||
$Vab4d0a65 = new FileMaker_Command_Edit($this, $Vc6140495, $Va6ec9c02, $Va0af1e2b);␍
|
||||
return $Vab4d0a65;␍
|
||||
}␍
|
||||
function &newDeleteCommand($Vc6140495, $Va6ec9c02)␍
|
||||
{␍
|
||||
require_once dirname(__FILE__) . '/../Command/Delete.php';␍
|
||||
$Vab4d0a65 = new FileMaker_Command_Delete($this, $Vc6140495, $Va6ec9c02);␍
|
||||
return $Vab4d0a65;␍
|
||||
}␍
|
||||
function &newDuplicateCommand($Vc6140495, $Va6ec9c02)␍
|
||||
{␍
|
||||
require_once dirname(__FILE__) . '/../Command/Duplicate.php';␍
|
||||
$Vab4d0a65 = new FileMaker_Command_Duplicate($this, $Vc6140495, $Va6ec9c02);␍
|
||||
return $Vab4d0a65;␍
|
||||
}␍
|
||||
function &newFindCommand($Vc6140495)␍
|
||||
{␍
|
||||
require_once dirname(__FILE__) . '/../Command/Find.php';␍
|
||||
$Vab4d0a65 = new FileMaker_Command_Find($this, $Vc6140495);␍
|
||||
return $Vab4d0a65;␍
|
||||
}␍
|
||||
␍
|
||||
function &newCompoundFindCommand($Vc6140495)␍
|
||||
{␍
|
||||
require_once dirname(__FILE__) . '/../Command/CompoundFind.php';␍
|
||||
$Vcdaeeeba = new FileMaker_Command_CompoundFind($this, $Vc6140495);␍
|
||||
return $Vcdaeeeba;␍
|
||||
␍
|
||||
}␍
|
||||
␍
|
||||
function &newFindRequest($Vc6140495)␍
|
||||
{␍
|
||||
require_once dirname(__FILE__) . '/../Command/FindRequest.php';␍
|
||||
$Vab4d0a65 = new FileMaker_Command_FindRequest($this, $Vc6140495);␍
|
||||
return $Vab4d0a65;␍
|
||||
␍
|
||||
}␍
|
||||
␍
|
||||
function &newFindAnyCommand($Vc6140495)␍
|
||||
{␍
|
||||
require_once dirname(__FILE__) . '/../Command/FindAny.php';␍
|
||||
$Vab4d0a65 = new FileMaker_Command_FindAny($this, $Vc6140495);␍
|
||||
return $Vab4d0a65;␍
|
||||
}␍
|
||||
function &newFindAllCommand($Vc6140495)␍
|
||||
{␍
|
||||
require_once dirname(__FILE__) . '/../Command/FindAll.php';␍
|
||||
$Vab4d0a65 = new FileMaker_Command_FindAll($this, $Vc6140495);␍
|
||||
return $Vab4d0a65;␍
|
||||
}␍
|
||||
function &newPerformScriptCommand($Vc6140495, $V2550889a, $V9b479e5e = null)␍
|
||||
{␍
|
||||
require_once dirname(__FILE__) . '/../Command/PerformScript.php';␍
|
||||
$Vab4d0a65 = new FileMaker_Command_PerformScript($this, $Vc6140495, $V2550889a, $V9b479e5e);␍
|
||||
return $Vab4d0a65;␍
|
||||
}␍
|
||||
function &createRecord($Vf43ac2d2, $Vfe0f78a8 = array())␍
|
||||
{␍
|
||||
$Vc6140495 =& $this->getLayout($Vf43ac2d2);␍
|
||||
if (FileMaker::isError($Vc6140495)) {␍
|
||||
return $Vc6140495;␍
|
||||
}␍
|
||||
$Vde17f0f2 = new $this->V73ee434e['recordClass']($Vc6140495);␍
|
||||
if (is_array($Vfe0f78a8)) {␍
|
||||
foreach ($Vfe0f78a8 as $V3c6e0b8a => $V2063c160) {␍
|
||||
if (is_array($V2063c160)) {␍
|
||||
foreach ($V2063c160 as $V6d786dc7 => $Vb5528fe6) {␍
|
||||
$Vde17f0f2->setField($V3c6e0b8a, $Vb5528fe6, $V6d786dc7);␍
|
||||
}␍
|
||||
} else {␍
|
||||
$Vde17f0f2->setField($V3c6e0b8a, $V2063c160);␍
|
||||
}␍
|
||||
}␍
|
||||
}␍
|
||||
return $Vde17f0f2;␍
|
||||
}␍
|
||||
function &getRecordById($Vc6140495, $Va6ec9c02)␍
|
||||
{␍
|
||||
$V10573b87 =& $this->newFindCommand($Vc6140495);␍
|
||||
$V10573b87->setRecordId($Va6ec9c02);␍
|
||||
$Vd1fc8eaf = $V10573b87->execute();␍
|
||||
if (FileMaker::isError($Vd1fc8eaf)) {␍
|
||||
return $Vd1fc8eaf;␍
|
||||
}␍
|
||||
$V6e52c40b =& $Vd1fc8eaf->getRecords();␍
|
||||
if (!$V6e52c40b) {␍
|
||||
$Vcb5e100e = new FileMaker_Error($this, 'Record . ' . $Va6ec9c02 . ' not found in layout "' . $Vc6140495 . '".');␍
|
||||
return $Vcb5e100e;␍
|
||||
}␍
|
||||
return $V6e52c40b[0];␍
|
||||
}␍
|
||||
function &getLayout($Vf43ac2d2)␍
|
||||
{ ␍
|
||||
static $V34d59fda = array();␍
|
||||
if (isset($V34d59fda[$Vf43ac2d2])) {␍
|
||||
return $V34d59fda[$Vf43ac2d2];␍
|
||||
}␍
|
||||
$V0f635d0e = $this->_execute(array('-db' => $this->getProperty('database'),␍
|
||||
'-lay' => $Vf43ac2d2,␍
|
||||
'-view' => true));␍
|
||||
if (FileMaker::isError($V0f635d0e)) {␍
|
||||
return $V0f635d0e;␍
|
||||
}␍
|
||||
$V3643b863 = new FileMaker_Parser_FMResultSet($this);␍
|
||||
$Vb4a88417 = $V3643b863->parse($V0f635d0e);␍
|
||||
if (FileMaker::isError($Vb4a88417)) {␍
|
||||
return $Vb4a88417;␍
|
||||
}␍
|
||||
$Vc6140495 = new FileMaker_Layout($this);␍
|
||||
$Vb4a88417 = $V3643b863->setLayout($Vc6140495);␍
|
||||
if (FileMaker::isError($Vb4a88417)) {␍
|
||||
return $Vb4a88417;␍
|
||||
}␍
|
||||
$V34d59fda[$Vf43ac2d2] =& $Vc6140495;␍
|
||||
return $Vc6140495;␍
|
||||
}␍
|
||||
function listDatabases()␍
|
||||
{␍
|
||||
$V0f635d0e = $this->_execute(array('-dbnames' => true));␍
|
||||
if (FileMaker::isError($V0f635d0e)) {␍
|
||||
return $V0f635d0e;␍
|
||||
}␍
|
||||
$V3643b863 = new FileMaker_Parser_fmresultset($this);␍
|
||||
$Vb4a88417 = $V3643b863->parse($V0f635d0e);␍
|
||||
if (FileMaker::isError($Vb4a88417)) {␍
|
||||
return $Vb4a88417;␍
|
||||
}␍
|
||||
$Ve61ce306 = array();␍
|
||||
foreach ($V3643b863->V6e52c40b as $V0b2c082c) {␍
|
||||
$Ve61ce306[] = $V0b2c082c['fields']['DATABASE_NAME'][0];␍
|
||||
}␍
|
||||
return $Ve61ce306;␍
|
||||
}␍
|
||||
function listScripts()␍
|
||||
{␍
|
||||
$V0f635d0e = $this->_execute(array('-db' => $this->getProperty('database'),␍
|
||||
'-scriptnames' => true));␍
|
||||
if (FileMaker::isError($V0f635d0e)) {␍
|
||||
return $V0f635d0e;␍
|
||||
}␍
|
||||
$V3643b863 = new FileMaker_Parser_FMResultSet($this);␍
|
||||
$Vb4a88417 = $V3643b863->parse($V0f635d0e);␍
|
||||
if (FileMaker::isError($Vb4a88417)) {␍
|
||||
return $Vb4a88417;␍
|
||||
}␍
|
||||
$Vd6c5855a = array();␍
|
||||
foreach ($V3643b863->V6e52c40b as $V0b2c082c) {␍
|
||||
$Vd6c5855a[] = $V0b2c082c['fields']['SCRIPT_NAME'][0];␍
|
||||
}␍
|
||||
return $Vd6c5855a;␍
|
||||
}␍
|
||||
function listLayouts()␍
|
||||
{␍
|
||||
$V0f635d0e = $this->_execute(array('-db' => $this->getProperty('database'),␍
|
||||
'-layoutnames' => true));␍
|
||||
if (FileMaker::isError($V0f635d0e)) {␍
|
||||
return $V0f635d0e;␍
|
||||
}␍
|
||||
$V3643b863 = new FileMaker_Parser_FMResultSet($this);␍
|
||||
$Vb4a88417 = $V3643b863->parse($V0f635d0e);␍
|
||||
if (FileMaker::isError($Vb4a88417)) {␍
|
||||
return $Vb4a88417;␍
|
||||
}␍
|
||||
$V34d59fda = array();␍
|
||||
foreach ($V3643b863->V6e52c40b as $V0b2c082c) {␍
|
||||
$V34d59fda[] = $V0b2c082c['fields']['LAYOUT_NAME'][0];␍
|
||||
}␍
|
||||
return $V34d59fda;␍
|
||||
}␍
|
||||
function getContainerData($V9305b73d)␍
|
||||
{ ␍
|
||||
if (!function_exists('curl_init')) {␍
|
||||
return new FileMaker_Error($this, 'cURL is required to use the FileMaker API.');␍
|
||||
}␍
|
||||
if (strncasecmp($V9305b73d, '/fmi/xml/cnt', 11) != 0) {␍
|
||||
return new FileMaker_Error($this, 'getContainerData() does not support remote containers');␍
|
||||
}␍
|
||||
else {␍
|
||||
$V572d4e42 = $this->getProperty('hostspec');␍
|
||||
if (substr($V572d4e42, -1, 1) == '/') {␍
|
||||
$V572d4e42 = substr($V572d4e42, 0, -1);␍
|
||||
}␍
|
||||
$V572d4e42 .= $V9305b73d; ␍
|
||||
$V572d4e42 = htmlspecialchars_decode($V572d4e42); ␍
|
||||
$V572d4e42 = str_replace(" ", "%20", $V572d4e42);␍
|
||||
}␍
|
||||
$this->log('Request for ' . $V572d4e42, FILEMAKER_LOG_INFO); ␍
|
||||
$Vd88fc6ed = curl_init($V572d4e42);␍
|
||||
␍
|
||||
curl_setopt($Vd88fc6ed, CURLOPT_RETURNTRANSFER, true);␍
|
||||
curl_setopt($Vd88fc6ed, CURLOPT_FAILONERROR, true);␍
|
||||
$V81c939b1 = FALSE;␍
|
||||
if (!headers_sent())␍
|
||||
{␍
|
||||
$V81c939b1 = TRUE;␍
|
||||
curl_setopt($Vd88fc6ed, CURLOPT_HEADER, true);␍
|
||||
}␍
|
||||
$this->_setCurlWPCSessionCookie($Vd88fc6ed); ␍
|
||||
␍
|
||||
if ($this->getProperty('username')) { ␍
|
||||
$V313225f0 = base64_encode($this->getProperty('username'). ':' . $this->getProperty('password'));␍
|
||||
$V44914468 = array('Authorization: Basic ' . $V313225f0, 'X-FMI-PE-ExtendedPrivilege: IrG6U+Rx0F5bLIQCUb9gOw==');␍
|
||||
curl_setopt($Vd88fc6ed, CURLOPT_HTTPHEADER, $V44914468);␍
|
||||
}␍
|
||||
else {␍
|
||||
curl_setopt($Vd88fc6ed, CURLOPT_HTTPHEADER, array('X-FMI-PE-ExtendedPrivilege: IrG6U+Rx0F5bLIQCUb9gOw=='));␍
|
||||
} ␍
|
||||
if ($V93da65a9 = $this->getProperty('curlOptions')) {␍
|
||||
foreach ($V93da65a9 as $Vef3e30e0 => $V2063c160) {␍
|
||||
curl_setopt($Vd88fc6ed, $Vef3e30e0, $V2063c160);␍
|
||||
}␍
|
||||
} ␍
|
||||
$Vd1fc8eaf = curl_exec($Vd88fc6ed);␍
|
||||
$this->_setClientWPCSessionCookie($Vd1fc8eaf);␍
|
||||
if ($V81c939b1)␍
|
||||
{ ␍
|
||||
$Vd1fc8eaf = $this->_eliminateContainerHeader($Vd1fc8eaf); ␍
|
||||
}␍
|
||||
$this->log($Vd1fc8eaf, FILEMAKER_LOG_DEBUG); ␍
|
||||
if ($V70106d0d = curl_errno($Vd88fc6ed)) {␍
|
||||
return new FileMaker_Error($this, 'Communication Error: (' . $V70106d0d . ') ' . curl_error($Vd88fc6ed));␍
|
||||
}␍
|
||||
curl_close($Vd88fc6ed);␍
|
||||
return $Vd1fc8eaf;␍
|
||||
}␍
|
||||
function _execute($Vf7cc8e48, $Vb3d1bd6a = 'fmresultset')␍
|
||||
{ ␍
|
||||
if (!function_exists('curl_init')) {␍
|
||||
return new FileMaker_Error($this, 'cURL is required to use the FileMaker API.');␍
|
||||
} ␍
|
||||
$Ve0c6dcf8 = array();␍
|
||||
foreach ($Vf7cc8e48 as $V3c6e0b8a => $V3a6d0284) {␍
|
||||
if (strtolower($this->getProperty('charset')) != 'utf-8' && $V3a6d0284 !== true) {␍
|
||||
$V3a6d0284 = utf8_encode($V3a6d0284);␍
|
||||
}␍
|
||||
$Ve0c6dcf8[] = urlencode($V3c6e0b8a) . ($V3a6d0284 === true ? '' : '=' . urlencode($V3a6d0284));␍
|
||||
} ␍
|
||||
$V572d4e42 = $this->getProperty('hostspec');␍
|
||||
if (substr($V572d4e42, -1, 1) != '/') {␍
|
||||
$V572d4e42 .= '/';␍
|
||||
}␍
|
||||
$V572d4e42 .= 'fmi/xml/' . $Vb3d1bd6a . '.xml'; ␍
|
||||
$this->log('Request for ' . $V572d4e42, FILEMAKER_LOG_INFO); ␍
|
||||
$Vd88fc6ed = curl_init($V572d4e42);␍
|
||||
curl_setopt($Vd88fc6ed, CURLOPT_POST, true);␍
|
||||
curl_setopt($Vd88fc6ed, CURLOPT_RETURNTRANSFER, true);␍
|
||||
curl_setopt($Vd88fc6ed, CURLOPT_FAILONERROR, true);␍
|
||||
$V81c939b1 = FALSE;␍
|
||||
if (!headers_sent())␍
|
||||
{␍
|
||||
$V81c939b1 = TRUE;␍
|
||||
curl_setopt($Vd88fc6ed, CURLOPT_HEADER, true);␍
|
||||
}␍
|
||||
$this->_setCurlWPCSessionCookie($Vd88fc6ed); ␍
|
||||
␍
|
||||
if ($this->getProperty('username')) { ␍
|
||||
$V313225f0 = base64_encode(utf8_decode($this->getProperty('username')). ':' . utf8_decode($this->getProperty('password')));␍
|
||||
$V44914468 = 'Authorization: Basic ' . $V313225f0;␍
|
||||
curl_setopt($Vd88fc6ed, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded; charset=utf-8', 'X-FMI-PE-ExtendedPrivilege: IrG6U+Rx0F5bLIQCUb9gOw==', $V44914468));␍
|
||||
}else{␍
|
||||
curl_setopt($Vd88fc6ed, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded; charset=utf-8', 'X-FMI-PE-ExtendedPrivilege: IrG6U+Rx0F5bLIQCUb9gOw=='));␍
|
||||
}␍
|
||||
␍
|
||||
curl_setopt($Vd88fc6ed, CURLOPT_POSTFIELDS, implode('&', $Ve0c6dcf8)); ␍
|
||||
if ($V93da65a9 = $this->getProperty('curlOptions')) {␍
|
||||
foreach ($V93da65a9 as $Vef3e30e0 => $V2063c160) {␍
|
||||
curl_setopt($Vd88fc6ed, $Vef3e30e0, $V2063c160);␍
|
||||
}␍
|
||||
} ␍
|
||||
$Vd1fc8eaf = curl_exec($Vd88fc6ed);␍
|
||||
$this->_setClientWPCSessionCookie($Vd1fc8eaf);␍
|
||||
if ($V81c939b1)␍
|
||||
{ ␍
|
||||
$Vd1fc8eaf = $this->_eliminateXMLHeader($Vd1fc8eaf); ␍
|
||||
}␍
|
||||
$this->log($Vd1fc8eaf, FILEMAKER_LOG_DEBUG); ␍
|
||||
if ($V70106d0d = curl_errno($Vd88fc6ed)) {␍
|
||||
␍
|
||||
if($V70106d0d == 52){␍
|
||||
return new FileMaker_Error($this, 'Communication Error: (' . $V70106d0d . ') ' . curl_error($Vd88fc6ed) . ' - The Web Publishing Core and/or FileMaker Server services are not running.', $V70106d0d);␍
|
||||
}else if($V70106d0d == 22){ ␍
|
||||
if (stristr("50", curl_error($Vd88fc6ed))) {␍
|
||||
return new FileMaker_Error($this, 'Communication Error: (' . $V70106d0d . ') ' . curl_error($Vd88fc6ed) . ' - The Web Publishing Core and/or FileMaker Server services are not running.', $V70106d0d);␍
|
||||
}else{␍
|
||||
return new FileMaker_Error($this, 'Communication Error: (' . $V70106d0d . ') ' . curl_error($Vd88fc6ed) . ' - This can be due to an invalid username or password, or if the FMPHP privilege is not enabled for that user.', $V70106d0d);␍
|
||||
}␍
|
||||
}else{␍
|
||||
return new FileMaker_Error($this, 'Communication Error: (' . $V70106d0d . ') ' . curl_error($Vd88fc6ed), $V70106d0d);␍
|
||||
}␍
|
||||
}␍
|
||||
curl_close($Vd88fc6ed);␍
|
||||
␍
|
||||
return $Vd1fc8eaf;␍
|
||||
}␍
|
||||
function getContainerDataURL($V781b3578)␍
|
||||
{␍
|
||||
if (strncasecmp($V781b3578, '/fmi/xml/cnt', 11) != 0) {␍
|
||||
$Va351dce6 = htmlspecialchars_decode($V781b3578);␍
|
||||
}␍
|
||||
else {␍
|
||||
$Va351dce6 = $this->getProperty('hostspec');␍
|
||||
if (substr($Va351dce6, -1, 1) == '/') {␍
|
||||
$Va351dce6 = substr($Va351dce6, 0, -1);␍
|
||||
}␍
|
||||
$Va351dce6 .= $V781b3578;␍
|
||||
$Va351dce6 = htmlspecialchars_decode($Va351dce6);␍
|
||||
}␍
|
||||
return $Va351dce6;␍
|
||||
}␍
|
||||
function _setCurlWPCSessionCookie($Vd88fc6ed)␍
|
||||
{␍
|
||||
if (isset($_COOKIE["WPCSessionID"])) {␍
|
||||
$Vd06f6e6e = $_COOKIE["WPCSessionID"]; ␍
|
||||
if (!is_null($Vd06f6e6e)) {␍
|
||||
$V0fbf52c7 = "WPCSessionID=".$Vd06f6e6e;␍
|
||||
curl_setopt($Vd88fc6ed, CURLOPT_COOKIE, $V0fbf52c7);␍
|
||||
}␍
|
||||
}␍
|
||||
}␍
|
||||
function _setClientWPCSessionCookie($Vd1fc8eaf)␍
|
||||
{␍
|
||||
$V81c939b1 = preg_match('/WPCSessionID=(\d+?);/m', $Vd1fc8eaf, $V6da3345e);␍
|
||||
if ($V81c939b1) {␍
|
||||
setcookie("WPCSessionID", $V6da3345e[1]);␍
|
||||
}␍
|
||||
}␍
|
||||
function _getContentLength($Vd1fc8eaf)␍
|
||||
{␍
|
||||
$V81c939b1 = preg_match('/Content-Length: (\d+)/', $Vd1fc8eaf, $V6da3345e);␍
|
||||
if ($V81c939b1) {␍
|
||||
return $V6da3345e[1];␍
|
||||
}␍
|
||||
else␍
|
||||
{␍
|
||||
return -1;␍
|
||||
}␍
|
||||
}␍
|
||||
function _eliminateXMLHeader($Vd1fc8eaf)␍
|
||||
{␍
|
||||
$V81c939b1 = strpos($Vd1fc8eaf, "<?xml");␍
|
||||
if ($V81c939b1 !== false)␍
|
||||
{␍
|
||||
return substr($Vd1fc8eaf, $V81c939b1);␍
|
||||
}␍
|
||||
else␍
|
||||
{␍
|
||||
return $Vd1fc8eaf;␍
|
||||
}␍
|
||||
}␍
|
||||
function _eliminateContainerHeader($Vd1fc8eaf)␍
|
||||
{␍
|
||||
$V04d77ddd = strlen("\r\n\r\n");␍
|
||||
$V81c939b1 = strpos($Vd1fc8eaf, "\r\n\r\n");␍
|
||||
if ($V81c939b1 !== false)␍
|
||||
{␍
|
||||
return substr($Vd1fc8eaf, $V81c939b1+$V04d77ddd);␍
|
||||
}␍
|
||||
else␍
|
||||
{␍
|
||||
return $Vd1fc8eaf;␍
|
||||
} ␍
|
||||
}␍
|
||||
}␍
|
||||
@@ -0,0 +1,131 @@
|
||||
<?php␍
|
||||
require_once dirname(__FILE__) . '/../Field.php';␍
|
||||
require_once dirname(__FILE__) . '/Parser/FMPXMLLAYOUT.php';␍
|
||||
class FileMaker_Layout_Implementation␍
|
||||
{␍
|
||||
var $_fm;␍
|
||||
var $_name;␍
|
||||
var $_fields = array();␍
|
||||
var $_relatedSets = array();␍
|
||||
var $_valueLists = array();␍
|
||||
␍
|
||||
␍
|
||||
var $Vab234ad8 = array();␍
|
||||
var $_database;␍
|
||||
var $_extended = false;␍
|
||||
function FileMaker_Layout_Implementation(&$V0ab34ca9)␍
|
||||
{␍
|
||||
$this->_fm =& $V0ab34ca9;␍
|
||||
}␍
|
||||
function getName()␍
|
||||
{␍
|
||||
return $this->_name;␍
|
||||
}␍
|
||||
function getDatabase()␍
|
||||
{␍
|
||||
return $this->_database;␍
|
||||
}␍
|
||||
function listFields()␍
|
||||
{␍
|
||||
return array_keys($this->_fields);␍
|
||||
}␍
|
||||
function getField($V972bf3f0)␍
|
||||
{␍
|
||||
if (isset($this->_fields[$V972bf3f0])) {␍
|
||||
return $this->_fields[$V972bf3f0];␍
|
||||
}␍
|
||||
return $Vcb5e100e = new FileMaker_Error($this->_fm, 'Field Not Found');␍
|
||||
}␍
|
||||
function &getFields()␍
|
||||
{␍
|
||||
return $this->_fields;␍
|
||||
}␍
|
||||
function listRelatedSets()␍
|
||||
{␍
|
||||
return array_keys($this->_relatedSets);␍
|
||||
}␍
|
||||
function &getRelatedSet($Vaca007a7)␍
|
||||
{␍
|
||||
if (isset($this->_relatedSets[$Vaca007a7])) {␍
|
||||
return $this->_relatedSets[$Vaca007a7];␍
|
||||
}␍
|
||||
return $Vcb5e100e = new FileMaker_Error($this->_fm, 'RelatedSet Not Found');␍
|
||||
}␍
|
||||
function &getRelatedSets()␍
|
||||
{␍
|
||||
return $this->_relatedSets;␍
|
||||
}␍
|
||||
function listValueLists()␍
|
||||
{␍
|
||||
$Vb4a88417 = $this->loadExtendedInfo();␍
|
||||
if (FileMaker::isError($Vb4a88417)) {␍
|
||||
return $Vb4a88417;␍
|
||||
}␍
|
||||
return array_keys($this->_valueLists);␍
|
||||
}␍
|
||||
␍
|
||||
function getValueListTwoFields($V993fcb1e, $Vd33e904c = null){␍
|
||||
␍
|
||||
$Vb4a88417 = $this->loadExtendedInfo($Vd33e904c);␍
|
||||
if (FileMaker::isError($Vb4a88417)) {␍
|
||||
return $Vb4a88417;␍
|
||||
}␍
|
||||
return isset($this->_valueLists[$V993fcb1e]) ?␍
|
||||
$this->Vab234ad8[$V993fcb1e] : null;␍
|
||||
}␍
|
||||
␍
|
||||
function getValueList($V993fcb1e, $Vd33e904c = null)␍
|
||||
{␍
|
||||
$Vb4a88417 = $this->loadExtendedInfo($Vd33e904c);␍
|
||||
if (FileMaker::isError($Vb4a88417)) {␍
|
||||
return $Vb4a88417;␍
|
||||
}␍
|
||||
return isset($this->_valueLists[$V993fcb1e]) ?␍
|
||||
$this->_valueLists[$V993fcb1e] : null;␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
function getValueListsTwoFields($Vd33e904c = null)␍
|
||||
{␍
|
||||
$Vb4a88417 = $this->loadExtendedInfo($Vd33e904c);␍
|
||||
if (FileMaker::isError($Vb4a88417)) {␍
|
||||
return $Vb4a88417;␍
|
||||
}␍
|
||||
return $this->Vab234ad8;␍
|
||||
}␍
|
||||
function getValueLists($Vd33e904c = null)␍
|
||||
{␍
|
||||
$Vb4a88417 = $this->loadExtendedInfo($Vd33e904c);␍
|
||||
if (FileMaker::isError($Vb4a88417)) {␍
|
||||
return $Vb4a88417;␍
|
||||
}␍
|
||||
return $this->_valueLists;␍
|
||||
}␍
|
||||
function loadExtendedInfo($Vd33e904c = null)␍
|
||||
{␍
|
||||
if (!$this->_extended) {␍
|
||||
␍
|
||||
if($Vd33e904c != null){␍
|
||||
$V0f635d0e = $this->_fm->_execute(array('-db' => $this->_fm->getProperty('database'),␍
|
||||
'-lay' => $this->getName(),␍
|
||||
'-recid' => $Vd33e904c,␍
|
||||
'-view' => null),␍
|
||||
'FMPXMLLAYOUT');␍
|
||||
}else{␍
|
||||
$V0f635d0e = $this->_fm->_execute(array('-db' => $this->_fm->getProperty('database'),␍
|
||||
'-lay' => $this->getName(),␍
|
||||
'-view' => null),␍
|
||||
'FMPXMLLAYOUT');␍
|
||||
␍
|
||||
}␍
|
||||
$V3643b863 = new FileMaker_Parser_FMPXMLLAYOUT($this->_fm);␍
|
||||
$Vb4a88417 = $V3643b863->parse($V0f635d0e);␍
|
||||
if (FileMaker::isError($Vb4a88417)) {␍
|
||||
return $Vb4a88417;␍
|
||||
}␍
|
||||
$V3643b863->setExtendedInfo($this);␍
|
||||
$this->_extended = true;␍
|
||||
}␍
|
||||
return $this->_extended;␍
|
||||
}␍
|
||||
}␍
|
||||
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
class FileMaker_Parser_FMPXMLLAYOUT
|
||||
{
|
||||
var $Vd05b6ed7;
|
||||
var $Ve3ad9440;
|
||||
|
||||
|
||||
var $V6a45a325;
|
||||
var $_fm;
|
||||
var $V5431b8d4;
|
||||
var $V6de51026 = false;
|
||||
var $V191be3bd;
|
||||
var $V32e51cce;
|
||||
|
||||
|
||||
var$V582ddd29;
|
||||
function FileMaker_Parser_FMPXMLLAYOUT(&$V0ab34ca9)
|
||||
{
|
||||
$this->_fm =& $V0ab34ca9;
|
||||
}
|
||||
function parse($V0f635d0e)
|
||||
{
|
||||
if (empty($V0f635d0e)) {
|
||||
return new FileMaker_Error($this->_fm, 'Did not receive an XML document from the server.');
|
||||
}
|
||||
$this->V5431b8d4= xml_parser_create();
|
||||
xml_set_object($this->V5431b8d4, $this);
|
||||
xml_parser_set_option($this->V5431b8d4, XML_OPTION_CASE_FOLDING, false);
|
||||
xml_parser_set_option($this->V5431b8d4, XML_OPTION_TARGET_ENCODING, 'UTF-8');
|
||||
xml_set_element_handler($this->V5431b8d4, '_start', '_end');
|
||||
xml_set_character_data_handler($this->V5431b8d4, '_cdata');
|
||||
if (!@xml_parse($this->V5431b8d4, $V0f635d0e)) {
|
||||
return new FileMaker_Error(sprintf('XML error: %s at line %d',
|
||||
xml_error_string(xml_get_error_code($this->V5431b8d4)),
|
||||
xml_get_current_line_number($this->V5431b8d4)));
|
||||
}
|
||||
xml_parser_free($this->V5431b8d4);
|
||||
if (!empty($this->Vcb5e100e)) {
|
||||
return new FileMaker_Error($this->_fm, null, $this->Vcb5e100e);
|
||||
}
|
||||
$this->V6de51026= true;
|
||||
return true;
|
||||
}
|
||||
function setExtendedInfo(&$Vc6140495)
|
||||
{
|
||||
if (!$this->V6de51026) {
|
||||
return new FileMaker_Error($this->_fm, 'Attempt to set extended information before parsing data.');
|
||||
}
|
||||
$Vc6140495->_valueLists = $this->Ve3ad9440;
|
||||
$Vc6140495->Vab234ad8= $this->V6a45a325;
|
||||
foreach ($this->Vd05b6ed7 as $V972bf3f0 => $V77be71a4) {
|
||||
$V8fa14cdd =& $Vc6140495->getField($V972bf3f0);
|
||||
$V8fa14cdd->_impl->_styleType = $V77be71a4['styleType'];
|
||||
$V8fa14cdd->_impl->_valueList = $V77be71a4['valueList'] ? $V77be71a4['valueList'] : null;
|
||||
}
|
||||
}
|
||||
function _start($V3643b863, $Vb068931c, $V5d06e8a3)
|
||||
{
|
||||
$V5d06e8a3 = $this->_fm->toOutputCharset($V5d06e8a3);
|
||||
switch ($Vb068931c) {
|
||||
case 'FIELD':
|
||||
$this->V191be3bd= $V5d06e8a3['NAME'];
|
||||
break;
|
||||
case 'STYLE':
|
||||
$this->Vd05b6ed7[$this->V191be3bd]['styleType'] = $V5d06e8a3['TYPE'];
|
||||
$this->Vd05b6ed7[$this->V191be3bd]['valueList'] = $V5d06e8a3['VALUELIST'];
|
||||
break;
|
||||
case 'VALUELIST':
|
||||
$this->Ve3ad9440[$V5d06e8a3['NAME']] = array();
|
||||
$this->V6a45a325[$V5d06e8a3['NAME']] = array();
|
||||
$this->V32e51cce= $V5d06e8a3['NAME'];
|
||||
break;
|
||||
case 'VALUE':
|
||||
$this->V582ddd29= $V5d06e8a3['DISPLAY'];
|
||||
$this->Ve3ad9440[$this->V32e51cce][] = '';
|
||||
break;
|
||||
}
|
||||
$this->inside_data = false;
|
||||
}
|
||||
function _end($V3643b863, $Vb068931c)
|
||||
{
|
||||
switch ($Vb068931c) {
|
||||
case 'FIELD':
|
||||
$this->V191be3bd= null;
|
||||
break;
|
||||
case 'VALUELIST':
|
||||
$this->V32e51cce= null;
|
||||
break;
|
||||
}
|
||||
|
||||
$this->inside_data = false;
|
||||
}
|
||||
function _cdata($V3643b863, $V8d777f38)
|
||||
{
|
||||
if ($this->V32e51cce!== null && preg_match('|\S|', $V8d777f38)) {␍
|
||||
if($this->inside_data){
|
||||
$V78656626 = $this->V6a45a325[$this->V32e51cce][$this->V582ddd29];
|
||||
$V8d777f38 = $V78656626 . $V8d777f38;
|
||||
}
|
||||
$V83ee0926 = array( $this->V582ddd29=> $this->_fm->toOutputCharset($V8d777f38));
|
||||
$this->associative_array_push($this->V6a45a325[$this->V32e51cce], $V83ee0926);
|
||||
$this->Ve3ad9440[$this->V32e51cce][count($this->Ve3ad9440[$this->V32e51cce]) - 1] .= $this->_fm->toOutputCharset($V8d777f38);
|
||||
$this->inside_data = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function associative_array_push(&$Vf1f713c9, $V34ec78fc) {
|
||||
if (is_array($V34ec78fc)) {
|
||||
foreach ($V34ec78fc as $V3c6e0b8a => $V2063c160) {
|
||||
$Vf1f713c9[$V3c6e0b8a] = $V2063c160;
|
||||
}
|
||||
return $Vf1f713c9;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,281 @@
|
||||
<?php␍
|
||||
require_once dirname(__FILE__) . '/../../Layout.php';␍
|
||||
require_once dirname(__FILE__) . '/../../RelatedSet.php';␍
|
||||
require_once dirname(__FILE__) . '/../../Record.php';␍
|
||||
require_once dirname(__FILE__) . '/../../Field.php';␍
|
||||
class FileMaker_Parser_FMResultSet␍
|
||||
{␍
|
||||
var $Vcb5e100e;␍
|
||||
var $Vf5bf48aa;␍
|
||||
var $V1ea7e575;␍
|
||||
var $V9f81f3c0 = array();␍
|
||||
var $Vaae0d98d;␍
|
||||
var $Vae581270 = array();␍
|
||||
var $V6e52c40b = array();␍
|
||||
var $Ve13f1c92;␍
|
||||
var $V43432a31;␍
|
||||
var $V51bc3e3b;␍
|
||||
var $V26005321;␍
|
||||
var $V6468d939;␍
|
||||
var $_fm;␍
|
||||
var $V5431b8d4;␍
|
||||
var $V6de51026 = false;␍
|
||||
var $_result;␍
|
||||
var $_layout;␍
|
||||
function FileMaker_Parser_FMResultSet(&$V0ab34ca9)␍
|
||||
{␍
|
||||
$this->_fm =& $V0ab34ca9;␍
|
||||
}␍
|
||||
function parse($V0f635d0e)␍
|
||||
{␍
|
||||
if (empty($V0f635d0e)) {␍
|
||||
return new FileMaker_Error($this->_fm, 'Did not receive an XML document from the server.');␍
|
||||
} ␍
|
||||
$this->V5431b8d4= xml_parser_create('UTF-8');␍
|
||||
xml_set_object($this->V5431b8d4, $this);␍
|
||||
xml_parser_set_option($this->V5431b8d4, XML_OPTION_CASE_FOLDING, false);␍
|
||||
xml_parser_set_option($this->V5431b8d4, XML_OPTION_TARGET_ENCODING, 'UTF-8');␍
|
||||
xml_set_element_handler($this->V5431b8d4, '_start', '_end');␍
|
||||
xml_set_character_data_handler($this->V5431b8d4, '_cdata'); ␍
|
||||
if (!@xml_parse($this->V5431b8d4, $V0f635d0e)) {␍
|
||||
return new FileMaker_Error($this->_fm,␍
|
||||
sprintf('XML error: %s at line %d',␍
|
||||
xml_error_string(xml_get_error_code($this->V5431b8d4)),␍
|
||||
xml_get_current_line_number($this->V5431b8d4)));␍
|
||||
} ␍
|
||||
xml_parser_free($this->V5431b8d4); ␍
|
||||
if (!empty($this->Vcb5e100e)) {␍
|
||||
return new FileMaker_Error($this->_fm, null, $this->Vcb5e100e);␍
|
||||
} ␍
|
||||
if (version_compare($this->Vf5bf48aa['version'], FileMaker::getMinServerVersion(), '<')) {␍
|
||||
return new FileMaker_Error($this->_fm, 'This API requires at least version ' . FileMaker::getMinServerVersion() . ' of FileMaker Server to run (detected ' . $this->Vf5bf48aa['version'] . ').');␍
|
||||
}␍
|
||||
$this->V6de51026= true;␍
|
||||
return true;␍
|
||||
}␍
|
||||
function setResult(&$Vb4a88417, $V561b2299 = 'FileMaker_Record')␍
|
||||
{␍
|
||||
if (!$this->V6de51026) {␍
|
||||
return new FileMaker_Error($this->_fm, 'Attempt to get a result object before parsing data.');␍
|
||||
}␍
|
||||
if ($this->_result) {␍
|
||||
$Vb4a88417 =& $this->_result;␍
|
||||
return true;␍
|
||||
} ␍
|
||||
$Vb4a88417->_impl->_layout = new FileMaker_Layout($this->_fm);␍
|
||||
$this->setLayout($Vb4a88417->_impl->_layout); ␍
|
||||
$Vb4a88417->_impl->_tableCount = $this->V1ea7e575['total-count'];␍
|
||||
$Vb4a88417->_impl->_foundSetCount = $this->Vaae0d98d['count'];␍
|
||||
$Vb4a88417->_impl->_fetchCount = $this->Vaae0d98d['fetch-size']; ␍
|
||||
$V6e52c40b = array();␍
|
||||
foreach ($this->V6e52c40b as $Vde17f0f2) {␍
|
||||
$V4b43b0ae = new $V561b2299($Vb4a88417->_impl->_layout);␍
|
||||
$V4b43b0ae->_impl->_fields = $Vde17f0f2['fields'];␍
|
||||
$V4b43b0ae->_impl->_recordId = $Vde17f0f2['record-id'];␍
|
||||
$V4b43b0ae->_impl->_modificationId = $Vde17f0f2['mod-id'];␍
|
||||
if ($Vde17f0f2['children']) {␍
|
||||
foreach ($Vde17f0f2['children'] as $Vaca007a7 => $V268184c1) {␍
|
||||
$V4b43b0ae->_impl->_relatedSets[$Vaca007a7] = array();␍
|
||||
foreach ($V268184c1 as $V1b7d5726) {␍
|
||||
$V4a8a08f0 = new $V561b2299($Vb4a88417->_impl->_layout->getRelatedSet($Vaca007a7));␍
|
||||
$V4a8a08f0->_impl->_fields = $V1b7d5726['fields'];␍
|
||||
$V4a8a08f0->_impl->_recordId = $V1b7d5726['record-id'];␍
|
||||
$V4a8a08f0->_impl->_modificationId = $V1b7d5726['mod-id'];␍
|
||||
$V4a8a08f0->_impl->_parent = $V4b43b0ae;␍
|
||||
$V4b43b0ae->_impl->_relatedSets[$Vaca007a7][] = $V4a8a08f0;␍
|
||||
}␍
|
||||
}␍
|
||||
}␍
|
||||
$V6e52c40b[] = $V4b43b0ae;␍
|
||||
}␍
|
||||
$Vb4a88417->_impl->_records =& $V6e52c40b;␍
|
||||
$this->_result =& $Vb4a88417;␍
|
||||
true;␍
|
||||
}␍
|
||||
function setLayout(&$Vc6140495)␍
|
||||
{␍
|
||||
if (!$this->V6de51026) {␍
|
||||
return new FileMaker_Error($this->_fm, 'Attempt to get a layout object before parsing data.');␍
|
||||
}␍
|
||||
if ($this->_layout) {␍
|
||||
$Vc6140495 =& $this->_layout;␍
|
||||
return true;␍
|
||||
}␍
|
||||
$Vc6140495->_impl->_name = $this->V1ea7e575['layout'];␍
|
||||
$Vc6140495->_impl->_database = $this->V1ea7e575['database'];␍
|
||||
foreach ($this->V9f81f3c0 as $V06e3d36f) {␍
|
||||
$V8fa14cdd = new FileMaker_Field($Vc6140495);␍
|
||||
$V8fa14cdd->_impl->_name = $V06e3d36f['name'];␍
|
||||
$V8fa14cdd->_impl->_autoEntered = (bool)($V06e3d36f['auto-enter'] == 'yes');␍
|
||||
$V8fa14cdd->_impl->_global = (bool)($V06e3d36f['global'] == 'yes');␍
|
||||
$V8fa14cdd->_impl->_maxRepeat = (int)$V06e3d36f['max-repeat'];␍
|
||||
$V8fa14cdd->_impl->_result = $V06e3d36f['result'];␍
|
||||
$V8fa14cdd->_impl->_type = $V06e3d36f['type']; ␍
|
||||
if ($V06e3d36f['not-empty'] == 'yes') {␍
|
||||
$V8fa14cdd->_impl->_validationRules[FILEMAKER_RULE_NOTEMPTY] = true;␍
|
||||
$V8fa14cdd->_impl->_validationMask |= FILEMAKER_RULE_NOTEMPTY;␍
|
||||
}␍
|
||||
if ($V06e3d36f['numeric-only'] == 'yes') {␍
|
||||
$V8fa14cdd->_impl->_validationRules[FILEMAKER_RULE_NUMERICONLY] = true;␍
|
||||
$V8fa14cdd->_impl->_validationMask |= FILEMAKER_RULE_NUMERICONLY;␍
|
||||
}␍
|
||||
if (array_key_exists('max-characters', $V06e3d36f)) {␍
|
||||
$V8fa14cdd->_impl->_maxCharacters = (int) $V06e3d36f['max-characters'];␍
|
||||
$V8fa14cdd->_impl->_validationRules[FILEMAKER_RULE_MAXCHARACTERS] = true;␍
|
||||
$V8fa14cdd->_impl->_validationMask |= FILEMAKER_RULE_MAXCHARACTERS;␍
|
||||
}␍
|
||||
if ($V06e3d36f['four-digit-year'] == 'yes') {␍
|
||||
$V8fa14cdd->_impl->_validationRules[FILEMAKER_RULE_FOURDIGITYEAR] = true;␍
|
||||
$V8fa14cdd->_impl->_validationMask |= FILEMAKER_RULE_FOURDIGITYEAR;␍
|
||||
}␍
|
||||
if ($V06e3d36f['time-of-day'] == 'yes') {␍
|
||||
$V8fa14cdd->_impl->_validationRules[FILEMAKER_RULE_TIMEOFDAY] = true;␍
|
||||
$V8fa14cdd->_impl->_validationMask |= FILEMAKER_RULE_TIMEOFDAY;␍
|
||||
}␍
|
||||
if ($V06e3d36f['four-digit-year'] == 'no' && $V06e3d36f['result'] == 'timestamp') {␍
|
||||
$V8fa14cdd->_impl->_validationRules[FILEMAKER_RULE_TIMESTAMP_FIELD] = true;␍
|
||||
$V8fa14cdd->_impl->_validationMask |= FILEMAKER_RULE_TIMESTAMP_FIELD;␍
|
||||
}␍
|
||||
if ($V06e3d36f['four-digit-year'] == 'no' && $V06e3d36f['result'] == 'date') {␍
|
||||
$V8fa14cdd->_impl->_validationRules[FILEMAKER_RULE_DATE_FIELD] = true;␍
|
||||
$V8fa14cdd->_impl->_validationMask |= FILEMAKER_RULE_DATE_FIELD;␍
|
||||
}␍
|
||||
if ($V06e3d36f['time-of-day'] == 'no' && $V06e3d36f['result'] == 'time') {␍
|
||||
$V8fa14cdd->_impl->_validationRules[FILEMAKER_RULE_TIME_FIELD] = true;␍
|
||||
$V8fa14cdd->_impl->_validationMask |= FILEMAKER_RULE_TIME_FIELD;␍
|
||||
}␍
|
||||
$Vc6140495->_impl->_fields[$V8fa14cdd->getName()] = $V8fa14cdd;␍
|
||||
}␍
|
||||
foreach ($this->Vae581270 as $Vaca007a7 => $V53256610) {␍
|
||||
$V4b43b0ae = new FileMaker_RelatedSet($Vc6140495);␍
|
||||
$V4b43b0ae->_impl->_name = $Vaca007a7;␍
|
||||
foreach ($V53256610 as $V06e3d36f) {␍
|
||||
$V8fa14cdd = new FileMaker_Field($V4b43b0ae);␍
|
||||
$V8fa14cdd->_impl->_name = $V06e3d36f['name'];␍
|
||||
$V8fa14cdd->_impl->_autoEntered = (bool)($V06e3d36f['auto-enter'] == 'yes');␍
|
||||
$V8fa14cdd->_impl->_global = (bool)($V06e3d36f['global'] == 'yes');␍
|
||||
$V8fa14cdd->_impl->_maxRepeat = (int)$V06e3d36f['max-repeat'];␍
|
||||
$V8fa14cdd->_impl->_result = $V06e3d36f['result'];␍
|
||||
$V8fa14cdd->_impl->_type = $V06e3d36f['type']; ␍
|
||||
if ($V06e3d36f['not-empty'] == 'yes') {␍
|
||||
$V8fa14cdd->_impl->_validationRules[FILEMAKER_RULE_NOTEMPTY] = true;␍
|
||||
$V8fa14cdd->_impl->_validationMask |= FILEMAKER_RULE_NOTEMPTY;␍
|
||||
}␍
|
||||
if ($V06e3d36f['numeric-only'] == 'yes') {␍
|
||||
$V8fa14cdd->_impl->_validationRules[FILEMAKER_RULE_NUMERICONLY] = true;␍
|
||||
$V8fa14cdd->_impl->_validationMask |= FILEMAKER_RULE_NUMERICONLY;␍
|
||||
}␍
|
||||
if (array_key_exists('max-characters', $V06e3d36f)) {␍
|
||||
$V8fa14cdd->_impl->_maxCharacters = (int) $V06e3d36f['max-characters'];␍
|
||||
$V8fa14cdd->_impl->_validationRules[FILEMAKER_RULE_MAXCHARACTERS] = true;␍
|
||||
$V8fa14cdd->_impl->_validationMask |= FILEMAKER_RULE_MAXCHARACTERS;␍
|
||||
}␍
|
||||
if ($V06e3d36f['four-digit-year'] == 'yes') {␍
|
||||
$V8fa14cdd->_impl->_validationRules[FILEMAKER_RULE_FOURDIGITYEAR] = true;␍
|
||||
$V8fa14cdd->_impl->_validationMask |= FILEMAKER_RULE_FOURDIGITYEAR;␍
|
||||
}␍
|
||||
if ($V06e3d36f['time-of-day'] == 'yes' || $V06e3d36f['result'] == 'time') {␍
|
||||
$V8fa14cdd->_impl->_validationRules[FILEMAKER_RULE_TIMEOFDAY] = true;␍
|
||||
$V8fa14cdd->_impl->_validationMask |= FILEMAKER_RULE_TIMEOFDAY;␍
|
||||
}␍
|
||||
if ($V06e3d36f['four-digit-year'] == 'no' && $V06e3d36f['result'] == 'timestamp') {␍
|
||||
$V8fa14cdd->_impl->_validationRules[FILEMAKER_RULE_TIMESTAMP_FIELD] = true;␍
|
||||
$V8fa14cdd->_impl->_validationMask |= FILEMAKER_RULE_TIMESTAMP_FIELD;␍
|
||||
}␍
|
||||
if ($V06e3d36f['four-digit-year'] == 'no' && $V06e3d36f['result'] == 'date') {␍
|
||||
$V8fa14cdd->_impl->_validationRules[FILEMAKER_RULE_DATE_FIELD] = true;␍
|
||||
$V8fa14cdd->_impl->_validationMask |= FILEMAKER_RULE_DATE_FIELD;␍
|
||||
}␍
|
||||
if ($V06e3d36f['time-of-day'] == 'no' && $V06e3d36f['result'] == 'time') {␍
|
||||
$V8fa14cdd->_impl->_validationRules[FILEMAKER_RULE_TIME_FIELD] = true;␍
|
||||
$V8fa14cdd->_impl->_validationMask |= FILEMAKER_RULE_TIME_FIELD;␍
|
||||
}␍
|
||||
$V4b43b0ae->_impl->_fields[$V8fa14cdd->getName()] = $V8fa14cdd;␍
|
||||
}␍
|
||||
$Vc6140495->_impl->_relatedSets[$V4b43b0ae->getName()] = $V4b43b0ae;␍
|
||||
}␍
|
||||
$this->_layout =& $Vc6140495;␍
|
||||
return true;␍
|
||||
}␍
|
||||
function _start($V3643b863, $Vb068931c, $V5d06e8a3)␍
|
||||
{ ␍
|
||||
$V5d06e8a3 = $this->_fm->toOutputCharset($V5d06e8a3);␍
|
||||
switch ($Vb068931c) {␍
|
||||
case 'error':␍
|
||||
$this->Vcb5e100e= $V5d06e8a3['code'];␍
|
||||
break;␍
|
||||
case 'product':␍
|
||||
$this->Vf5bf48aa= $V5d06e8a3;␍
|
||||
break;␍
|
||||
case 'datasource':␍
|
||||
$this->V1ea7e575= $V5d06e8a3;␍
|
||||
break;␍
|
||||
case 'relatedset-definition':␍
|
||||
$this->Vae581270[$V5d06e8a3['table']] = array();␍
|
||||
$this->Ve13f1c92= $V5d06e8a3['table'];␍
|
||||
break;␍
|
||||
case 'field-definition':␍
|
||||
if ($this->Ve13f1c92) {␍
|
||||
$this->Vae581270[$this->Ve13f1c92][] = $V5d06e8a3;␍
|
||||
} else {␍
|
||||
$this->V9f81f3c0[] = $V5d06e8a3;␍
|
||||
}␍
|
||||
break;␍
|
||||
case 'resultset':␍
|
||||
$this->Vaae0d98d= $V5d06e8a3;␍
|
||||
break;␍
|
||||
case 'relatedset':␍
|
||||
$this->Ve13f1c92= $V5d06e8a3['table'];␍
|
||||
$this->V51bc3e3b= $this->V43432a31;␍
|
||||
$this->V51bc3e3b['children'][$this->Ve13f1c92] = array();␍
|
||||
$this->V43432a31= null;␍
|
||||
break;␍
|
||||
case 'record':␍
|
||||
$this->V43432a31=␍
|
||||
array('record-id' => $V5d06e8a3['record-id'],␍
|
||||
'mod-id' => $V5d06e8a3['mod-id'],␍
|
||||
'fields' => array(),␍
|
||||
'children' => array());␍
|
||||
break;␍
|
||||
case 'field':␍
|
||||
$this->V26005321= $V5d06e8a3['name'];␍
|
||||
$this->V43432a31['fields'][$this->V26005321] = array();␍
|
||||
break;␍
|
||||
case 'data':␍
|
||||
$this->V6468d939= '';␍
|
||||
break;␍
|
||||
}␍
|
||||
}␍
|
||||
function _end($V3643b863, $Vb068931c)␍
|
||||
{␍
|
||||
switch ($Vb068931c) {␍
|
||||
case 'relatedset-definition':␍
|
||||
$this->Ve13f1c92= null;␍
|
||||
break;␍
|
||||
case 'relatedset':␍
|
||||
$this->Ve13f1c92= null;␍
|
||||
$this->V43432a31= $this->V51bc3e3b;␍
|
||||
$this->V51bc3e3b= null;␍
|
||||
break;␍
|
||||
case 'record':␍
|
||||
if ($this->Ve13f1c92) {␍
|
||||
$this->V51bc3e3b['children'][$this->Ve13f1c92][] = $this->V43432a31;␍
|
||||
} else {␍
|
||||
$this->V6e52c40b[] = $this->V43432a31;␍
|
||||
}␍
|
||||
$this->V43432a31= null;␍
|
||||
break;␍
|
||||
case 'field':␍
|
||||
$this->V26005321= null;␍
|
||||
break;␍
|
||||
case 'data':␍
|
||||
$this->V43432a31['fields'][$this->V26005321][] = $this->V6468d939;␍
|
||||
$this->V6468d939= null;␍
|
||||
break;␍
|
||||
}␍
|
||||
}␍
|
||||
function _cdata($V3643b863, $V8d777f38)␍
|
||||
{␍
|
||||
$this->V6468d939.= $this->_fm->toOutputCharset($V8d777f38);␍
|
||||
}␍
|
||||
}␍
|
||||
@@ -0,0 +1,302 @@
|
||||
<?php␍
|
||||
class FileMaker_Record_Implementation␍
|
||||
{␍
|
||||
var $_fields = array();␍
|
||||
var $V5e7ec2d5 = array();␍
|
||||
var $_recordId;␍
|
||||
var $_modificationId;␍
|
||||
var $_layout;␍
|
||||
var $_fm;␍
|
||||
var $_relatedSets = array();␍
|
||||
var $_parent = null;␍
|
||||
function FileMaker_Record_Implementation(&$Vc6140495)␍
|
||||
{␍
|
||||
$this->_layout =& $Vc6140495;␍
|
||||
$this->_fm =& $Vc6140495->_impl->_fm;␍
|
||||
}␍
|
||||
function &getLayout()␍
|
||||
{␍
|
||||
return $this->_layout;␍
|
||||
}␍
|
||||
function getFields()␍
|
||||
{␍
|
||||
return $this->_layout->listFields();␍
|
||||
}␍
|
||||
function getField($V06e3d36f, $V6d786dc7 = 0)␍
|
||||
{␍
|
||||
if (!isset($this->_fields[$V06e3d36f])) {␍
|
||||
$this->_fm->log('Field "' . $V06e3d36f . '" not found.', FILEMAKER_LOG_INFO);␍
|
||||
return "";␍
|
||||
}␍
|
||||
if (!isset($this->_fields[$V06e3d36f][$V6d786dc7])) {␍
|
||||
$this->_fm->log('Repetition "' . (int)$V6d786dc7 . '" does not exist for "' . $V06e3d36f . '".', FILEMAKER_LOG_INFO);␍
|
||||
return "";␍
|
||||
}␍
|
||||
return htmlspecialchars($this->_fields[$V06e3d36f][$V6d786dc7]);␍
|
||||
}␍
|
||||
␍
|
||||
function getFieldUnencoded($V06e3d36f, $V6d786dc7 = 0)␍
|
||||
{␍
|
||||
if (!isset($this->_fields[$V06e3d36f])) {␍
|
||||
$this->_fm->log('Field "' . $V06e3d36f . '" not found.', FILEMAKER_LOG_INFO);␍
|
||||
return "";␍
|
||||
}␍
|
||||
if (!isset($this->_fields[$V06e3d36f][$V6d786dc7])) {␍
|
||||
$this->_fm->log('Repetition "' . (int)$V6d786dc7 . '" does not exist for "' . $V06e3d36f . '".', FILEMAKER_LOG_INFO);␍
|
||||
return "";␍
|
||||
}␍
|
||||
return $this->_fields[$V06e3d36f][$V6d786dc7];␍
|
||||
}␍
|
||||
function getFieldAsTimestamp($V972bf3f0, $V6d786dc7 = 0)␍
|
||||
{␍
|
||||
$V2063c160 = $this->getField($V972bf3f0, $V6d786dc7);␍
|
||||
if (FileMaker::isError($V2063c160)) {␍
|
||||
return $V2063c160;␍
|
||||
}␍
|
||||
$V06e3d36f =& $this->_layout->getField($V972bf3f0);␍
|
||||
if (FileMaker::isError($V06e3d36f)) {␍
|
||||
return $V06e3d36f;␍
|
||||
}␍
|
||||
switch ($V06e3d36f->getResult()) {␍
|
||||
case 'date': ␍
|
||||
$V78f0805f = explode('/', $V2063c160);␍
|
||||
if (count($V78f0805f) != 3) {␍
|
||||
return new FileMaker_Error($this->_fm, 'Failed to parse "' . $V2063c160 . '" as a FileMaker date value.');␍
|
||||
}␍
|
||||
$Vd7e6d55b = @mktime(0, 0, 0, $V78f0805f[0], $V78f0805f[1], $V78f0805f[2]);␍
|
||||
if ($Vd7e6d55b === false) {␍
|
||||
return new FileMaker_Error($this->_fm, 'Failed to convert "' . $V2063c160 . '" to a UNIX timestamp.');␍
|
||||
}␍
|
||||
break;␍
|
||||
case 'time': ␍
|
||||
$V78f0805f = explode(':', $V2063c160);␍
|
||||
if (count($V78f0805f) != 3) {␍
|
||||
return new FileMaker_Error($this->_fm, 'Failed to parse "' . $V2063c160 . '" as a FileMaker time value.');␍
|
||||
}␍
|
||||
$Vd7e6d55b = @mktime($V78f0805f[0], $V78f0805f[1], $V78f0805f[2], 1, 1, 1970);␍
|
||||
if ($Vd7e6d55b === false) {␍
|
||||
return new FileMaker_Error($this->_fm, 'Failed to convert "' . $V2063c160 . '" to a UNIX timestamp.');␍
|
||||
}␍
|
||||
break;␍
|
||||
case 'timestamp': ␍
|
||||
$Vd7e6d55b = @strtotime($V2063c160);␍
|
||||
if ($Vd7e6d55b === false) {␍
|
||||
return new FileMaker_Error($this->_fm, 'Failed to convert "' . $V2063c160 . '" to a UNIX timestamp.');␍
|
||||
}␍
|
||||
break;␍
|
||||
default:␍
|
||||
$Vd7e6d55b = new FileMaker_Error($this->_fm, 'Only time, date, and timestamp fields can be converted to UNIX timestamps.');␍
|
||||
break;␍
|
||||
}␍
|
||||
return $Vd7e6d55b;␍
|
||||
}␍
|
||||
function setField($V06e3d36f, $V2063c160, $V6d786dc7 = 0)␍
|
||||
{␍
|
||||
$this->_fields[$V06e3d36f][$V6d786dc7] = $V2063c160;␍
|
||||
$this->V5e7ec2d5[$V06e3d36f][$V6d786dc7] = true;␍
|
||||
return $V2063c160;␍
|
||||
}␍
|
||||
function setFieldFromTimestamp($V972bf3f0, $Vd7e6d55b, $V6d786dc7 = 0)␍
|
||||
{␍
|
||||
$V06e3d36f = $this->_layout->getField($V972bf3f0);␍
|
||||
if (FileMaker::isError($V06e3d36f)) {␍
|
||||
return $V06e3d36f;␍
|
||||
}␍
|
||||
switch ($V06e3d36f->getResult()) {␍
|
||||
case 'date':␍
|
||||
return $this->setField($V972bf3f0, date('m/d/Y', $Vd7e6d55b), $V6d786dc7);␍
|
||||
case 'time':␍
|
||||
return $this->setField($V972bf3f0, date('H:i:s', $Vd7e6d55b), $V6d786dc7);␍
|
||||
case 'timestamp':␍
|
||||
return $this->setField($V972bf3f0, date('m/d/Y H:i:s', $Vd7e6d55b), $V6d786dc7);␍
|
||||
}␍
|
||||
return new FileMaker_Error($this->_fm, 'Only time, date, and timestamp fields can be set to the value of a timestamp.');␍
|
||||
}␍
|
||||
function getRecordId()␍
|
||||
{␍
|
||||
return $this->_recordId;␍
|
||||
}␍
|
||||
function getModificationId()␍
|
||||
{␍
|
||||
return $this->_modificationId;␍
|
||||
}␍
|
||||
function &getRelatedSet($Vaca007a7)␍
|
||||
{␍
|
||||
if (empty($this->_relatedSets[$Vaca007a7])) {␍
|
||||
$Vcb5e100e = new FileMaker_Error($this->_fm, 'Related set "' . $Vaca007a7 . '" not present.');␍
|
||||
return $Vcb5e100e;␍
|
||||
}␍
|
||||
return $this->_relatedSets[$Vaca007a7];␍
|
||||
}␍
|
||||
function &newRelatedRecord(&$Vd0e45878, $Vaca007a7)␍
|
||||
{␍
|
||||
$V3a2d7564 =& $this->_layout->getRelatedSet($Vaca007a7);␍
|
||||
if (FileMaker::isError($V3a2d7564)) {␍
|
||||
return $V3a2d7564;␍
|
||||
}␍
|
||||
$Vde17f0f2 = new FileMaker_Record($V3a2d7564);␍
|
||||
$Vde17f0f2->_impl->_parent =& $Vd0e45878;␍
|
||||
return $Vde17f0f2;␍
|
||||
}␍
|
||||
function &getParent()␍
|
||||
{␍
|
||||
return $this->_parent;␍
|
||||
}␍
|
||||
function validate($V972bf3f0 = null)␍
|
||||
{␍
|
||||
$V1dccadfe =& $this->_fm->newAddCommand($this->_layout->getName(), $this->_fields);␍
|
||||
return $V1dccadfe->validate($V972bf3f0);␍
|
||||
}␍
|
||||
function commit()␍
|
||||
{ ␍
|
||||
if ($this->_fm->getProperty('prevalidate')) {␍
|
||||
$V9f7d0ee8 = $this->validate();␍
|
||||
if (FileMaker::isError($V9f7d0ee8)) {␍
|
||||
return $V9f7d0ee8;␍
|
||||
}␍
|
||||
} ␍
|
||||
if (is_null($this->_parent)) {␍
|
||||
if ($this->_recordId) {␍
|
||||
return $this->_commitEdit();␍
|
||||
} else {␍
|
||||
return $this->_commitAdd();␍
|
||||
}␍
|
||||
} else { ␍
|
||||
if (!$this->_parent->getRecordId()) {␍
|
||||
return new FileMaker_Error($this->_fm, 'You must commit the parent record first before you can commit its children.');␍
|
||||
}␍
|
||||
if ($this->_recordId) {␍
|
||||
return $this->_commitEditChild();␍
|
||||
} else {␍
|
||||
return $this->_commitAddChild();␍
|
||||
}␍
|
||||
}␍
|
||||
}␍
|
||||
function delete()␍
|
||||
{␍
|
||||
if (empty($this->_recordId)) {␍
|
||||
return new FileMaker_Error($this->_fm, 'You cannot delete a record that does not exist on the server.');␍
|
||||
} ␍
|
||||
if ($this->_parent) {␍
|
||||
$Vd05b6ed7 = array(); ␍
|
||||
$V1dccadfe =& $this->_fm->newEditCommand($this->_parent->_impl->_layout->getName(),␍
|
||||
$this->_parent->_impl->_recordId,␍
|
||||
$Vd05b6ed7); ␍
|
||||
$V1dccadfe->_impl->_setdeleteRelated($this->_layout->getName().".".$this->_recordId);␍
|
||||
␍
|
||||
return $V1dccadfe->execute();␍
|
||||
} ␍
|
||||
else {␍
|
||||
$Vc6140495 = $this->_layout->getName();␍
|
||||
␍
|
||||
$V1dccadfe =& $this->_fm->newDeleteCommand($Vc6140495, $this->_recordId);␍
|
||||
return $V1dccadfe->execute();␍
|
||||
}␍
|
||||
}␍
|
||||
function _commitAdd()␍
|
||||
{ ␍
|
||||
$V1dccadfe =& $this->_fm->newAddCommand($this->_layout->getName(), $this->_fields);␍
|
||||
$Vd1fc8eaf = $V1dccadfe->execute();␍
|
||||
if (FileMaker::isError($Vd1fc8eaf)) {␍
|
||||
return $Vd1fc8eaf;␍
|
||||
} ␍
|
||||
$V6e52c40b =& $Vd1fc8eaf->getRecords();␍
|
||||
return $this->_updateFrom($V6e52c40b[0]);␍
|
||||
}␍
|
||||
function _commitEdit()␍
|
||||
{ ␍
|
||||
foreach ($this->_fields as $V972bf3f0 => $Vd4680e80) {␍
|
||||
foreach ($Vd4680e80 as $V6d786dc7 => $V2063c160) {␍
|
||||
if (isset($this->V5e7ec2d5[$V972bf3f0][$V6d786dc7])) {␍
|
||||
$V8977dfac[$V972bf3f0][$V6d786dc7] = $V2063c160;␍
|
||||
}␍
|
||||
}␍
|
||||
}␍
|
||||
$V1dccadfe =& $this->_fm->newEditCommand($this->_layout->getName(),␍
|
||||
$this->_recordId,␍
|
||||
$V8977dfac);␍
|
||||
$Vd1fc8eaf = $V1dccadfe->execute();␍
|
||||
if (FileMaker::isError($Vd1fc8eaf)) {␍
|
||||
return $Vd1fc8eaf;␍
|
||||
} ␍
|
||||
$V6e52c40b =& $Vd1fc8eaf->getRecords();␍
|
||||
return $this->_updateFrom($V6e52c40b[0]);␍
|
||||
}␍
|
||||
function _commitAddChild()␍
|
||||
{ ␍
|
||||
$Vd05b6ed7 = array();␍
|
||||
foreach ($this->_fields as $Vb068931c => $Vee0525e4) {␍
|
||||
$Vd05b6ed7[$Vb068931c . '.0'] = $Vee0525e4;␍
|
||||
} ␍
|
||||
$V1dccadfe =& $this->_fm->newEditCommand($this->_parent->_impl->_layout->getName(),␍
|
||||
$this->_parent->getRecordId(),␍
|
||||
$Vd05b6ed7);␍
|
||||
$Vd1fc8eaf = $V1dccadfe->execute();␍
|
||||
if (FileMaker::isError($Vd1fc8eaf)) {␍
|
||||
return $Vd1fc8eaf;␍
|
||||
} ␍
|
||||
$V6e52c40b =& $Vd1fc8eaf->getRecords();␍
|
||||
$Vd0e45878 =& $V6e52c40b[0];␍
|
||||
$V268184c1 =& $Vd0e45878->getRelatedSet($this->_layout->getName());␍
|
||||
$V98bd1c45 = array_pop($V268184c1);␍
|
||||
return $this->_updateFrom($V98bd1c45);␍
|
||||
}␍
|
||||
function _commitEditChild()␍
|
||||
{ ␍
|
||||
foreach ($this->_fields as $V972bf3f0 => $Vee0525e4) {␍
|
||||
foreach ($Vee0525e4 as $V6d786dc7 => $V2063c160) {␍
|
||||
if (!empty($this->V5e7ec2d5[$V972bf3f0][$V6d786dc7])) {␍
|
||||
$V8977dfac[$V972bf3f0 . '.' . $this->_recordId][$V6d786dc7] = $V2063c160;␍
|
||||
}␍
|
||||
}␍
|
||||
}␍
|
||||
$V1dccadfe =& $this->_fm->newEditCommand($this->_parent->_impl->_layout->getName(),␍
|
||||
$this->_parent->getRecordId(),␍
|
||||
$V8977dfac);␍
|
||||
$Vd1fc8eaf = $V1dccadfe->execute();␍
|
||||
if (FileMaker::isError($Vd1fc8eaf)) {␍
|
||||
return $Vd1fc8eaf;␍
|
||||
} ␍
|
||||
$V6e52c40b =& $Vd1fc8eaf->getRecords();␍
|
||||
$Vd0e45878 =& $V6e52c40b[0];␍
|
||||
$V268184c1 =& $Vd0e45878->getRelatedSet($this->_layout->getName());␍
|
||||
foreach ($V268184c1 as $V1b7d5726) {␍
|
||||
if ($V1b7d5726->getRecordId() == $this->_recordId) {␍
|
||||
return $this->_updateFrom($V1b7d5726);␍
|
||||
break;␍
|
||||
}␍
|
||||
}␍
|
||||
return new FileMaker_Error('Failed to find the updated child in the response.');␍
|
||||
}␍
|
||||
function _updateFrom(&$Vde17f0f2)␍
|
||||
{␍
|
||||
$this->_recordId = $Vde17f0f2->getRecordId();␍
|
||||
$this->_modificationId = $Vde17f0f2->getModificationId();␍
|
||||
$this->_fields = $Vde17f0f2->_impl->_fields;␍
|
||||
$this->_layout =& $Vde17f0f2->_impl->_layout;␍
|
||||
$this->_relatedSets =& $Vde17f0f2->_impl->_relatedSets; ␍
|
||||
$this->V5e7ec2d5= array();␍
|
||||
return true;␍
|
||||
}␍
|
||||
␍
|
||||
function getRelatedRecordById($V97f7e518, $Va6ec9c02)␍
|
||||
{␍
|
||||
␍
|
||||
$Vaca007a7 = $this->getRelatedSet($V97f7e518);␍
|
||||
if(FileMaker::IsError($Vaca007a7)){␍
|
||||
␍
|
||||
$Vcb5e100e = new FileMaker_Error($this->_fm, 'Related set "' . $Vaca007a7 . '" not present.');␍
|
||||
return $Vcb5e100e;␍
|
||||
}else{ ␍
|
||||
foreach ($Vaca007a7 as $V1b7d5726) {␍
|
||||
if( $V1b7d5726->getRecordId() == $Va6ec9c02){␍
|
||||
return $V1b7d5726;␍
|
||||
}␍
|
||||
}␍
|
||||
$Vcb5e100e = new FileMaker_Error($this->_fm, 'Record not present.');␍
|
||||
return $Vcb5e100e; ␍
|
||||
␍
|
||||
} ␍
|
||||
}␍
|
||||
␍
|
||||
}␍
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php␍
|
||||
class FileMaker_RelatedSet_Implementation␍
|
||||
{␍
|
||||
var $_layout;␍
|
||||
var $_fm;␍
|
||||
var $_name;␍
|
||||
var $_fields = array();␍
|
||||
function FileMaker_RelatedSet_Implementation(&$Vc6140495)␍
|
||||
{␍
|
||||
$this->_layout =& $Vc6140495;␍
|
||||
$this->_fm =& $Vc6140495->_impl->_fm;␍
|
||||
}␍
|
||||
function getName()␍
|
||||
{␍
|
||||
return $this->_name;␍
|
||||
}␍
|
||||
function listFields()␍
|
||||
{␍
|
||||
return array_keys($this->_fields);␍
|
||||
}␍
|
||||
function &getField($V972bf3f0)␍
|
||||
{␍
|
||||
if (isset($this->_fields[$V972bf3f0])) {␍
|
||||
return $this->_fields[$V972bf3f0];␍
|
||||
}␍
|
||||
$Vcb5e100e = new FileMaker_Error($this->_fm, 'Field Not Found');␍
|
||||
return $Vcb5e100e;␍
|
||||
}␍
|
||||
function &getFields()␍
|
||||
{␍
|
||||
return $this->_fields;␍
|
||||
}␍
|
||||
function loadExtendedInfo()␍
|
||||
{␍
|
||||
return new FileMaker_Error($this->_fm, 'Related sets do not support extended information.');␍
|
||||
}␍
|
||||
}␍
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php␍
|
||||
class FileMaker_Result_Implementation␍
|
||||
{␍
|
||||
var $_fm;␍
|
||||
var $_layout;␍
|
||||
var $_records;␍
|
||||
var $_tableCount;␍
|
||||
var $_foundSetCount;␍
|
||||
var $_fetchCount;␍
|
||||
function FileMaker_Result_Implementation(&$V0ab34ca9)␍
|
||||
{␍
|
||||
$this->_fm = &$V0ab34ca9;␍
|
||||
}␍
|
||||
function &getLayout()␍
|
||||
{␍
|
||||
return $this->_layout;␍
|
||||
}␍
|
||||
function &getRecords()␍
|
||||
{␍
|
||||
return $this->_records;␍
|
||||
}␍
|
||||
function getFields()␍
|
||||
{␍
|
||||
return $this->_layout->listFields();␍
|
||||
}␍
|
||||
function getRelatedSets()␍
|
||||
{␍
|
||||
return $this->_layout->listRelatedSets();␍
|
||||
}␍
|
||||
function getTableRecordCount()␍
|
||||
{␍
|
||||
return $this->_tableCount;␍
|
||||
}␍
|
||||
function getFoundSetCount()␍
|
||||
{␍
|
||||
return $this->_foundSetCount;␍
|
||||
}␍
|
||||
function getFetchCount()␍
|
||||
{␍
|
||||
return $this->_fetchCount;␍
|
||||
}␍
|
||||
␍
|
||||
function getFirstRecord()␍
|
||||
{␍
|
||||
return $this->_records[0];␍
|
||||
}␍
|
||||
␍
|
||||
function getLastRecord()␍
|
||||
{␍
|
||||
return $this->_records[sizeof($this->_records)-1];␍
|
||||
}␍
|
||||
}␍
|
||||
Reference in New Issue
Block a user