本文整理汇总了PHP中FileUpload::displayFiles方法的典型用法代码示例。如果您正苦于以下问题:PHP FileUpload::displayFiles方法的具体用法?PHP FileUpload::displayFiles怎么用?PHP FileUpload::displayFiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileUpload
的用法示例。
在下文中一共展示了FileUpload::displayFiles方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexAction
public function indexAction()
{
$this->_redirect('employee/search');
exit;
## old dash function
if (!$this->hasACL('edit_employee')) {
$this->doNoAccessError();
}
require_once 'models/table/dash-employee.php';
$this->view->assign('title', $this->translation['Application Name'] . space . t('Employee Tracking System'));
// restricted access?? does this user only have acl to view some trainings or people
// they dont want this, removing 5/01/13
## $org_allowed_ids = allowed_org_access_full_list($this); // doesnt have acl 'training_organizer_option_all'?
## $allowedWhereClause = $org_allowed_ids ? " partner.organizer_option_id in ($org_allowed_ids) " : "";
// restricted access?? only show organizers that belong to this site if its a multi org site
## $site_orgs = allowed_organizer_in_this_site($this); // for sites to host multiple training organizers on one domain
## $allowedWhereClause .= $site_orgs ? " AND partner.organizer_option_id in ($site_orgs) " : "";
$institute = new DashviewEmployee();
$details = $institute->fetchdetails($org_allowed_ids);
$this->view->assign('getins', $details);
/****************************************************************************************************************/
/* Attached Files */
require_once 'views/helpers/FileUpload.php';
$PARENT_COMPONENT = 'employee';
FileUpload::displayFiles($this, $PARENT_COMPONENT, 1, $this->hasACL('admin_files'));
// File upload form
if ($this->hasACL('admin_files')) {
$this->view->assign('filesForm', FileUpload::displayUploadForm($PARENT_COMPONENT, 1, FileUpload::$FILETYPES));
}
/****************************************************************************************************************/
}
示例2: indexAction
//.........这里部分代码省略.........
$site_orgs = allowed_organizer_in_this_site($this);
// for sites to host multiple training organizers on one domain
$allowedWhereClause .= $site_orgs ? " AND training_organizer_option_id in ({$site_orgs}) " : "";
// Incomplete
$tableObj = new Training();
$rowsPast = $tableObj->getIncompleteTraining($uid, 'training_start_date < NOW() ' . $allowedWhereClause)->toArray();
if ($rowsPast) {
$html = EditTableHelper::generateHtmlTraining('TrainingPast', $rowsPast, $trainingFields, $colStatic, $linkInfo, $editLinkInfo, $colCustom);
$this->view->assign('tableTrainingPast', $html);
}
// Future
$tableObj = new Training();
$rowsFuture = $tableObj->getIncompleteTraining($uid, 'training_start_date >= NOW()' . $allowedWhereClause, '')->toArray();
if ($rowsFuture) {
$html = EditTableHelper::generateHtmlTraining('TrainingFuture', $rowsFuture, $trainingFields, $colStatic, $linkInfo, $editLinkInfo, $colCustom);
$this->view->assign('tableTrainingFuture', $html);
}
// Unapproved
if ($this->setting('module_approvals_enabled')) {
$tableObj = new Training();
$unapproved = $tableObj->getUnapprovedTraining("1" . $allowedWhereClause);
// everything
if ($unapproved) {
$linkInfoUnapprov = $linkInfo;
if (!$this->hasACL('approve_trainings')) {
$linkInfoUnapprov['linkFields'] = array('training_title');
}
$trainingFieldsUnapprov = $trainingFields;
$trainingFieldsUnapprov['message'] = t('Message');
$colStatic['message'] = 'message';
$html = EditTableHelper::generateHtmlTraining('unapproved', $unapproved, $trainingFieldsUnapprov, $colStatic, $linkInfoUnapprov, $editLinkInfo, $colCustom);
$this->view->assign('tableUnapproved', $html);
}
}
//YTD, start at April 1
if ($ytdStart = $this->setting('fiscal_year_start')) {
$ytdStart = date('Y-n-j', strtotime($ytdStart));
$this->view->assign('ytdStart', $ytdStart);
//get total unique participants
$db = Zend_Db_Table_Abstract::getDefaultAdapter();
$sql = "SELECT COUNT(DISTINCT person_id) as \"unique_p\" from person_to_training left join training on (training.id = training_id and training.is_deleted = 0) where training_start_date > " . $ytdStart . $allowedWhereClause;
$rowArray = $db->fetchRow($sql);
$this->view->assign('unique_participants', $rowArray['unique_p']);
} else {
$ytdStart = date('Y') - (date('n') < 4 ? 1 : 0) . '-04-01';
$this->view->assign('ytdStart', $ytdStart);
//get total unique participants
$db = Zend_Db_Table_Abstract::getDefaultAdapter();
$sql = "SELECT COUNT(DISTINCT person_id) as \"unique_p\" from person_to_training left join training on (training.id = training_id and training.is_deleted = 0) where 1 " . $allowedWhereClause;
$rowArray = $db->fetchRow($sql);
$this->view->assign('unique_participants', $rowArray['unique_p']);
}
$allowedOrgJoin = $allowedWhereClause ? ' LEFT JOIN training ON training.id = training_id WHERE training.is_deleted = 0 ' . $allowedWhereClause : '';
// only show trainings we're allowed to see by access level
//get participants total and by YTD
$db = Zend_Db_Table_Abstract::getDefaultAdapter();
$sql = "SELECT COUNT(person_id) as \"attendees\" from person_to_training" . $allowedOrgJoin;
$rowArray = $db->fetchRow($sql);
$this->view->assign('attendees', $rowArray['attendees']);
$sql = "SELECT COUNT(person_id) as \"attendees\" FROM training, person_to_training as pt WHERE pt.training_id = training.id AND training_start_date >= '{$ytdStart}'" . $allowedWhereClause;
$rowArray = $db->fetchRow($sql);
$this->view->assign('attendees_ytd', $rowArray['attendees']);
//get total unique trainers
if ($allowedOrgJoin) {
$sql = "SELECT COUNT(DISTINCT trainer_id) as \"unique_t\" FROM training_to_trainer" . $allowedOrgJoin;
// trainers in viewable trainings
} else {
$sql = "SELECT COUNT(person_id) as \"unique_t\" from trainer";
}
$rowArray = $db->fetchRow($sql);
$this->view->assign('unique_trainers', $rowArray['unique_t']);
//get total trainers and by YTD
$sql = "SELECT COUNT(trainer_id) as \"trainers\" FROM training_to_trainer" . $allowedOrgJoin;
$rowArray = $db->fetchRow($sql);
$this->view->assign('trainers', $rowArray['trainers']);
$sql = "SELECT COUNT(tt.trainer_id) as \"trainers\" FROM training, training_to_trainer as tt WHERE tt.training_id = training.id AND training_start_date >= '{$ytdStart}'" . $allowedWhereClause;
$rowArray = $db->fetchRow($sql);
$this->view->assign('trainers_ytd', $rowArray['trainers']);
//get trainings
// total and YTD
$sql = "SELECT COUNT(id) as \"trainings\", MIN(training_start_date) as \"min_date\",MAX(training_start_date) as \"max_date\" from training WHERE is_deleted = 0" . $allowedWhereClause;
$rowArray = $db->fetchRow($sql);
$this->view->assign('trainings', $rowArray['trainings']);
$this->view->assign('min_date', $rowArray['min_date']);
$this->view->assign('max_date', $rowArray['max_date']);
$sql = "SELECT COUNT(id) as \"trainings\" from training WHERE training_start_date >= '{$ytdStart}' AND is_deleted = 0" . $allowedWhereClause;
$rowArray = $db->fetchRow($sql);
$this->view->assign('trainings_ytd', $rowArray['trainings']);
}
/****************************************************************************************************************/
/* Attached Files */
require_once 'views/helpers/FileUpload.php';
$PARENT_COMPONENT = 'home';
FileUpload::displayFiles($this, $PARENT_COMPONENT, 1, $this->hasACL('admin_files'));
// File upload form
if ($this->hasACL('admin_files')) {
$this->view->assign('filesForm', FileUpload::displayUploadForm($PARENT_COMPONENT, 1, FileUpload::$FILETYPES));
}
/****************************************************************************************************************/
}
示例3: doAddEditView
//.........这里部分代码省略.........
}
}
}
}
}
}
$colStatic = array_keys($personsFields);
// static calumns (From field keys)
if ($this->setting('module_attendance_enabled') || $this->setting('display_viewing_location') || $this->setting('display_budget_code')) {
foreach ($colStatic as $i => $v) {
if ($v == 'duration_days' || $v == 'award_phrase' || $v == 'budget_code_phrase' || $v == 'location_phrase') {
unset($colStatic[$i]);
}
}
// remove 1 so we can edit the field
}
if ($this->view->viewonly) {
$editLinkInfo['disabled'] = 1;
$linkInfo = array();
} else {
$linkInfo = array('linkFields' => $colStatic, 'linkId' => 'person_id', 'linkUrl' => Settings::$COUNTRY_BASE_URL . '/person/edit/id/%person_id%');
$linkInfo['linkUrl'] = "javascript:submitThenRedirect('{$linkInfo['linkUrl']}/trainingredirect/{$training_id}');";
$editLinkInfo = array();
// add link next to "Remove"
if ($this->setting('display_training_pre_test')) {
$editLinkInfo[] = array('linkName' => t('Pre-Test'), 'linkId' => 'id', 'linkUrl' => "javascript:updateScore('Pre-Test', %id%, '" . Settings::$COUNTRY_BASE_URL . "/training/scores-update', '%score_pre%');");
// do not translate label/key
}
if ($this->setting('display_training_post_test')) {
$editLinkInfo[] = array('linkName' => t('Post-Test'), 'linkId' => 'id', 'linkUrl' => "javascript:updateScore('Post-Test', %id%, '" . Settings::$COUNTRY_BASE_URL . "/training/scores-update', '%score_post%');");
// do not translate label/key
}
$editLinkInfo[] = array('linkName' => t('Scores'), 'linkId' => 'id', 'linkUrl' => "javascript:submitThenRedirect('" . Settings::$COUNTRY_BASE_URL . "/training/scores/ptt_id/%id%');");
// old
//'linkUrl' => Settings::$COUNTRY_BASE_URL."/training/scores/training/$training_id/person/%person_id%",
//$editLinkInfo['linkUrl'] = "javascript:submitThenRedirect('{$editLinkInfo['linkUrl']}');";
}
$html = EditTableHelper::generateHtmlTraining('Persons', $persons, $personsFields, $colStatic, $linkInfo, $editLinkInfo, $customColDefs);
$this->view->assign('tablePersons', $html);
/****************************************************************************************************************/
/* Attached Files */
FileUpload::displayFiles($this, 'training', $row->id, !$this->view->viewonly);
//$this->view->assign('files', 'x' . FileUpload::displayFiles($this, 'training', $row->id));
// File upload form
if (!$this->view->viewonly) {
$this->view->assign('filesForm', FileUpload::displayUploadForm('training', $row->id, FileUpload::$FILETYPES));
}
/****************************************************************************************************************/
/* Approval status */
if ($this->setting('module_approvals_enabled')) {
$canApprove = $this->hasACL('master_approver') && $row->is_approved == 2 || $this->hasACL('approve_trainings') && !$row->is_approved;
$this->view->assign('can_approve', $canApprove);
if ($canApprove) {
$this->view->assign('approve_val', '');
} else {
$this->view->assign('approve_val', $row->is_approved);
}
// disable control
if (!$canApprove or !$this->hasACL('approve_trainings')) {
$this->view->assign('approve_disable_str', 'disabled');
} else {
$this->view->assign('approve_disable_str', '');
}
}
/****************************************************************************************************************/
/* Attached Files */
// mode
$this->view->assign('mode', $this->_getParam('action'));
switch ($this->_getParam('msg')) {
case 'duplicate':
$this->view->assign('msg', t('Training') . ' ' . t('session has been duplicated.<br>You can edit the duplicate session below.'));
break;
default:
break;
}
// edit variables
if ($this->_getParam('action') != 'add') {
//audit history
$creatorObj = new User();
$updaterObj = new User();
$creatorrow = $creatorObj->findOrCreate($row->created_by);
$rowRay['creator'] = $creatorrow->first_name . ' ' . $creatorrow->last_name;
$updaterrow = $updaterObj->findOrCreate($row->modified_by);
$rowRay['updater'] = $updaterrow->first_name . ' ' . $updaterrow->last_name;
}
if (empty($trainers) || empty($persons)) {
$this->view->assign('isIncomplete', true);
}
// default start date?
if ($this->getSanParam('start-date')) {
$parts = explode('/', $this->getSanParam('start-date'));
if (count($parts) == 3) {
$rowRay['start-day'] = $parts[0];
$rowRay['start-month'] = $parts[1];
$rowRay['start-year'] = $parts[2];
}
}
// row values
$this->view->assign('row', $rowRay);
}