00001 <?php
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 if (!class_exists('ff_action_abstractprofile')) {
00027 $o_registry =& FF_Registry::singleton();
00028 require_once $o_registry->getAppFile('Action/AbstractProfile.php', 'profile', 'libs');
00029 }
00030
00031
00032
00033
00034
00046
00047 class FF_Action_CheckoutProfile extends FF_Action_AbstractProfile {
00048
00049
00053 function FF_Action_AbstractProfile()
00054 {
00055
00056 }
00057
00058
00059
00060
00072 function getTableData(&$in_rendererObj, $in_appName, $in_readOnly)
00073 {
00074 if ($in_readOnly || !FF_Request::getParam('isMyProfile', 'g', false) ||
00075 $this->o_model->getBorrowerId() === false) {
00076 return array();
00077 }
00078
00079 $a_data = array();
00080 FF_Request::setParam('objectId', $this->o_model->getBorrowerId(), 's');
00081 FF_Request::setParam('objectDesc', $this->o_model->getBorrowerName(), 's');
00082 FF_Request::setParam('fromProfile', true, 's');
00083 if ($this->o_perms->hasPerm(array('can_use_demo', 'can_view_borrower_demos'))) {
00084 require_once dirname(__FILE__) . '/../ActionHandler/actions.php';
00085 $a_data[] = array(
00086 'title' => _('Your Demos:'),
00087 'data' => $this->o_output->link(
00088 FastFrame::selfURL(array('module' => 'Demo',
00089 'actionId' => ACTION_LIST_BORROWER_DEMOS,
00090 'app' => $this->o_registry->getCurrentApp())),
00091 _('Click Here To View')),
00092 'dataIsSafe' => true,
00093 );
00094 }
00095
00096 if ($this->o_perms->hasPerm('can_use_reddot')) {
00097 require_once dirname(__FILE__) . '/../Model/Reddot.php';
00098 $o_reddotModel =& new FF_Model_Reddot();
00099 $s_reddotCount = $o_reddotModel->getReddotCountForBorrower($this->o_model->getId());
00100 $s_message = sprintf(_('You have <b>%s</b> red dots in the last %s days. '), $s_reddotCount,
00101 $this->o_registry->getConfigParam('reddot/active_cutoff'));
00102
00103 if ($o_reddotModel->getProblemReddotCountForBorrower($this->o_model->getId()) >= 1 &&
00104 $s_reddotCount >= $this->o_registry->getConfigParam('reddot/max_active')) {
00105 $s_message .= _(' <b>You are currently in a red dot penalty period.</b>');
00106 }
00107
00108 $a_data[] = array(
00109 'title' => _('Your Reddots:'),
00110 'data' => '<div>' . $s_message . '</div>'. $this->o_output->link(
00111 FastFrame::selfURL(array('module' => 'Reddot', 'actionId' => ACTION_LIST,
00112 'app' => $this->o_registry->getCurrentApp())),
00113 _('Click Here To View')),
00114 'dataIsSafe' => true,
00115 );
00116 }
00117
00118 return $a_data;
00119 }
00120
00121
00122 }
00123 ?>