Merge branch 'master' of bitbucket.org:colosa/processmaker into PM-1113
This commit is contained in:
@@ -149,7 +149,7 @@ abstract class FileSystem {
|
||||
* by the given abstract pathname, or zero if it does not exist or some
|
||||
* other I/O error occurs.
|
||||
*/
|
||||
function getBooleanAttributes($f) {
|
||||
function getBooleanAttributes(&$f = null) {
|
||||
throw new Exception("SYSTEM ERROR method getBooleanAttributes() not implemented by fs driver");
|
||||
}
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ class UnixFileSystem extends FileSystem {
|
||||
/* -- most of the following is mapped to the php natives wrapped by FileSystem */
|
||||
|
||||
/* -- Attribute accessors -- */
|
||||
function getBooleanAttributes(&$f) {
|
||||
function getBooleanAttributes(&$f = null) {
|
||||
//$rv = getBooleanAttributes0($f);
|
||||
$name = $f->getName();
|
||||
$hidden = (strlen($name) > 0) && ($name{0} == '.');
|
||||
|
||||
@@ -40,6 +40,7 @@ class PmTable
|
||||
private $schemaFile = '';
|
||||
private $tableName;
|
||||
private $columns;
|
||||
private $primaryKey= array();
|
||||
private $baseDir = '';
|
||||
private $targetDir = '';
|
||||
private $configDir = '';
|
||||
@@ -182,7 +183,7 @@ class PmTable
|
||||
* Build the pmTable with all dependencies
|
||||
*/
|
||||
public function build ()
|
||||
{
|
||||
{
|
||||
$this->prepare();
|
||||
$this->preparePropelIniFile();
|
||||
$this->buildSchema();
|
||||
@@ -400,7 +401,7 @@ class PmTable
|
||||
* Save the xml schema for propel
|
||||
*/
|
||||
public function saveSchema ()
|
||||
{
|
||||
{
|
||||
$this->dom->save( $this->configDir . $this->schemaFilename );
|
||||
}
|
||||
|
||||
@@ -671,8 +672,29 @@ class PmTable
|
||||
$sql = "SELECT * FROM $tableBackup";
|
||||
$rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
// array the primary keys
|
||||
foreach($this->columns as $value) {
|
||||
if ($value->field_key == 1) {
|
||||
$this->primaryKey[] = $value->field_name;
|
||||
}
|
||||
}
|
||||
|
||||
$flagPrimaryKey = 1;
|
||||
while ($rs->next()) {
|
||||
$row = $rs->getRow();
|
||||
if ($flagPrimaryKey) {
|
||||
// verify row has all primary keys
|
||||
$keys = 0;
|
||||
foreach ($row as $colName => $value) {
|
||||
if (in_array($colName,$this->primaryKey)){
|
||||
$keys++;
|
||||
}
|
||||
}
|
||||
if ($keys != count($this->primaryKey)) {
|
||||
return $stmt->executeQuery(str_replace($table, $tableBackup, $queryStack["drop"]));
|
||||
}
|
||||
$flagPrimaryKey = 0;
|
||||
}
|
||||
|
||||
$oTable = new $tableFileName();
|
||||
$oTable->fromArray($row, BasePeer::TYPE_FIELDNAME);
|
||||
|
||||
@@ -214,13 +214,11 @@ class pmTablesProxy extends HttpProxyController
|
||||
$result = new StdClass();
|
||||
|
||||
try {
|
||||
$result = new stdClass();
|
||||
ob_start();
|
||||
$data = (array) $httpData;
|
||||
$data['PRO_UID'] = trim( $data['PRO_UID'] );
|
||||
$data['columns'] = G::json_decode( stripslashes( $httpData->columns ) ); //decofing data columns
|
||||
|
||||
|
||||
$isReportTable = $data['PRO_UID'] != '' ? true : false;
|
||||
$oAdditionalTables = new AdditionalTables();
|
||||
$oFields = new Fields();
|
||||
@@ -258,7 +256,6 @@ class pmTablesProxy extends HttpProxyController
|
||||
) ) ));
|
||||
}
|
||||
}
|
||||
|
||||
//backward compatility
|
||||
foreach ($columns as $i => $column) {
|
||||
if (in_array( strtoupper( $columns[$i]->field_name ), $reservedWordsSql ) || in_array( strtolower( $columns[$i]->field_name ), $reservedWordsPhp )) {
|
||||
@@ -324,7 +321,6 @@ class pmTablesProxy extends HttpProxyController
|
||||
$oCriteria->add( FieldsPeer::ADD_TAB_UID, $data['REP_TAB_UID'] );
|
||||
FieldsPeer::doDelete( $oCriteria );
|
||||
}
|
||||
|
||||
// Updating pmtable fields
|
||||
foreach ($columns as $i => $column) {
|
||||
$field = array (
|
||||
@@ -753,7 +749,7 @@ class pmTablesProxy extends HttpProxyController
|
||||
*/
|
||||
public function exportCSV ($httpData)
|
||||
{
|
||||
|
||||
$result = new StdClass();
|
||||
try {
|
||||
|
||||
$link = '';
|
||||
|
||||
@@ -158,13 +158,13 @@ if (isset( $sfunction ) && $sfunction == 'lookforNameDynaform') {
|
||||
$copyDynGrdDescription = $row["CON_VALUE"];
|
||||
|
||||
//Create grid
|
||||
$aDataAux = $aData;
|
||||
$dynaformGrid = new dynaform();
|
||||
|
||||
$aDataAux = $aData;
|
||||
$aDataAux["DYN_TYPE"] = "grid";
|
||||
$aDataAux["DYN_TITLE"] = $copyDynGrdTitle;
|
||||
$aDataAux["DYN_TITLE"] = $copyDynGrdTitle . ((!$dynaformGrid->verifyExistingName($copyDynGrdTitle, $dynaform->getProUid()))? " (" . $dynaform->getDynTitle() . ")" : "");
|
||||
$aDataAux["DYN_DESCRIPTION"] = $copyDynGrdDescription;
|
||||
|
||||
$dynaformGrid = new dynaform();
|
||||
$aFields = $dynaformGrid->create($aDataAux);
|
||||
|
||||
$dynaformGridUid = $dynaformGrid->getDynUid();
|
||||
|
||||
@@ -602,15 +602,15 @@ class DynaForm
|
||||
$dynGrdDescriptionCopyImport = $row["CON_VALUE"];
|
||||
|
||||
//Create Grid
|
||||
$dynaFormGrid = new \Dynaform();
|
||||
|
||||
$arrayDataAux = array(
|
||||
"PRO_UID" => $processUid,
|
||||
"DYN_TITLE" => $dynGrdTitleCopyImport,
|
||||
"DYN_TITLE" => $dynGrdTitleCopyImport . (($this->existsTitle($processUid, $dynGrdTitleCopyImport))? " (" . $arrayData["DYN_TITLE"] . ")" : ""),
|
||||
"DYN_DESCRIPTION" => $dynGrdDescriptionCopyImport,
|
||||
"DYN_TYPE" => "grid"
|
||||
);
|
||||
|
||||
$dynaFormGrid = new \Dynaform();
|
||||
|
||||
$dynaFormGridUid = $dynaFormGrid->create($arrayDataAux);
|
||||
|
||||
//Copy files of the DynaForm Grid
|
||||
@@ -1124,6 +1124,5 @@ class DynaForm
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user