Merged master into dashboards2
This commit is contained in:
@@ -443,8 +443,16 @@ class DataBaseMaintenance
|
||||
if (empty( $aTables ))
|
||||
return false;
|
||||
printf( "%-70s", "LOCK TABLES" );
|
||||
|
||||
if(is_array($aTables)) {
|
||||
foreach($aTables as $k => $v) {
|
||||
$aTables[$k] = mysql_real_escape_string($v);
|
||||
}
|
||||
}
|
||||
|
||||
$sQuery = "LOCK TABLES " . implode( " READ, ", $aTables ) . " READ; ";
|
||||
$sQuery = $filter->preventSqlInjection($sQuery);
|
||||
|
||||
if (@mysql_query( $sQuery )) {
|
||||
echo " [OK]\n";
|
||||
return true;
|
||||
|
||||
@@ -4819,16 +4819,37 @@ class XmlForm_Field_Date extends XmlForm_Field_SimpleText
|
||||
}
|
||||
}
|
||||
|
||||
$withHours = (strpos($mask, '%H') !== false || strpos($mask, '%M') !== false || strpos($mask, '%S') !== false);
|
||||
$withHours = (strpos($mask, '%H') !== false || strpos($mask, '%I') !== false || strpos($mask, '%k') !== false || strpos($mask, '%l') !== false || strpos($mask, '%M') !== false || strpos($mask, '%S') !== false);
|
||||
|
||||
$tmp = str_replace( "%", "", $mask );
|
||||
return $this->date_create_from_format($tmp, $value, $withHours);
|
||||
}
|
||||
|
||||
/*
|
||||
//Year
|
||||
%Y year with the century
|
||||
%y year without the century (range 00 to 99)
|
||||
//Month
|
||||
%m month, range 01 to 12
|
||||
%B full month name
|
||||
%b abbreviated month name
|
||||
//Day
|
||||
%d the day of the month (range 01 to 31)
|
||||
%e the day of the month (range 1 to 31)
|
||||
//Hour
|
||||
%H hour, range 00 to 23 (24h format)
|
||||
%I hour, range 01 to 12 (12h format)
|
||||
%k hour, range 0 to 23 (24h format)
|
||||
%l hour, range 1 to 12 (12h format)
|
||||
//Min
|
||||
%M minute, range 00 to 59
|
||||
//Sec
|
||||
%S seconds, range 00 to 59
|
||||
*/
|
||||
function date_create_from_format( $dformat, $dvalue, $withHours = false )
|
||||
{
|
||||
$schedule = $dvalue;
|
||||
$schedule_format = str_replace(array('Y','m','d','H','M','S'),array('%Y','%m','%d','%H','%M','%S') ,$dformat);
|
||||
$schedule_format = str_replace(array('Y','y','m','B','b','d','e','H','I','k','l','M','S'),array('%Y','%y','%m','%B','%b','%d','%e','%H','%I','%k','%l','%M','%S') ,$dformat);
|
||||
$ugly = strptime($schedule, $schedule_format);
|
||||
$ymd = sprintf(
|
||||
'%04d-%02d-%02d %02d:%02d:%02d',
|
||||
|
||||
2
gulliver/thirdparty/creole/Creole.php
vendored
2
gulliver/thirdparty/creole/Creole.php
vendored
@@ -244,7 +244,7 @@ class Creole {
|
||||
try {
|
||||
$obj->connect($dsninfo, $flags);
|
||||
} catch(SQLException $sqle) {
|
||||
$sqle->setUserInfo($dsninfo);
|
||||
$sqle->setUserInfo((isset($dsninfo["username"]))? $dsninfo["username"] : "");
|
||||
throw $sqle;
|
||||
}
|
||||
$persistent = ($flags & Creole::PERSISTENT) === Creole::PERSISTENT;
|
||||
|
||||
@@ -70,6 +70,17 @@ class PgSQLTableInfo extends TableInfo {
|
||||
|
||||
// Get the columns, types, etc.
|
||||
// Based on code from pgAdmin3 (http://www.pgadmin.org/)
|
||||
|
||||
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
|
||||
$docuroot = explode( '/', $realdocuroot );
|
||||
array_pop( $docuroot );
|
||||
$pathhome = implode( '/', $docuroot ) . '/';
|
||||
array_pop( $docuroot );
|
||||
$pathTrunk = implode( '/', $docuroot ) . '/';
|
||||
require_once($pathTrunk.'gulliver/system/class.inputfilter.php');
|
||||
$filter = new InputFilter();
|
||||
$this->oid = $filter->validateInput($this->oid, 'int');
|
||||
|
||||
$result = pg_query ($this->conn->getResource(), sprintf ("SELECT
|
||||
att.attname,
|
||||
att.atttypmod,
|
||||
@@ -203,6 +214,17 @@ class PgSQLTableInfo extends TableInfo {
|
||||
{
|
||||
throw new SQLException ("Invalid domain name [" . $strDomain . "]");
|
||||
} // if (strlen (trim ($strDomain)) < 1)
|
||||
|
||||
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
|
||||
$docuroot = explode( '/', $realdocuroot );
|
||||
array_pop( $docuroot );
|
||||
$pathhome = implode( '/', $docuroot ) . '/';
|
||||
array_pop( $docuroot );
|
||||
$pathTrunk = implode( '/', $docuroot ) . '/';
|
||||
require_once($pathTrunk.'gulliver/system/class.inputfilter.php');
|
||||
$filter = new InputFilter();
|
||||
$strDomain = $filter->validateInput($strDomain);
|
||||
|
||||
$result = pg_query ($this->conn->getResource(), sprintf ("SELECT
|
||||
d.typname as domname,
|
||||
b.typname as basetype,
|
||||
@@ -243,6 +265,16 @@ class PgSQLTableInfo extends TableInfo {
|
||||
protected function initForeignKeys()
|
||||
{
|
||||
include_once 'creole/metadata/ForeignKeyInfo.php';
|
||||
|
||||
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
|
||||
$docuroot = explode( '/', $realdocuroot );
|
||||
array_pop( $docuroot );
|
||||
$pathhome = implode( '/', $docuroot ) . '/';
|
||||
array_pop( $docuroot );
|
||||
$pathTrunk = implode( '/', $docuroot ) . '/';
|
||||
require_once($pathTrunk.'gulliver/system/class.inputfilter.php');
|
||||
$filter = new InputFilter();
|
||||
$this->oid = $filter->validateInput($this->oid, 'int');
|
||||
|
||||
$result = pg_query ($this->conn->getResource(), sprintf ("SELECT
|
||||
conname,
|
||||
@@ -328,6 +360,16 @@ class PgSQLTableInfo extends TableInfo {
|
||||
|
||||
// columns have to be loaded first
|
||||
if (!$this->colsLoaded) $this->initColumns();
|
||||
|
||||
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
|
||||
$docuroot = explode( '/', $realdocuroot );
|
||||
array_pop( $docuroot );
|
||||
$pathhome = implode( '/', $docuroot ) . '/';
|
||||
array_pop( $docuroot );
|
||||
$pathTrunk = implode( '/', $docuroot ) . '/';
|
||||
require_once($pathTrunk.'gulliver/system/class.inputfilter.php');
|
||||
$filter = new InputFilter();
|
||||
$this->oid = $filter->validateInput($this->oid, 'int');
|
||||
|
||||
$result = pg_query ($this->conn->getResource(), sprintf ("SELECT
|
||||
DISTINCT ON(cls.relname)
|
||||
@@ -343,6 +385,16 @@ class PgSQLTableInfo extends TableInfo {
|
||||
if (!$result) {
|
||||
throw new SQLException("Could not list indexes keys for table: " . $this->name, pg_last_error($this->conn->getResource()));
|
||||
}
|
||||
|
||||
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
|
||||
$docuroot = explode( '/', $realdocuroot );
|
||||
array_pop( $docuroot );
|
||||
$pathhome = implode( '/', $docuroot ) . '/';
|
||||
array_pop( $docuroot );
|
||||
$pathTrunk = implode( '/', $docuroot ) . '/';
|
||||
require_once($pathTrunk.'gulliver/system/class.inputfilter.php');
|
||||
$filter = new InputFilter();
|
||||
$this->oid = $filter->validateInput($this->oid);
|
||||
|
||||
while($row = pg_fetch_assoc($result)) {
|
||||
$name = $row["idxname"];
|
||||
@@ -353,6 +405,8 @@ class PgSQLTableInfo extends TableInfo {
|
||||
$arrColumns = explode (' ', $row['indkey']);
|
||||
foreach ($arrColumns as $intColNum)
|
||||
{
|
||||
$intColNum = $filter->validateInput($intColNum, 'int');
|
||||
|
||||
$result2 = pg_query ($this->conn->getResource(), sprintf ("SELECT a.attname
|
||||
FROM pg_catalog.pg_class c JOIN pg_catalog.pg_attribute a ON a.attrelid = c.oid
|
||||
WHERE c.oid = '%s' AND a.attnum = %d AND NOT a.attisdropped
|
||||
@@ -380,6 +434,16 @@ class PgSQLTableInfo extends TableInfo {
|
||||
|
||||
// Primary Keys
|
||||
|
||||
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
|
||||
$docuroot = explode( '/', $realdocuroot );
|
||||
array_pop( $docuroot );
|
||||
$pathhome = implode( '/', $docuroot ) . '/';
|
||||
array_pop( $docuroot );
|
||||
$pathTrunk = implode( '/', $docuroot ) . '/';
|
||||
require_once($pathTrunk.'gulliver/system/class.inputfilter.php');
|
||||
$filter = new InputFilter();
|
||||
$this->oid = $filter->validateInput($this->oid);
|
||||
|
||||
$result = pg_query($this->conn->getResource(), sprintf ("SELECT
|
||||
DISTINCT ON(cls.relname)
|
||||
cls.relname as idxname,
|
||||
@@ -395,11 +459,24 @@ class PgSQLTableInfo extends TableInfo {
|
||||
|
||||
// Loop through the returned results, grouping the same key_name together
|
||||
// adding each column for that key.
|
||||
|
||||
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
|
||||
$docuroot = explode( '/', $realdocuroot );
|
||||
array_pop( $docuroot );
|
||||
$pathhome = implode( '/', $docuroot ) . '/';
|
||||
array_pop( $docuroot );
|
||||
$pathTrunk = implode( '/', $docuroot ) . '/';
|
||||
require_once($pathTrunk.'gulliver/system/class.inputfilter.php');
|
||||
$filter = new InputFilter();
|
||||
$this->oid = $filter->validateInput($this->oid);
|
||||
|
||||
|
||||
while($row = pg_fetch_assoc($result)) {
|
||||
$arrColumns = explode (' ', $row['indkey']);
|
||||
foreach ($arrColumns as $intColNum)
|
||||
{
|
||||
$intColNum = $filter->validateInput($intColNum, 'int');
|
||||
|
||||
$result2 = pg_query ($this->conn->getResource(), sprintf ("SELECT a.attname
|
||||
FROM pg_catalog.pg_class c JOIN pg_catalog.pg_attribute a ON a.attrelid = c.oid
|
||||
WHERE c.oid = '%s' AND a.attnum = %d AND NOT a.attisdropped
|
||||
|
||||
@@ -103,13 +103,23 @@ class SQLiteTableInfo extends TableInfo {
|
||||
include_once 'creole/metadata/IndexInfo.php';
|
||||
|
||||
// columns have to be loaded first
|
||||
if (!$this->colsLoaded) $this->initColumns();
|
||||
if (!$this->colsLoaded) $this->initColumns();
|
||||
|
||||
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
|
||||
$docuroot = explode( '/', $realdocuroot );
|
||||
array_pop( $docuroot );
|
||||
$pathhome = implode( '/', $docuroot ) . '/';
|
||||
array_pop( $docuroot );
|
||||
$pathTrunk = implode( '/', $docuroot ) . '/';
|
||||
require_once($pathTrunk.'gulliver/system/class.inputfilter.php');
|
||||
$filter = new InputFilter();
|
||||
|
||||
$sql = "PRAGMA index_list('".$this->name."')";
|
||||
$res = sqlite_query($this->conn->getResource(), $sql);
|
||||
|
||||
while($row = sqlite_fetch_array($res, SQLITE_ASSOC)) {
|
||||
$name = $row['name'];
|
||||
$name = $filter->validateInput($name);
|
||||
$this->indexes[$name] = new IndexInfo($name);
|
||||
|
||||
// get columns for that index
|
||||
|
||||
@@ -451,6 +451,17 @@ Wrote: /usr/src/redhat/RPMS/i386/PEAR::Net_Socket-1.0-1.i386.rpm
|
||||
}
|
||||
$plist = implode(" ", $params);
|
||||
$cmd = "$php -C -d include_path=$cwd$ps$ip -f $run_tests -- $plist";
|
||||
|
||||
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
|
||||
$docuroot = explode( '/', $realdocuroot );
|
||||
array_pop( $docuroot );
|
||||
$pathhome = implode( '/', $docuroot ) . '/';
|
||||
array_pop( $docuroot );
|
||||
$pathTrunk = implode( '/', $docuroot ) . '/';
|
||||
require_once($pathTrunk.'gulliver/system/class.inputfilter.php');
|
||||
$filter = new InputFilter();
|
||||
$cmd = $filter->validateInput($cmd);
|
||||
|
||||
system($cmd);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ class ConsolidatedCases
|
||||
{
|
||||
function saveConsolidated ($data)
|
||||
{
|
||||
$status = $data['con_status'];
|
||||
$sTasUid = $data['tas_uid'];
|
||||
$sDynUid = $data['dyn_uid'];
|
||||
$sProUid = $data['pro_uid'];
|
||||
@@ -14,11 +15,21 @@ class ConsolidatedCases
|
||||
$title = $data['title'];
|
||||
|
||||
if ($sRepTabUid != '') {
|
||||
if (!$status) {
|
||||
$oCaseConsolidated = new CaseConsolidated();
|
||||
$oCaseConsolidated = CaseConsolidatedPeer::retrieveByPK($sTasUid);
|
||||
if (!(is_object($oCaseConsolidated)) || get_class($oCaseConsolidated) != 'CaseConsolidated') {
|
||||
$oCaseConsolidated = new CaseConsolidated();
|
||||
$oCaseConsolidated->setTasUid($sTasUid);
|
||||
$oCaseConsolidated->setConStatus('INACTIVE');
|
||||
$oCaseConsolidated->save();
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
$rptUid = null;
|
||||
$criteria = new Criteria();
|
||||
|
||||
$criteria->addSelectColumn(ReportTablePeer::REP_TAB_UID);
|
||||
$criteria->add(ReportTablePeer::REP_TAB_NAME, $tableName);
|
||||
$criteria->add(ReportTablePeer::REP_TAB_UID, $sRepTabUid);
|
||||
$rsCriteria = ReportTablePeer::doSelectRS($criteria);
|
||||
|
||||
if ($rsCriteria->next()) {
|
||||
@@ -39,6 +50,7 @@ class ConsolidatedCases
|
||||
@unlink($sPath . PATH_SEP . 'map' . PATH_SEP . $sClassName . 'MapBuilder.php');
|
||||
@unlink($sPath . PATH_SEP . 'om' . PATH_SEP . 'Base' . $sClassName . '.php');
|
||||
@unlink($sPath . PATH_SEP . 'om' . PATH_SEP . 'Base' . $sClassName . 'Peer.php');
|
||||
|
||||
$sRepTabUid = '';
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -322,7 +322,7 @@ class Installer extends Controller
|
||||
if (is_dir( $aux['dirname'] )) {
|
||||
if (! file_exists( $_REQUEST['pathLogFile'] )) {
|
||||
@file_put_contents( $_REQUEST['pathLogFile'], '' );
|
||||
chmod($_REQUEST['pathShared'], 0770);
|
||||
@chmod($_REQUEST['pathShared'], 0770);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1134,222 +1134,4 @@ class DynaForm
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* download file *.po
|
||||
*
|
||||
* @param string $projectUid Unique id of Project
|
||||
* @param string $dynaFormUid Unique id of DynaForm
|
||||
*
|
||||
* return
|
||||
*/
|
||||
public function downloadLanguage($projectUid, $dynaFormUid, $lang)
|
||||
{
|
||||
try {
|
||||
$dynaForm = new \Dynaform();
|
||||
$arraydata = $dynaForm->Load($dynaFormUid);
|
||||
$data = \G::json_decode($arraydata["DYN_LABEL"]);
|
||||
$string = "";
|
||||
$string = $string . "msgid \"\"\n";
|
||||
$string = $string . "msgstr \"\"\n";
|
||||
foreach ($data->{$lang} as $key => $value) {
|
||||
if (is_string($value)) {
|
||||
$string = $string . "\"" . $key . ":" . $value . "\\n\"\n";
|
||||
}
|
||||
}
|
||||
$string = $string . "\n";
|
||||
foreach ($data->{$lang}->Labels as $key => $value) {
|
||||
$string = $string . "msgid \"" . $value->msgid . "\"\n";
|
||||
$string = $string . "msgstr \"" . $value->msgstr . "\"\n\n";
|
||||
}
|
||||
return array("labels" => $string, "lang" => $lang);
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* upload file *.po
|
||||
*
|
||||
* @param string $projectUid Unique id of Project
|
||||
* @param string $dynaFormUid Unique id of DynaForm
|
||||
*
|
||||
* return
|
||||
*/
|
||||
public function uploadLanguage($projectUid, $dynaFormUid)
|
||||
{
|
||||
try {
|
||||
if (isset($_FILES["LANGUAGE"]) && pathinfo($_FILES["LANGUAGE"]["name"], PATHINFO_EXTENSION) == "po") {
|
||||
$translation = array();
|
||||
\G::LoadSystem('i18n_po');
|
||||
$i18n = new \i18n_PO($_FILES["LANGUAGE"]["tmp_name"]);
|
||||
$i18n->readInit();
|
||||
while ($rowTranslation = $i18n->getTranslation()) {
|
||||
array_push($translation, $rowTranslation);
|
||||
}
|
||||
$name = $_FILES["LANGUAGE"]["name"];
|
||||
$name = explode(".", $name);
|
||||
$content = $i18n->getHeaders();
|
||||
$content["File-Name"] = $_FILES["LANGUAGE"]["name"];
|
||||
$content["Labels"] = $translation;
|
||||
|
||||
$dynaForm = new \Dynaform();
|
||||
$arraydata = $dynaForm->Load($dynaFormUid);
|
||||
|
||||
if ($arraydata["DYN_LABEL"] !== null && $arraydata["DYN_LABEL"] !== "") {
|
||||
$dyn_labels = \G::json_decode($arraydata["DYN_LABEL"]);
|
||||
} else {
|
||||
$dyn_labels = new \stdClass();
|
||||
}
|
||||
$dyn_labels->$name[count($name) - 2] = $content;
|
||||
|
||||
$arraydata["DYN_LABEL"] = \G::json_encode($dyn_labels);
|
||||
$dynaForm->update($arraydata);
|
||||
return $dyn_labels;
|
||||
} else {
|
||||
throw new \Exception(\G::LoadTranslation("ID_DYNAFORM_INCORRECT_FILE_NAME"));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* list file .po
|
||||
*
|
||||
* @param string $projectUid Unique id of Project
|
||||
* @param string $dynaFormUid Unique id of DynaForm
|
||||
*
|
||||
* return
|
||||
*/
|
||||
public function listLanguage($projectUid, $dynaFormUid)
|
||||
{
|
||||
try {
|
||||
$list = array();
|
||||
$dynaForm = new \Dynaform();
|
||||
$arraydata = $dynaForm->Load($dynaFormUid);
|
||||
|
||||
if ($arraydata["DYN_LABEL"] === null || $arraydata["DYN_LABEL"] === "")
|
||||
return $list;
|
||||
$dyn_labels = \G::json_decode($arraydata["DYN_LABEL"]);
|
||||
foreach ($dyn_labels as $key => $value) {
|
||||
array_push($list, array(
|
||||
"Lang" => $key,
|
||||
"File-Name" => isset($value->{"File-Name"}) ? $value->{"File-Name"} : "",
|
||||
"Project-Id-Version" => isset($value->{"Project-Id-Version"}) ? $value->{"Project-Id-Version"} : "",
|
||||
"POT-Creation-Date" => isset($value->{"POT-Creation-Date"}) ? $value->{"POT-Creation-Date"} : "",
|
||||
"PO-Revision-Date" => isset($value->{"PO-Revision-Date"}) ? $value->{"PO-Revision-Date"} : "",
|
||||
"Last-Translator" => isset($value->{"Last-Translator"}) ? $value->{"Last-Translator"} : "",
|
||||
"Language-Team" => isset($value->{"Language-Team"}) ? $value->{"Language-Team"} : "",
|
||||
"MIME-Version" => isset($value->{"MIME-Version"}) ? $value->{"MIME-Version"} : "",
|
||||
"Content-Type" => isset($value->{"Content-Type"}) ? $value->{"Content-Type"} : "",
|
||||
"Content-Transfer_Encoding" => isset($value->{"Content-Transfer_Encoding"}) ? $value->{"Content-Transfer_Encoding"} : "",
|
||||
"X-Poedit-Language" => isset($value->{"X-Poedit-Language"}) ? $value->{"X-Poedit-Language"} : "",
|
||||
"X-Poedit-Country" => isset($value->{"X-Poedit-Country"}) ? $value->{"X-Poedit-Country"} : "",
|
||||
"X-Poedit-SourceCharset" => isset($value->{"X-Poedit-SourceCharset"}) ? $value->{"X-Poedit-SourceCharset"} : "",
|
||||
"Content-Transfer-Encoding" => isset($value->{"Content-Transfer-Encoding"}) ? $value->{"Content-Transfer-Encoding"} : ""
|
||||
));
|
||||
}
|
||||
return $list;
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* list file .po
|
||||
*
|
||||
* @param string $projectUid Unique id of Project
|
||||
* @param string $dynaFormUid Unique id of DynaForm
|
||||
*
|
||||
* return
|
||||
*/
|
||||
public function downloadLabels($projectUid, $dynaFormUid)
|
||||
{
|
||||
try {
|
||||
$dynaForm = new \Dynaform();
|
||||
$arraydata = $dynaForm->Load($dynaFormUid);
|
||||
if ($arraydata["DYN_CONTENT"] !== null && $arraydata["DYN_CONTENT"] !== "") {
|
||||
$json = \G::json_decode($arraydata["DYN_CONTENT"]);
|
||||
$this->jsonr($json);
|
||||
}
|
||||
$string = "";
|
||||
$string = $string . "msgid \"\"\n";
|
||||
$string = $string . "msgstr \"\"\n";
|
||||
$string = $string . "\"Project-Id-Version: PM 4.0.1\\n\"\n";
|
||||
$string = $string . "\"POT-Creation-Date: \\n\"\n";
|
||||
$string = $string . "\"PO-Revision-Date: 2010-12-02 11:44+0100 \\n\"\n";
|
||||
$string = $string . "\"Last-Translator: Colosa<colosa@colosa.com>\\n\"\n";
|
||||
$string = $string . "\"Language-Team: Colosa Developers Team <developers@colosa.com>\\n\"\n";
|
||||
$string = $string . "\"MIME-Version: 1.0\\n\"\n";
|
||||
$string = $string . "\"Content-Type: text/plain; charset=utf-8\\n\"\n";
|
||||
$string = $string . "\"Content-Transfer_Encoding: 8bit\\n\"\n";
|
||||
$string = $string . "\"X-Poedit-Language: English\\n\"\n";
|
||||
$string = $string . "\"X-Poedit-Country: United States\\n\"\n";
|
||||
$string = $string . "\"X-Poedit-SourceCharset: utf-8\\n\"\n";
|
||||
$string = $string . "\"Content-Transfer-Encoding: 8bit\\n\"\n\n";
|
||||
|
||||
$n = count($this->dyn_conten_labels);
|
||||
for ($i = 0; $i < $n; $i++) {
|
||||
$string = $string . "msgid \"" . $this->dyn_conten_labels[$i] . "\"\n";
|
||||
$string = $string . "msgstr \"" . $this->dyn_conten_labels[$i] . "\"\n\n";
|
||||
}
|
||||
return array("labels" => $string, "lang" => "en");
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
private $dyn_conten_labels = array();
|
||||
|
||||
/**
|
||||
* labels in dyn_content
|
||||
*
|
||||
* @param array $dyn_content
|
||||
*/
|
||||
private function jsonr(&$json)
|
||||
{
|
||||
foreach ($json as $key => $value) {
|
||||
$sw1 = is_array($value);
|
||||
$sw2 = is_object($value);
|
||||
if ($sw1 || $sw2) {
|
||||
$this->jsonr($value);
|
||||
}
|
||||
if (!$sw1 && !$sw2) {
|
||||
if ($key === "label") {
|
||||
$json->label;
|
||||
array_push($this->dyn_conten_labels, $json->label);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* delete labels
|
||||
*
|
||||
* @param string $projectUid Unique id of Project
|
||||
* @param string $dynaFormUid Unique id of DynaForm
|
||||
*
|
||||
* return
|
||||
*/
|
||||
public function deleteLanguage($projectUid, $dynaFormUid, $lang)
|
||||
{
|
||||
try {
|
||||
$dynaForm = new \Dynaform();
|
||||
$arraydata = $dynaForm->Load($dynaFormUid);
|
||||
|
||||
if ($arraydata["DYN_LABEL"] !== null && $arraydata["DYN_LABEL"] !== "") {
|
||||
$dyn_labels = \G::json_decode($arraydata["DYN_LABEL"]);
|
||||
unset($dyn_labels->{$lang});
|
||||
}
|
||||
|
||||
$arraydata["DYN_LABEL"] = \G::json_encode($dyn_labels);
|
||||
$dynaForm->update($arraydata);
|
||||
return;
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -387,6 +387,7 @@ class Task
|
||||
G::LoadClass("consolidatedCases");
|
||||
$consolidated = new \ConsolidatedCases();
|
||||
$dataConso = array(
|
||||
'con_status' => $arrayProperty['CONSOLIDATE_DATA']['consolidated_enable'],
|
||||
'tas_uid' => $arrayProperty['TAS_UID'],
|
||||
'dyn_uid' => $arrayProperty['CONSOLIDATE_DATA']['consolidated_dynaform'],
|
||||
'pro_uid' => $arrayProperty['PRO_UID'],
|
||||
@@ -395,7 +396,6 @@ class Task
|
||||
'title' => $arrayProperty['CONSOLIDATE_DATA']['consolidated_title']
|
||||
);
|
||||
$consolidated->saveConsolidated($dataConso);
|
||||
|
||||
}
|
||||
$arrayResult["status"] = "OK";
|
||||
|
||||
|
||||
@@ -1060,7 +1060,7 @@ class User
|
||||
}
|
||||
}
|
||||
}
|
||||
$oCriteria->add(\UsersPeer::USR_STATUS, 'CLOSED', \Criteria::ALT_NOT_EQUAL);
|
||||
$oCriteria->add(\UsersPeer::USR_STATUS, "ACTIVE", \Criteria::EQUAL);
|
||||
$oDataset = \UsersPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
while ($oDataset->next()) {
|
||||
|
||||
@@ -494,30 +494,12 @@ class Variable
|
||||
$process->throwExceptionIfNotExistsProcess($processUid, strtolower("PRJ_UID"));
|
||||
|
||||
//Set data
|
||||
$variableDbConnectionUid = "";
|
||||
$variableSql = "";
|
||||
|
||||
$criteria = new \Criteria("workflow");
|
||||
|
||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_DBCONNECTION);
|
||||
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_SQL);
|
||||
$criteria->add(\ProcessVariablesPeer::PRJ_UID, $processUid, \Criteria::EQUAL);
|
||||
$criteria->add(\ProcessVariablesPeer::VAR_NAME, $variableName, \Criteria::EQUAL);
|
||||
|
||||
$rsCriteria = \ProcessVariablesPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
if ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
|
||||
$variableDbConnectionUid = $row["VAR_DBCONNECTION"];
|
||||
$variableSql = strtoupper($row["VAR_SQL"]);
|
||||
} else {
|
||||
throw new \Exception(G::LoadTranslation("ID_PROCESS_VARIABLE_DOES_NOT_EXIST", array("VAR_NAME", $variableName)));
|
||||
}
|
||||
|
||||
//Verify data
|
||||
$this->throwExceptionIfSomeRequiredVariableSqlIsMissingInVariables($variableName, $variableSql, $arrayVariable);
|
||||
|
||||
\G::LoadClass('pmDynaform');
|
||||
$pmDynaform = new \pmDynaform();
|
||||
$field = $pmDynaform->searchField($arrayVariable["dyn_uid"], $arrayVariable["field_id"]);
|
||||
$variableDbConnectionUid = $field !== null ? $field->dbConnection : "";
|
||||
$variableSql = $field !== null ? $field->sql : "";
|
||||
|
||||
//Get data
|
||||
$_SESSION["PROCESS"] = $processUid;
|
||||
|
||||
@@ -533,7 +515,7 @@ class Variable
|
||||
|
||||
$arrayRecord[] = array(
|
||||
strtolower("VALUE") => $row[0],
|
||||
strtolower("TEXT") => $row[1]
|
||||
strtolower("TEXT") => isset($row[1]) ? $row[1] : $row[0]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -122,13 +122,12 @@ class DynaForm extends Api
|
||||
public function doGetDynaFormLanguage($dyn_uid, $prj_uid, $lang)
|
||||
{
|
||||
try {
|
||||
$dynaForm = new \ProcessMaker\BusinessModel\DynaForm();
|
||||
$dynaForm->setFormatFieldNameInUppercase(false);
|
||||
$response = $dynaForm->downloadLanguage($prj_uid, $dyn_uid, $lang);
|
||||
return $response;
|
||||
\G::LoadClass('pmDynaform');
|
||||
$pmDynaform = new \pmDynaform();
|
||||
return $pmDynaform->downloadLanguage($dyn_uid, $lang);
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -140,10 +139,9 @@ class DynaForm extends Api
|
||||
public function doPostDynaFormLanguage($dyn_uid, $prj_uid)
|
||||
{
|
||||
try {
|
||||
$dynaForm = new \ProcessMaker\BusinessModel\DynaForm();
|
||||
$dynaForm->setFormatFieldNameInUppercase(false);
|
||||
$response = $dynaForm->uploadLanguage($prj_uid, $dyn_uid);
|
||||
return $response;
|
||||
\G::LoadClass('pmDynaform');
|
||||
$pmDynaform = new \pmDynaform();
|
||||
$pmDynaform->uploadLanguage($dyn_uid);
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
@@ -158,10 +156,9 @@ class DynaForm extends Api
|
||||
public function doDeleteDynaFormLanguage($dyn_uid, $prj_uid, $lang)
|
||||
{
|
||||
try {
|
||||
$dynaForm = new \ProcessMaker\BusinessModel\DynaForm();
|
||||
$dynaForm->setFormatFieldNameInUppercase(false);
|
||||
$response = $dynaForm->deleteLanguage($prj_uid, $dyn_uid, $lang);
|
||||
return $response;
|
||||
\G::LoadClass('pmDynaform');
|
||||
$pmDynaform = new \pmDynaform();
|
||||
$pmDynaform->deleteLanguage($dyn_uid, $lang);
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
@@ -176,33 +173,12 @@ class DynaForm extends Api
|
||||
public function doGetListDynaFormLanguage($dyn_uid, $prj_uid)
|
||||
{
|
||||
try {
|
||||
$dynaForm = new \ProcessMaker\BusinessModel\DynaForm();
|
||||
$dynaForm->setFormatFieldNameInUppercase(false);
|
||||
$response = $dynaForm->listLanguage($prj_uid, $dyn_uid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url GET /:prj_uid/dynaform/:dyn_uid/download-labels
|
||||
*
|
||||
* @param string $dyn_uid {@min 32}{@max 32}
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
*/
|
||||
public function doGetListDynaFormLabels($dyn_uid, $prj_uid)
|
||||
{
|
||||
try {
|
||||
$dynaForm = new \ProcessMaker\BusinessModel\DynaForm();
|
||||
$dynaForm->setFormatFieldNameInUppercase(false);
|
||||
$response = $dynaForm->downloadLabels($prj_uid, $dyn_uid);
|
||||
return $response;
|
||||
\G::LoadClass('pmDynaform');
|
||||
$pmDynaform = new \pmDynaform();
|
||||
return $pmDynaform->listLanguage($dyn_uid);
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
<div class="head"></div>
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="#" ><span class="mafe-button-close" ></span></a></li>
|
||||
<li><a class="mafe-close" href="#" ><span class="mafe-button-close" ></span></a></li>
|
||||
<li class="mafe-save-process"><a href="#" class="mafe-button-save"></a></li>
|
||||
<li><a href="#" class="mafe-button-export-process"></a></li>
|
||||
<li><a class="mafe-button-export-bpmn-process"></a></li>
|
||||
|
||||
@@ -601,13 +601,7 @@ function saveProcess()
|
||||
if (projectType == 'classicProject') {
|
||||
location.href = 'processes_Map?PRO_UID='+resp.result.PRO_UID;
|
||||
} else {
|
||||
if ((navigator.userAgent.indexOf("MSIE") != -1) || (navigator.userAgent.indexOf("Trident") != -1)) {
|
||||
winDesigner = window.open("../designer?prj_uid=" + resp.result.PRO_UID, 'winDesigner');
|
||||
Ext.getCmp('newProjectWin').close();
|
||||
processesGrid.store.reload();
|
||||
} else {
|
||||
location.href = '../designer?prj_uid=' + resp.result.PRO_UID;
|
||||
}
|
||||
openWindowIfIE('../designer?prj_uid=' + resp.result.PRO_UID);
|
||||
}
|
||||
},
|
||||
failure: function(obj, resp) {
|
||||
@@ -656,12 +650,7 @@ editProcess = function(typeParam)
|
||||
} else {
|
||||
url = 'processes_Map?PRO_UID=' + pro_uid;
|
||||
}
|
||||
|
||||
if ( ((navigator.userAgent.indexOf("MSIE")!=-1) || (navigator.userAgent.indexOf("Trident")!=-1)) && (type == "bpmn") ) {
|
||||
winDesigner = window.open(url, 'winDesigner');
|
||||
} else {
|
||||
location.href = url;
|
||||
}
|
||||
openWindowIfIE(url);
|
||||
}
|
||||
|
||||
editNewProcess = function(){
|
||||
@@ -870,6 +859,7 @@ importProcessExistGroup = function()
|
||||
var processFileType = importProcessGlobal.processFileType;
|
||||
|
||||
var w = new Ext.Window({
|
||||
id : 'importProcessExistGroupWindow',
|
||||
title : _('ID_IMPORT_PROCESS') + processFileTypeTitle,
|
||||
header : false,
|
||||
width : 460,
|
||||
@@ -966,13 +956,7 @@ importProcessExistGroup = function()
|
||||
var sNewProUid = resp_.sNewProUid;
|
||||
|
||||
if (typeof(resp_.project_type) != "undefined" && resp_.project_type == "bpmn") {
|
||||
if ((navigator.userAgent.indexOf("MSIE") != -1) || (navigator.userAgent.indexOf("Trident") != -1)) {
|
||||
winDesigner = window.open("../designer?prj_uid=" + sNewProUid, 'winDesigner');
|
||||
w.close();
|
||||
processesGrid.store.reload();
|
||||
} else {
|
||||
window.location.href = "../designer?prj_uid=" + sNewProUid;
|
||||
}
|
||||
openWindowIfIE("../designer?prj_uid=" + sNewProUid);
|
||||
} else {
|
||||
window.location.href = "processes_Map?PRO_UID=" + sNewProUid;
|
||||
}
|
||||
@@ -1012,6 +996,7 @@ importProcessExistProcess = function()
|
||||
var proFileName = importProcessGlobal.proFileName;
|
||||
|
||||
var w = new Ext.Window({
|
||||
id : 'importProcessExistProcessWindow',
|
||||
title : _('ID_IMPORT_PROCESS') + processFileTypeTitle,
|
||||
header : false,
|
||||
width : 460,
|
||||
@@ -1115,14 +1100,7 @@ importProcessExistProcess = function()
|
||||
|
||||
if (resp_.ExistGroupsInDatabase == 0) {
|
||||
if (typeof(resp_.project_type) != "undefined" && resp_.project_type == "bpmn") {
|
||||
if ((navigator.userAgent.indexOf("MSIE") != -1) || (navigator.userAgent.indexOf("Trident") != -1)) {
|
||||
winDesigner = window.open("../designer?prj_uid=" + sNewProUid,'winDesigner');
|
||||
Ext.getCmp('importProcessWindow').close();
|
||||
w.close();
|
||||
processesGrid.store.reload();
|
||||
} else {
|
||||
window.location.href = "../designer?prj_uid=" + sNewProUid;
|
||||
}
|
||||
openWindowIfIE("../designer?prj_uid=" + sNewProUid);
|
||||
} else {
|
||||
window.location.href = "processes_Map?PRO_UID=" + sNewProUid;
|
||||
}
|
||||
@@ -1263,13 +1241,7 @@ importProcess = function()
|
||||
var sNewProUid = resp_.sNewProUid;
|
||||
|
||||
if (typeof(resp_.project_type) != "undefined" && resp_.project_type == "bpmn") {
|
||||
if ((navigator.userAgent.indexOf("MSIE") != -1) || (navigator.userAgent.indexOf("Trident") != -1)) {
|
||||
winDesigner = window.open("../designer?prj_uid=" + sNewProUid,"winDesigner");
|
||||
w.close();
|
||||
processesGrid.store.reload();
|
||||
} else {
|
||||
window.location.href = "../designer?prj_uid=" + sNewProUid;
|
||||
}
|
||||
openWindowIfIE("../designer?prj_uid=" + sNewProUid);
|
||||
} else {
|
||||
window.location.href = "processes_Map?PRO_UID=" + sNewProUid;
|
||||
}
|
||||
@@ -1334,6 +1306,7 @@ importProcess = function()
|
||||
}
|
||||
|
||||
var windowbpmnoption = new Ext.Window({
|
||||
id: 'windowBpmnOptionWindow',
|
||||
title: _('ID_IMPORT_PROCESS'),
|
||||
header: false,
|
||||
width: 420,
|
||||
@@ -1507,3 +1480,31 @@ Ext.EventManager.on(window, 'beforeunload', function () {
|
||||
if (winDesigner)
|
||||
winDesigner.close();
|
||||
});
|
||||
|
||||
|
||||
function openWindowIfIE(pathDesigner) {
|
||||
if ((navigator.userAgent.indexOf("MSIE") != -1) || (navigator.userAgent.indexOf("Trident") != -1)) {
|
||||
if (Ext.getCmp('newProjectWin'))
|
||||
Ext.getCmp('newProjectWin').close();
|
||||
if (Ext.getCmp('importProcessWindow'))
|
||||
Ext.getCmp('importProcessWindow').close();
|
||||
if (Ext.getCmp('importProcessExistGroupWindow'))
|
||||
Ext.getCmp('importProcessExistGroupWindow').close();
|
||||
if (Ext.getCmp('importProcessExistProcessWindow'))
|
||||
Ext.getCmp('importProcessExistProcessWindow').close();
|
||||
if (Ext.getCmp('windowBpmnOptionWindow'))
|
||||
Ext.getCmp('windowBpmnOptionWindow').close();
|
||||
processesGrid.store.reload();
|
||||
if (winDesigner && winDesigner.closed === false) {
|
||||
if (winDesigner.window.PMDesigner.project.isDirty()) {
|
||||
Ext.Msg.alert(_('ID_REFRESH_LABEL'), _('ID_UNSAVED_TRIGGERS_WINDOW'));
|
||||
} else {
|
||||
winDesigner = window.open(pathDesigner, 'winDesigner');
|
||||
}
|
||||
} else {
|
||||
winDesigner = window.open(pathDesigner, 'winDesigner');
|
||||
}
|
||||
return;
|
||||
}
|
||||
location.href = pathDesigner;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user