| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
*
* @throws Exception
*/
- static function filePostProcess(
+ public static function filePostProcess(
$data,
$fileTypeID,
$entityTable,
/**
* The $useWhere is used so that the signature matches the parent class
*
- public function delete($useWhere = FALSE) {
- list($fileID, $entityID, $fieldID) = func_get_args();
-
- self::deleteFileReferences($fileID, $entityID, $fieldID);
- } */
+ * public function delete($useWhere = FALSE) {
+ * list($fileID, $entityID, $fieldID) = func_get_args();
+ *
+ * self::deleteFileReferences($fileID, $entityID, $fieldID);
+ * } */
/**
* Delete all the files and associated object associated with this
//delete tags from entity tag table
$tagParams = array(
'entity_table' => 'civicrm_file',
- 'entity_id' => $fId
+ 'entity_id' => $fId,
);
CRM_Core_BAO_EntityTag::del($tagParams);
$form->addElement('text', "attachDesc_$i", NULL, array(
'size' => 40,
'maxlength' => 255,
- 'placeholder' => ts('Description')
+ 'placeholder' => ts('Description'),
));
if (!empty($tags)) {
'id' => "tags_$i",
'multiple' => 'multiple',
'class' => 'huge crm-select2',
- 'placeholder' => ts('- none -')
+ 'placeholder' => ts('- none -'),
)
);
}
* Return a clean url string and the number of attachment for a
* given entityTable, entityID
*
- * @param $entityTable
- * String The entityTable to which the file is attached.
- * @param $entityID
- * Int The id of the object in the above entityTable.
- * @param $separator
- * String The string separator where to implode the urls.
+ * @param string $entityTable
+ * The entityTable to which the file is attached.
+ * @param int $entityID
+ * The id of the object in the above entityTable.
+ * @param string $separator
+ * The string separator where to implode the urls.
*
- * @return array An array with 2 elements. The string and the number of attachments
- * @static
+ * @return array
+ * An array with 2 elements. The string and the number of attachments
*/
public static function attachmentInfo($entityTable, $entityID, $separator = '<br />') {
if (!$entityID) {
* @param $entityTable
* @param int $entityID
*/
- static function formatAttachment(
+ public static function formatAttachment(
&$formValues,
&$params,
$entityTable,
'description' => $formValues[$attachDesc],
'upload_date' => $now,
'tag' => $tagParams,
- 'attachment_taglist' => CRM_Utils_Array::value($attachFreeTags, $formValues, array())
+ 'attachment_taglist' => CRM_Utils_Array::value($attachFreeTags, $formValues, array()),
);
$params[$attachName] = $fileParams;
return $names;
}
- /*
+ /**
* copy/attach an existing file to a different entity
* table and id.
- */
- /**
+ *
* @param $oldEntityTable
* @param int $oldEntityId
* @param $newEntityTable
/**
* Delete a file attachment from an entity table / entity ID
*
- * @static
*/
public static function deleteAttachment() {
$params = array();
/**
* 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 string $entityTable
+ * The entityTable to which the file is attached. eg "civicrm_contact", "civicrm_note", "civicrm_activity".
* If you have the ID of a specific row in civicrm_file, use $entityTable='*'
- * @param $entityID
- * Int The id of the object in the above entityTable.
+ * @param int $entityID
+ * 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
+ * @return array|NULL
+ * list of HTML snippets; one HTML snippet for each attachment. If none found, then NULL
*
- * @static
*/
public static function paperIconAttachment($entityTable, $entityID) {
if (empty($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' ||
}
return NULL;
}
+
}