mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 23:32:17 +02:00
Reintegrated fixes from branch 1.2.1 (2116,2118,2119)
- HTML attributes > 64 Kb - Log of notification displayed as HTML SVN:1.2[2120]
This commit is contained in:
@@ -1837,7 +1837,7 @@ class AttributeCaseLog extends AttributeLongText
|
|||||||
*
|
*
|
||||||
* @package iTopORM
|
* @package iTopORM
|
||||||
*/
|
*/
|
||||||
class AttributeHTML extends AttributeText
|
class AttributeHTML extends AttributeLongText
|
||||||
{
|
{
|
||||||
public function GetEditClass() {return "HTML";}
|
public function GetEditClass() {return "HTML";}
|
||||||
|
|
||||||
@@ -2316,6 +2316,7 @@ class AttributeDateTime extends AttributeDBField
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
$oNewCondition = parent::GetSmartConditionExpression($sSearchText, $oField, $aParams);
|
$oNewCondition = parent::GetSmartConditionExpression($sSearchText, $oField, $aParams);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $oNewCondition;
|
return $oNewCondition;
|
||||||
@@ -3298,16 +3299,26 @@ class AttributeOneWayPassword extends AttributeDefinition
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Indexed array having two dimensions
|
// Indexed array having two dimensions
|
||||||
class AttributeTable extends AttributeText
|
class AttributeTable extends AttributeDBField
|
||||||
{
|
{
|
||||||
public function GetEditClass() {return "Text";}
|
public function GetEditClass() {return "Table";}
|
||||||
protected function GetSQLCol() {return "TEXT";}
|
protected function GetSQLCol() {return "LONGTEXT";}
|
||||||
|
|
||||||
public function GetMaxSize()
|
public function GetMaxSize()
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function GetNullValue()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function IsNull($proposedValue)
|
||||||
|
{
|
||||||
|
return (count($proposedValue) == 0);
|
||||||
|
}
|
||||||
|
|
||||||
// Facilitate things: allow the user to Set the value from a string
|
// Facilitate things: allow the user to Set the value from a string
|
||||||
public function MakeRealValue($proposedValue, $oHostObj)
|
public function MakeRealValue($proposedValue, $oHostObj)
|
||||||
{
|
{
|
||||||
@@ -3370,13 +3381,39 @@ class AttributeTable extends AttributeText
|
|||||||
$sRes .= "</TABLE>";
|
$sRes .= "</TABLE>";
|
||||||
return $sRes;
|
return $sRes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function GetAsCSV($sValue, $sSeparator = ',', $sTextQualifier = '"', $oHostObject = null)
|
||||||
|
{
|
||||||
|
// Not implemented
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetAsXML($value, $oHostObject = null)
|
||||||
|
{
|
||||||
|
if (count($value) == 0)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
$sRes = "";
|
||||||
|
foreach($value as $iRow => $aRawData)
|
||||||
|
{
|
||||||
|
$sRes .= "<row>";
|
||||||
|
foreach ($aRawData as $iCol => $cell)
|
||||||
|
{
|
||||||
|
$sCell = Str::pure2xml((string)$cell);
|
||||||
|
$sRes .= "<cell icol=\"$iCol\">$sCell</cell>";
|
||||||
|
}
|
||||||
|
$sRes .= "</row>";
|
||||||
|
}
|
||||||
|
return $sRes;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The PHP value is a hash array, it is stored as a TEXT column
|
// The PHP value is a hash array, it is stored as a TEXT column
|
||||||
class AttributePropertySet extends AttributeTable
|
class AttributePropertySet extends AttributeTable
|
||||||
{
|
{
|
||||||
public function GetEditClass() {return "Text";}
|
public function GetEditClass() {return "PropertySet";}
|
||||||
protected function GetSQLCol() {return "TEXT";}
|
|
||||||
|
|
||||||
// Facilitate things: allow the user to Set the value from a string
|
// Facilitate things: allow the user to Set the value from a string
|
||||||
public function MakeRealValue($proposedValue, $oHostObj)
|
public function MakeRealValue($proposedValue, $oHostObj)
|
||||||
@@ -3403,6 +3440,10 @@ class AttributePropertySet extends AttributeTable
|
|||||||
$sRes .= "<TBODY>";
|
$sRes .= "<TBODY>";
|
||||||
foreach($value as $sProperty => $sValue)
|
foreach($value as $sProperty => $sValue)
|
||||||
{
|
{
|
||||||
|
if ($sProperty == 'auth_pwd')
|
||||||
|
{
|
||||||
|
$sValue = '*****';
|
||||||
|
}
|
||||||
$sRes .= "<TR>";
|
$sRes .= "<TR>";
|
||||||
$sCell = str_replace("\n", "<br>\n", Str::pure2html((string)$sValue));
|
$sCell = str_replace("\n", "<br>\n", Str::pure2html((string)$sValue));
|
||||||
$sRes .= "<TD class=\"label\">$sProperty</TD><TD>$sCell</TD>";
|
$sRes .= "<TD class=\"label\">$sProperty</TD><TD>$sCell</TD>";
|
||||||
@@ -3412,6 +3453,53 @@ class AttributePropertySet extends AttributeTable
|
|||||||
$sRes .= "</TABLE>";
|
$sRes .= "</TABLE>";
|
||||||
return $sRes;
|
return $sRes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function GetAsCSV($value, $sSeparator = ',', $sTextQualifier = '"', $oHostObject = null)
|
||||||
|
{
|
||||||
|
if (count($value) == 0)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
$aRes = array();
|
||||||
|
foreach($value as $sProperty => $sValue)
|
||||||
|
{
|
||||||
|
if ($sProperty == 'auth_pwd')
|
||||||
|
{
|
||||||
|
$sValue = '*****';
|
||||||
|
}
|
||||||
|
$sFrom = array(',', '=');
|
||||||
|
$sTo = array('\,', '\=');
|
||||||
|
$aRes[] = $sProperty.'='.str_replace($sFrom, $sTo, (string)$sValue);
|
||||||
|
}
|
||||||
|
$sRaw = implode(',', $aRes);
|
||||||
|
|
||||||
|
$sFrom = array("\r\n", $sTextQualifier);
|
||||||
|
$sTo = array("\n", $sTextQualifier.$sTextQualifier);
|
||||||
|
$sEscaped = str_replace($sFrom, $sTo, $sRaw);
|
||||||
|
return $sTextQualifier.$sEscaped.$sTextQualifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function GetAsXML($value, $oHostObject = null)
|
||||||
|
{
|
||||||
|
if (count($value) == 0)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
$sRes = "";
|
||||||
|
foreach($value as $sProperty => $sValue)
|
||||||
|
{
|
||||||
|
if ($sProperty == 'auth_pwd')
|
||||||
|
{
|
||||||
|
$sValue = '*****';
|
||||||
|
}
|
||||||
|
$sRes .= "<property id=\"$sProperty\">";
|
||||||
|
$sRes .= Str::pure2xml((string)$sValue);
|
||||||
|
$sRes .= "</property>";
|
||||||
|
}
|
||||||
|
return $sRes;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ class EventNotificationEmail extends EventNotification
|
|||||||
MetaModel::Init_AddAttribute(new AttributeText("bcc", array("allowed_values"=>null, "sql"=>"bcc", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array())));
|
MetaModel::Init_AddAttribute(new AttributeText("bcc", array("allowed_values"=>null, "sql"=>"bcc", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array())));
|
||||||
MetaModel::Init_AddAttribute(new AttributeText("from", array("allowed_values"=>null, "sql"=>"from", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array())));
|
MetaModel::Init_AddAttribute(new AttributeText("from", array("allowed_values"=>null, "sql"=>"from", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array())));
|
||||||
MetaModel::Init_AddAttribute(new AttributeText("subject", array("allowed_values"=>null, "sql"=>"subject", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array())));
|
MetaModel::Init_AddAttribute(new AttributeText("subject", array("allowed_values"=>null, "sql"=>"subject", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array())));
|
||||||
MetaModel::Init_AddAttribute(new AttributeText("body", array("allowed_values"=>null, "sql"=>"body", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array())));
|
MetaModel::Init_AddAttribute(new AttributeHTML("body", array("allowed_values"=>null, "sql"=>"body", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array())));
|
||||||
|
|
||||||
// Display lists
|
// Display lists
|
||||||
MetaModel::Init_SetZListItems('details', array('date', 'userinfo', 'message', 'trigger_id', 'action_id', 'object_id', 'to', 'cc', 'bcc', 'from', 'subject', 'body')); // Attributes to be displayed for the complete details
|
MetaModel::Init_SetZListItems('details', array('date', 'userinfo', 'message', 'trigger_id', 'action_id', 'object_id', 'to', 'cc', 'bcc', 'from', 'subject', 'body')); // Attributes to be displayed for the complete details
|
||||||
|
|||||||
Reference in New Issue
Block a user