\n";
@@ -299,13 +315,14 @@ class UILinksWidgetDirect
$sHtml .= "\n";
$oPage->add($sHtml);
}
-
+
/**
* Search for objects to be linked to the current object (i.e "remote" objects)
* @param WebPage $oP The page used for the output (usually an AjaxWebPage)
* @param string $sRemoteClass Name of the "remote" class to perform the search on, must be a derived class of $this->sLinkedClass
* @param array $aAlreadyLinked Array of indentifiers of objects which are already linke to the current object (or about to be linked)
* @param DBObject $oCurrentObj The object currently being edited... if known...
+ * @throws Exception
*/
public function SearchObjectsToAdd(WebPage $oP, $sRemoteClass = '', $aAlreadyLinked = array(), $oCurrentObj = null)
{
@@ -350,6 +367,10 @@ class UILinksWidgetDirect
$oBlock->Display($oP, "ResultsToAdd_{$this->sInputid}", array('menu' => false, 'cssCount'=> '#count_'.$this->sInputid , 'selection_mode' => true, 'table_id' => 'add_'.$this->sInputid)); // Don't display the 'Actions' menu on the results
}
+ /**
+ * @param WebPage $oP
+ * @param $oFullSetFilter
+ */
public function DoAddObjects(WebPage $oP, $oFullSetFilter)
{
$aLinkedObjectIds = utils::ReadMultipleSelection($oFullSetFilter);
@@ -377,7 +398,14 @@ class UILinksWidgetDirect
}
return $aAttribs;
}
-
+
+ /**
+ * @param WebPage $oPage
+ * @param string $sRealClass
+ * @param array $aValues
+ * @param int $iTempId
+ * @return mixed
+ */
public function GetRow($oPage, $sRealClass, $aValues, $iTempId)
{
if ($sRealClass == '')
@@ -389,7 +417,13 @@ class UILinksWidgetDirect
return $this->GetObjectRow($oPage, $oLinkObj, $iTempId);
}
-
+
+ /**
+ * @param WebPage $oPage
+ * @param $oLinkObj
+ * @param int $iTempId
+ * @return mixed
+ */
protected function GetObjectRow($oPage, $oLinkObj, $iTempId)
{
$aAttribs = $this->GetTableConfig();
@@ -405,7 +439,7 @@ class UILinksWidgetDirect
/**
* Initializes the default search parameters based on 1) a 'current' object and 2) the silos defined by the context
* @param DBObject $oSourceObj
- * @param DBSearch $oSearch
+ * @param DBSearch|DBObjectSearch $oSearch
*/
protected function SetSearchDefaultFromContext($oSourceObj, &$oSearch)
{
@@ -424,7 +458,6 @@ class UILinksWidgetDirect
if (MetaModel::IsValidAttCode($sSrcClass, $sAttCode))
{
- $oAttDef = MetaModel::GetAttributeDef($sSrcClass, $sAttCode);
$defaultValue = $oSourceObj->Get($sAttCode);
// Find the attcode for the same 'context' parameter in the destination class
diff --git a/application/ui.linkswidget.class.inc.php b/application/ui.linkswidget.class.inc.php
index db034cb4fb..60a746dc8f 100644
--- a/application/ui.linkswidget.class.inc.php
+++ b/application/ui.linkswidget.class.inc.php
@@ -39,7 +39,15 @@ class UILinksWidget
protected $m_sLinkedClass;
protected $m_sRemoteClass;
protected $m_bDuplicatesAllowed;
-
+
+ /**
+ * UILinksWidget constructor.
+ * @param string $sClass
+ * @param string $sAttCode
+ * @param int $iInputId
+ * @param string $sNameSuffix
+ * @param bool $bDuplicatesAllowed
+ */
public function __construct($sClass, $sAttCode, $iInputId, $sNameSuffix = '', $bDuplicatesAllowed = false)
{
$this->m_sClass = $sClass;
@@ -98,11 +106,11 @@ class UILinksWidget
* @param WebPage $oP Web page used for the ouput
* @param DBObject $oLinkedObj Remote object
* @param mixed $linkObjOrId Either the object linked or a unique number for new link records to add
- * @param array|Hash $aArgs Extra context arguments
- * @param $oCurrentObj The object to which all the elements of the linked set refer to
- * @param $iUniqueId A unique identifier of new links
- * @param boolean $bReadOnly Display link as editable or read-only. Default is false (editable)
- * @return string The HTML fragment of the one-row form
+ * @param array $aArgs Extra context arguments
+ * @param DBObject $oCurrentObj The object to which all the elements of the linked set refer to
+ * @param int $iUniqueId A unique identifier of new links
+ * @param boolean $bReadOnly Display link as editable or read-only. Default is false (editable)
+ * @return array The HTML fragment of the one-row form
*/
protected function GetFormRow(WebPage $oP, DBObject $oLinkedObj, $linkObjOrId, $aArgs, $oCurrentObj, $iUniqueId, $bReadOnly = false)
{
@@ -229,7 +237,11 @@ EOF
/**
* Display one row of the whole form
- * @return none
+ * @param WebPage $oP
+ * @param array $aConfig
+ * @param array $aRow
+ * @param int $iRowId
+ * @return string
*/
protected function DisplayFormRow(WebPage $oP, $aConfig, $aRow, $iRowId)
{
@@ -247,8 +259,8 @@ EOF
/**
* Display the table with the form for editing all the links at once
* @param WebPage $oP The web page used for the output
- * @param Hash $aConfig The table's header configuration
- * @param Hash $aData The tabular data to be displayed
+ * @param array $aConfig The table's header configuration
+ * @param array $aData The tabular data to be displayed
* @return string Html fragment representing the form table
*/
protected function DisplayFormTable(WebPage $oP, $aConfig, $aData)
@@ -285,21 +297,20 @@ EOF
return $sHtml;
}
-
+
/**
* Get the HTML fragment corresponding to the linkset editing widget
- * @param WebPage $oP The web page used for all the output
- * @param DBObjectSet The initial value of the linked set
- * @param Hash $aArgs Extra context arguments
+ * @param WebPage $oPage
+ * @param DBObject|ormLinkSet $oValue
+ * @param array $aArgs Extra context arguments
* @param string $sFormPrefix prefix of the fields in the current form
* @param DBObject $oCurrentObj the current object to which the linkset is related
* @return string The HTML fragment to be inserted into the page
*/
- public function Display(WebPage $oPage, DBObjectSet $oValue, $aArgs = array(), $sFormPrefix, $oCurrentObj)
+ public function Display(WebPage $oPage, $oValue, $aArgs = array(), $sFormPrefix, $oCurrentObj)
{
$sHtmlValue = '';
- $sTargetClass = self::GetTargetClass($this->m_sClass, $this->m_sAttCode);
$sHtmlValue .= "