.
*
* You can get complete code of ProjeQtOr, other resource, help and information
* about contributors at http://www.projeqtor.org
*
* ** DO NOT REMOVE THIS NOTICE ***********************************************
*
*
*
* * ** instalation steps ****
* reportAttachment
* mkavurcic@gmail.com
*
* *** rename to 'php' and copy this file to ../report ****
*
* *** sql - insert report data into database -- Miscellaneous report group ****
INSERT INTO report (`id`, `name`, `idReportCategory`, `file`, `sortOrder`, `hasPdf`) VALUES
(1000, 'reportAttachment', 9, 'attachment.php', 950, 1);
INSERT INTO reportparameter (`idReport`, `name`, `paramType`, `sortOrder`, `defaultValue`) VALUES
(1000, 'idUser', 'userList', 10, null);
INSERT INTO projeqtor.reportparameter (idReport, `name`, paramType, sortOrder, idle, defaultValue, multiple)
VALUES (1000, 'Idle', 'boolean', 20, 0, true, 0);
*
* *** Adjust report access rights to your needs ****
*
* *** add new lines in ../tool/i18n/nls/en/lang.js - translate into other languages, if needed, and add to corresponding lang.js files ****
sumOfAccessibleFiles: "Sum of accessible files",
sumOfFiles: "Sum of attached files",
reportAttachment: "Attachments",
*
* ** */
include_once '../tool/projeqtor.php';
//header
$paramActive = '';
$paramUser = '';
$headerParameters = '';
if (array_key_exists('idUser', $_REQUEST) and trim($_REQUEST['idUser']) != "") {
$paramUser = trim($_REQUEST['idUser']);
Security::checkValidId($paramUser);
$headerParameters .= i18n("colIdUser") . ' : ' . htmlEncode(SqlList::getNameFromId('user', $paramUser)) . '
';
} else {
$headerParameters .= i18n("colIdUser") . ': ' . i18n("allUsers") . '
';
}
if (array_key_exists('Idle',$_REQUEST)) {
$paramActive=true;
$headerParameters .= i18n('labelShowIdle') . ' = ' . i18n('displayYes') . '
';
} else {
$paramActive = FALSE;
$headerParameters .= i18n('labelShowIdle') . ' = ' . i18n('displayNo') . '
';
}
$headerParameters .= i18n('colCreateDateTime') . ', ' . i18n("sortDesc");
//where
$where = '';
if ($paramUser) {
$where = 'idUser=' . $paramUser;
}
//attachment fetch
$att = new Attachment();
$res_att = $att->getSqlElementsFromCriteria(null, null, $where, 'creationDate desc');
include "header.php";
// Headers
echo '
' . ' | '; echo '' . i18n('colFileName') . ' | '; echo '' . i18n('colDescription') . ' | '; echo '' . i18n('colFileSize') . ' | '; echo '' . i18n('colIsPrivate') . ' | '; echo '' . i18n('colIdProject') . ' | '; echo '' . i18n('colRefType') . ' | '; echo '' . i18n('colRefId') . ' | '; echo '' . i18n('colDescription') . ' | '; echo '' . i18n('colUserName') . ' | '; echo '' . i18n('colCreateDateTime') . ' | '; echo '
';
if ($att->fileName and $att->subDirectory) {
echo''
. formatSmallButton('Download');
echo '';
}
if ($att->link) {
echo ' '
. ' ';
}
echo '![]() | ';
echo ' ' . $att->fileName . ' | '; echo '' . $att->description . ' | '; echo '' . htmlGetFileSize($att->fileSize) . ' | '; echo '';
switch ($att->idPrivacy) {
case SqlList::getIdFromTranslatableName('privacy', 'private')
: echo '![]() | ';
echo ' ' . SqlList::getNameFromId('Project', array_values(SqlList::getListWithCrit($att->refType, array('id' => $att->refId), 'idProject', NULL, $paramActive))[0]) . ' | '; echo '![]() | ';
echo ' ' . $att->refId . ' | '; echo '' . SqlList::getNameFromId($att->refType, $att->refId) . ' | '; echo '' . SqlList::getNameFromId('user', $att->idUser) . ' | '; echo '' . $att->creationDate . ' | '; echo '
' . i18n('sumOfFiles') . ': ' . $nr . ' | '; echo '' . i18n('sumOfAccessibleFiles') . ': ' . $nr1 . ' | '; echo '' . htmlGetFileSize($fs) . ' | '; echo ''; echo ' |