From: kurund Date: Mon, 13 Jan 2014 20:07:24 +0000 (-0800) Subject: Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-01-13-11-57-38 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b2aaa85e468d3720fd624080fe72b896270ba89a;p=civicrm-core.git Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-01-13-11-57-38 Conflicts: CRM/Core/Form/Tag.php --- b2aaa85e468d3720fd624080fe72b896270ba89a diff --cc CRM/Core/BAO/File.php index 6cf049bc93,8fae6a5ea8..a6a228f1b7 --- a/CRM/Core/BAO/File.php +++ b/CRM/Core/BAO/File.php @@@ -556,57 -556,5 +556,57 @@@ CRM_Core_BAO_File::deleteEntityFile($params['entityTable'], $params['entityID'], NULL, $params['fileID']); } -} + /** + * function to display paper icon for a file attachment -- CRM-13624 + * + * @param $entityTable string The entityTable to which the file is attached. eg "civicrm_contact", "civicrm_note", "civicrm_activity" + * @param $entityID int The id of the object in the above entityTable + * + * @return array|NULL list of HTML snippets; one HTML snippet for each attachment. If none found, then NULL + * + * @static + * @access public + */ + static function paperIconAttachment( $entityTable, $entityID ) { + if (empty($entityTable) || !$entityID) { + $results = NULL; + return $results; + } + $currentAttachmentInfo = self::getEntityFile( $entityTable, $entityID ); + foreach($currentAttachmentInfo as $fileKey => $fileValue) { + $fileID = $fileValue['fileID']; + $fileType = $fileValue['mime_type']; + $eid = $entityID; + if($fileID) { + if ($fileType == 'image/jpeg' || + $fileType == 'image/pjpeg' || + $fileType == 'image/gif' || + $fileType == 'image/x-png' || + $fileType == 'image/png' + ) { + $url = $fileValue['url']; + $alt = $fileValue['cleanName']; + $file_url[$fileID] = " + +
+
"; + // for non image files + } + else { + $url = $fileValue['url']; + $alt = $fileValue['cleanName']; + $file_url[$fileID] = "
"; + } + } + } + if(empty($file_url)) { + $results = NULL; + } + else { + $results = $file_url; + } + return $results; + } + - } ++} diff --cc CRM/Core/Form/Tag.php index 5eeaec35b0,e36dccd88c..cd45fd074b --- a/CRM/Core/Form/Tag.php +++ b/CRM/Core/Form/Tag.php @@@ -226,7 -226,8 +226,9 @@@ class CRM_Core_Form_Tag } if (!empty($tagset)) { + // assign current tagsets which is used in postProcess + $form->_tagsetInfo = $tagset; + $form->assign("tagsetType", $mode); $form->assign("tagsetInfo_$mode", $tagset); $form->assign("isTagset", TRUE); } diff --cc CRM/Utils/Hook.php index 15ca491a2c,bed5f0dfcd..6e337115d9 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@@ -1392,6 -1386,16 +1392,16 @@@ abstract class CRM_Utils_Hook * @return void */ static function queryObjects(&$queryObjects, $type = 'Contact') { - return self::singleton()->invoke(2, $queryObjects, $type, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_queryObjects'); + return self::singleton()->invoke(2, $queryObjects, $type, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_queryObjects'); } + + /** + * This hook is called while viewing contact dashboard + * + * @param array $availableDashlets list of dashlets; each is formatted per api/v3/Dashboard + * @param array $activeDashlets list of dashlets; each is formatted per api/v3/DashboardContact + */ + static function dashboard_defaults($availableDashlets, &$defaultDashlets) { + return self::singleton()->invoke(2, $availableDashlets, $defaultDashlets, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_dashboard_defaults'); + } }