[scu-smp] r283 committed - Complete - issue 45: Mentee wants to be Mentor in next year ...

0 views
Skip to first unread message

scu...@googlecode.com

unread,
Oct 12, 2010, 1:39:47 AM10/12/10
to scu...@googlegroups.com
Revision: 283
Author: sid.moradi
Date: Mon Oct 11 22:38:33 2010
Log: Complete - issue 45: Mentee wants to be Mentor in next year
http://code.google.com/p/scu-smp/issues/detail?id=45

* provide required form for mentee (cmd=mentee/wantToBeMentor)
* provide list of Mentee that want to be Mentor
(cmd=mentee/listMenteesThatWantToBeMentor)
* copy Mentee info into Mentor table (cmd=mentee/copyMenteeInfoAsMentor)


http://code.google.com/p/scu-smp/source/detail?r=283

Added:
/trunk/smp-php/smp/command/mentee/CopyMenteeInfoAsMentorCommand.php
/trunk/smp-php/smp/command/mentee/ListMenteesThatWantToBeMentorCommand.php
/trunk/smp-php/smp/command/mentee/WantToBeMentorCommand.php
/trunk/smp-php/smp/view/mentee/listMenteesThatWantToBeMentor.php
Modified:
/trunk/smp-php/db.sql
/trunk/smp-php/smp/Constants.php
/trunk/smp-php/smp/command/mentee/ShowProfileMentorCommand.php
/trunk/smp-php/smp/command/signup/MenteeCommand.php
/trunk/smp-php/smp/command/signup/MentorCommand.php
/trunk/smp-php/smp/datagrid/MenteeDatagrid.php
/trunk/smp-php/smp/domain/Mentee.php
/trunk/smp-php/smp/mapper/MenteeMapper.php
/trunk/smp-php/smp/service/MenteeService.php
/trunk/smp-php/smp/service/MentorService.php
/trunk/smp-php/smp/util/OptionProvider.php
/trunk/smp-php/smp/view/common/menu.php
/trunk/smp-php/smp/view/mentee/showProfileMentor.php
/trunk/smp-php/smp/view/mentor/showProfileMentees.php

=======================================
--- /dev/null
+++ /trunk/smp-php/smp/command/mentee/CopyMenteeInfoAsMentorCommand.php Mon
Oct 11 22:38:33 2010
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Created at 12/10/2010 3:20:31 PM
+ * smp_command_mentee_CopyMenteeInfoAsMentorCommand
+ *
+ * @author <a href="mailto:smor...@scu.edu.au">Sid</a>
+ * @version 1.0
+ */
+require_once('smp/service/MenteeService.php');
+
+class smp_command_mentee_CopyMenteeInfoAsMentorCommand extends
smp_command_Command {
+
+ function doExecute(smp_controller_Request $request) {
+ $id = $request->getProperty('id');
+
+ $menteeService = new smp_service_MenteeService();
+ $result = $menteeService->copyMenteeInfoAsMentor($id);
+
+ if ($result) {
+ $request->addFeedback("Convert Mentee to Mentor was successfull.");
+ } else {
+ $request->addError("Convert failed.");
+ }
+ $request->setProperty('id','');
+ $request->redirect('mentee/listMenteesThatWantToBeMentor');
+ }
+
+ function doSecurity() {
+ $this->roles = array(Constants::ROLE_MANAGER,
Constants::ROLE_COORDINATOR);
+ }
+}
=======================================
--- /dev/null
+++
/trunk/smp-php/smp/command/mentee/ListMenteesThatWantToBeMentorCommand.php
Mon Oct 11 22:38:33 2010
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Created at 12/10/2010 2:46:01 PM
+ * smp_command_mentee_ListMenteesThatWantToBeMentor
+ *
+ * @author <a href="mailto:smor...@scu.edu.au">Sid</a>
+ * @version 1.0
+ */
+require_once('smp/domain/Mentee.php');
+require_once('smp/datagrid/MenteeDatagrid.php');
+
+class smp_command_mentee_ListMenteesThatWantToBeMentorCommand extends
smp_command_Command {
+
+ function doExecute(smp_controller_Request $request) {
+ $request->setTitle('List Mentees that want to be Mentor');
+
+ $menteeDatagrid = new smp_datagrid_MenteeDatagrid();
+
+ $mentee = new smp_domain_Mentee();
+ $mentee->setExpired(true);
+ $mentee->setWantToBeMentor(true);
+ $mentee->setCopiedAsMentor(false);
+ $datagrid = $menteeDatagrid->getMenteeDatagrid($mentee);
+ $request->setDatagrid($datagrid);
+ }
+
+ function doSecurity() {
+ $this->roles = array(Constants::ROLE_MANAGER,
Constants::ROLE_COORDINATOR);
+ }
+}
=======================================
--- /dev/null
+++ /trunk/smp-php/smp/command/mentee/WantToBeMentorCommand.php Mon Oct 11
22:38:33 2010
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Created at 12/10/2010 1:42:02 PM
+ * smp_command_mentee_WantToBeMentorCommand
+ *
+ * @author <a href="mailto:smor...@scu.edu.au">Sid</a>
+ * @version 1.0
+ */
+require_once('smp/service/MenteeService.php');
+
+class smp_command_mentee_WantToBeMentorCommand extends smp_command_Command
{
+
+ function doExecute(smp_controller_Request $request) {
+ $menteeId = $request->getProperty('menteeId');
+
+ $menteeService = new smp_service_MenteeService();
+
+ $result = $menteeService->markMenteeForWantToBeMentor($menteeId);
+
+ if ($result) {
+ $request->addFeedback("Your request for being Mentor submitted
successfully.");
+ } else {
+ $request->addError("Your request for being Mentor failed.");
+ }
+ $request->setTitle('Want to be Mentor ?');
+ $request->redirect('mentee/showProfileMentor');
+ }
+
+ function doSecurity() {
+ $this->roles = array(Constants::ROLE_MENTEE);
+ }
+}
=======================================
--- /dev/null
+++ /trunk/smp-php/smp/view/mentee/listMenteesThatWantToBeMentor.php Mon
Oct 11 22:38:33 2010
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Created at 12/10/2010 2:56:31 PM
+ * smp/view/mentee/listMenteesThatWantToBeMentor
+ *
+ * @author <a href="mailto:smor...@scu.edu.au">Sid</a>
+ * @version 1.0
+ */
+include('smp/view/common/header.php');
+require_once('smp/util/DatagridUtil.php');
+
+$indent = " ";
+print $indent."<br><h1>Mentee List that want to be Mentor</h1><br>\r\n";
+
+$datagrid = $request->getDatagrid();
+
+$datagrid->addColumn(new Structures_DataGrid_Column('&nbsp;', null, null,
array('width' => '20%'), null, 'printCopyLink()'));
+
+$table = smp_util_DatagridUtil::getCustomHtmlTable();
+$datagrid->fill($table,smp_util_DatagridUtil::getRenderOptions());
+
+print $table->toHtml();
+$datagrid->render(DATAGRID_RENDER_PAGER);
+
+include('smp/view/common/footer.php');
+
+function printCopyLink($params) {
+ $id = $params['record']['id'];
+ return "<a href=\"index.php?cmd=mentee/copyMenteeInfoAsMentor&id=$id\"
onClick=\"return confirmSubmit();\">Convert Mentee to Mentor</a>\r\n";
+}
=======================================
--- /trunk/smp-php/db.sql Fri Oct 1 21:19:05 2010
+++ /trunk/smp-php/db.sql Mon Oct 11 22:38:33 2010
@@ -135,9 +135,12 @@
contact_id BIGINT NOT NULL,
matched BOOLEAN DEFAULT FALSE,
expired BOOLEAN DEFAULT FALSE,
+ want_to_be_mentor BOOLEAN DEFAULT FALSE,
+ copied_as_mentor BOOLEAN DEFAULT FALSE,
CONSTRAINT smp_fk_mentee_user FOREIGN KEY (user_id) REFERENCES
smp_user(id) ON DELETE CASCADE,
CONSTRAINT smp_fk_mentee_student FOREIGN KEY (student_id) REFERENCES
smp_student(id) ON DELETE CASCADE,
CONSTRAINT smp_fk_mentee_contact FOREIGN KEY (contact_id) REFERENCES
smp_contact(id) ON DELETE CASCADE,
+ CONSTRAINT smp_unique_mentee_fks UNIQUE (user_id,student_id),
PRIMARY KEY(id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

=======================================
--- /trunk/smp-php/smp/Constants.php Mon Oct 11 17:09:53 2010
+++ /trunk/smp-php/smp/Constants.php Mon Oct 11 22:38:33 2010
@@ -36,8 +36,6 @@
// Messaging constants
const MESSAGE_MENTOR = 'MESSAGE_MENTOR';
const MESSAGE_MENTEE = 'MESSAGE_MENTEE';
- const MS_FOR_MENTOR = 'MS_FOR_MENTOR';
- const MS_FOR_MENTEE = 'MS_FOR_MENTEE';

// Actions constants
const ACTION = 'ACTION';
=======================================
--- /trunk/smp-php/smp/command/mentee/ShowProfileMentorCommand.php Sun Sep
19 19:01:25 2010
+++ /trunk/smp-php/smp/command/mentee/ShowProfileMentorCommand.php Mon Oct
11 22:38:33 2010
@@ -10,20 +10,31 @@
require_once('smp/util/Security.php');
require_once('smp/service/StudentService.php');
require_once('smp/service/ContactService.php');
+require_once('smp/service/MenteeService.php');
+require_once('smp/service/MentorService.php');
+require_once('smp/service/UserService.php');
class smp_command_mentee_ShowProfileMentorCommand extends
smp_command_Command {

function doExecute(smp_controller_Request $request) {
+ $studentService = new smp_service_StudentService();
+ $menteeService = new smp_service_MenteeService();
+ $mentorService = new smp_service_MentorService();
+ $contactService = new smp_service_ContactService();
+ $userService = new smp_service_UserService();
$securityUtil = new smp_util_Security();
$currentUser = $securityUtil->getCurrentUser();
-
- $studentService = new smp_service_StudentService();
- $student = $studentService->findStudentWithUser($currentUser);
- $student->setUser($currentUser);
-
- $mentor =
$studentService->findMentorForMenteeWithStudentId($student->getId());
- if (!is_null($mentor)) { $student->setMentor($mentor);}
-
- $request->setEntity($student);
+
+ $mentee = new smp_domain_Mentee();
+ $mentee->setUserId($currentUser->getId());
+ $mentee = $menteeService->findWithMentee($mentee);
+
+ $mentor = $mentorService->findMentorWithMenteeId($mentee->getId());
+ if (!is_null($mentor)) {
+ $mentor = $mentorService->findFilledMentor($mentor->getId());
+ $mentee->setMentor($mentor);
+ }
+
+ $request->setEntity($mentee);
$request->setTitle("My Mentor's Information");
}

=======================================
--- /trunk/smp-php/smp/command/signup/MenteeCommand.php Mon Sep 27 00:24:51
2010
+++ /trunk/smp-php/smp/command/signup/MenteeCommand.php Mon Oct 11 22:38:33
2010
@@ -96,9 +96,7 @@

$student->setIsSocioeconomic($validator->getProperty('isSocioeconomic'));
$student->setPreferGender($validator->getProperty('preferGender'));
$student->setInterests($validator->getProperty('interests'));
- $student->setComments($validator->getProperty('comments'));
- // Set account status for new registered Mentee
- $student->setAccountStatus(Constants::AS_NEW_MENTEE);
+ $student->setComments($validator->getProperty('comments'));

$contact = new smp_domain_Contact();
$contact->setAddress($validator->getProperty('address'));
=======================================
--- /trunk/smp-php/smp/command/signup/MentorCommand.php Mon Sep 27 00:24:51
2010
+++ /trunk/smp-php/smp/command/signup/MentorCommand.php Mon Oct 11 22:38:33
2010
@@ -101,8 +101,6 @@

$student->setPreferOnCampus($validator->getProperty('preferOnCampus'));
$student->setInterests($validator->getProperty('interests'));
$student->setComments($validator->getProperty('comments'));
- // Set account status for new registered Mentor
- $student->setAccountStatus(Constants::AS_NEW_MENTOR);

$contact = new smp_domain_Contact();
$contact->setAddress($validator->getProperty('address'));
=======================================
--- /trunk/smp-php/smp/datagrid/MenteeDatagrid.php Fri Oct 8 00:07:33 2010
+++ /trunk/smp-php/smp/datagrid/MenteeDatagrid.php Mon Oct 11 22:38:33 2010
@@ -8,10 +8,9 @@
*/
require_once('smp/datagrid/Datagrid.php');

-
class smp_datagrid_MenteeDatagrid extends smp_datagrid_Datagrid {

- function getMenteeDatagrid($mentee = null, $paging=ture) {
+ function getMenteeDatagrid($mentee = null, $paging = true) {
self::$options['fields'] = array
('id','firstname', 'lastname', 'student_number', 'course_id', 'gender', 'study_mode');
self::$options['labels'] = array (
'id' => 'Id',
=======================================
--- /trunk/smp-php/smp/domain/Mentee.php Sun Aug 15 08:03:21 2010
+++ /trunk/smp-php/smp/domain/Mentee.php Mon Oct 11 22:38:33 2010
@@ -23,6 +23,8 @@
private $matched;
private $expired;
private $mentor;
+ private $wantToBeMentor;
+ private $copiedAsMentor;

function __construct(smp_domain_User $user = null, smp_domain_Student
$student = null, smp_domain_Contact $contact = null, $id = -1) {
$this->user = $user;
@@ -101,4 +103,20 @@
public function setExpired($expired) {
$this->expired = $expired;
}
-}
+
+ public function getWantToBeMentor() {
+ return $this->wantToBeMentor;
+ }
+
+ public function setWantToBeMentor($wantToBeMentor) {
+ $this->wantToBeMentor = $wantToBeMentor;
+ }
+
+ public function getCopiedAsMentor() {
+ return $this->copiedAsMentor;
+ }
+
+ public function setCopiedAsMentor($copiedAsMentor) {
+ $this->copiedAsMentor = $copiedAsMentor;
+ }
+}
=======================================
--- /trunk/smp-php/smp/mapper/MenteeMapper.php Fri Oct 1 23:42:48 2010
+++ /trunk/smp-php/smp/mapper/MenteeMapper.php Mon Oct 11 22:38:33 2010
@@ -10,11 +10,14 @@
require_once('smp/domain/Mentee.php');
require_once('smp/domain/Mentor.php');
require_once('smp/mapper/Mapper.php');
+require_once('smp/mapper/RoleMapper.php');
require_once('smp/mapper/UserMapper.php');
require_once('smp/mapper/StudentMapper.php');
require_once('smp/mapper/ContactMapper.php');
require_once('smp/mapper/MentorMenteeMapper.php');
+
class smp_mapper_MenteeMapper extends smp_mapper_Mapper {
+ private $roleMapper;
private $userMapper;
private $studentMapper;
private $contactMapper;
@@ -22,12 +25,45 @@

function __construct($adodb = null) {
parent::__construct($adodb);
+ $this->roleMapper = new smp_mapper_RoleMapper(self::$ADODB);
$this->userMapper = new smp_mapper_UserMapper(self::$ADODB);
$this->studentMapper = new smp_mapper_StudentMapper(self::$ADODB);
$this->contactMapper = new smp_mapper_ContactMapper(self::$ADODB);
$this->mentorMenteeMapper = new
smp_mapper_MentorMenteeMapper(self::$ADODB);
$this->insertStmt = self::$ADODB->Prepare('INSERT INTO smp_mentee
(user_id, student_id, contact_id, matched, expired) VALUES (?,?,?,?,?)');
}
+ /**
+ * Copy Mentee information to the Mentor table and
+ * Change User's role from Mentee to Mentor.
+ *
+ * @param Mentee id $id
+ */
+ function copyMenteeInfoAsMentor($id) {
+ self::$ADODB->StartTrans();
+ $mentee = self::find($id);
+
+ $insertStmt = self::$ADODB->Prepare('INSERT INTO smp_mentor(user_id,
student_id, contact_id) VALUES(?,?,?)');
+ self::$ADODB->Execute($insertStmt, array($mentee->getUserId(),
$mentee->getStudentId(), $mentee->getContactId()));
+
+ $deleteStmt = self::$ADODB->Prepare('DELETE FROM smp_user_role WHERE
user_id=?');
+ self::$ADODB->Execute($deleteStmt, array($mentee->getUserId()));
+
+ // Update user's role to ROLE_MENTOR
+ $role = $this->roleMapper->findRoleByName(Constants::ROLE_MENTOR);
+ $insertStmt2 = self::$ADODB->Prepare('INSERT INTO smp_user_role(user_id,
role_id) VALUES(?,?)');
+ self::$ADODB->Execute($insertStmt2, array($mentee->getUserId(),
$role->getId()));
+
+ // Update Mentee table as it's already copied
+ $updateStmt = self::$ADODB->Prepare('UPDATE smp_mentee SET
copied_as_mentor=? WHERE id=?');
+ self::$ADODB->Execute($updateStmt, array(true, $id));
+
+ return self::$ADODB->CompleteTrans();
+ }
+
+ function markMenteeForWantToBeMentor($id) {
+ $updateStmt = self::$ADODB->Prepare("UPDATE smp_mentee SET
want_to_be_mentor=? WHERE id=?");
+ return self::$ADODB->Execute($updateStmt, array(true, $id));
+ }

function markMenteeAsExpired($id) {
$updateStmt = self::$ADODB->Prepare("UPDATE smp_mentee SET expired=?
WHERE id=?");
@@ -193,6 +229,8 @@
$obj->setContactId($array['contact_id']);
$obj->setMatched($array['matched']);
$obj->setExpired($array['expired']);
+ $obj->setWantToBeMentor($array['want_to_be_mentor']);
+ $obj->setCopiedAsMentor($array['copied_as_mentor']);
return $obj;
}

=======================================
--- /trunk/smp-php/smp/service/MenteeService.php Fri Oct 8 00:07:33 2010
+++ /trunk/smp-php/smp/service/MenteeService.php Mon Oct 11 22:38:33 2010
@@ -12,6 +12,7 @@
require_once('smp/mapper/ContactMapper.php');
require_once('smp/datagrid/MenteeDatagrid.php');
require_once('smp/domain/Mentee.php');
+
class smp_service_MenteeService {
protected $studentMapper;
protected $menteeMapper;
@@ -26,6 +27,14 @@
$this->menteeDatagrid = new smp_datagrid_MenteeDatagrid();
$this->mentorMenteeMapper = new smp_mapper_MentorMenteeMapper();
}
+
+ function copyMenteeInfoAsMentor($menteeId) {
+ return $this->menteeMapper->copyMenteeInfoAsMentor($menteeId);
+ }
+
+ function markMenteeForWantToBeMentor($menteeId) {
+ return $this->menteeMapper->markMenteeForWantToBeMentor($menteeId);
+ }

function markMenteeAsExpired($menteeId) {
$result = $this->menteeMapper->markMenteeAsExpired($menteeId);
=======================================
--- /trunk/smp-php/smp/service/MentorService.php Fri Oct 1 23:34:50 2010
+++ /trunk/smp-php/smp/service/MentorService.php Mon Oct 11 22:38:33 2010
@@ -6,14 +6,13 @@
* @author <a href="mailto:smor...@scu.edu.au">Sid</a>
* @version 1.0
*/
-
-require_once('smp/util/OptionProvider.php');
require_once('smp/mapper/MentorMapper.php');
require_once('smp/mapper/MenteeMapper.php');
require_once('smp/mapper/UserMapper.php');
require_once('smp/mapper/ContactMapper.php');
require_once('smp/datagrid/MentorDatagrid.php');
require_once('smp/util/Security.php');
+
class smp_service_MentorService {
protected $mentorMapper;
protected $menteeMapper;
@@ -129,7 +128,7 @@

function findMentorStudentWithMenteeId($menteeId) {
$mentor = self::findMentorWithMenteeId($menteeId);
- $mentor->setStudent($this->studentMapper->find($mentor->getStudentId()));
+ if (! is_null($mentor)) {
$mentor->setStudent($this->studentMapper->find($mentor->getStudentId()));}
return $mentor;
}
}
=======================================
--- /trunk/smp-php/smp/util/OptionProvider.php Fri Oct 1 01:30:37 2010
+++ /trunk/smp-php/smp/util/OptionProvider.php Mon Oct 11 22:38:33 2010
@@ -48,21 +48,6 @@
$array['nowork'] = 'Do not work';
return $array;
break;
- case 'account_status':
- $array[Constants::AS_NEW_MENTOR] = 'New Mentor';
- $array[Constants::AS_NEW_MENTEE] = 'New Mentee';
- $array[Constants::AS_MATCHED_MENTOR] = 'Matched Mentor';
- $array[Constants::AS_MATCHED_MENTEE] = 'Matched Mentee';
- $array[Constants::AS_TRAINED_MENTOR] = 'Trained Mentor';
- $array[Constants::AS_EXPIRED_MENTOR] = 'Expired Mentor';
- $array[Constants::AS_EXPIRED_MENTEE] = 'Expired Mentee';
- return $array;
- break;
- case Constants::MESSAGE_MENTOR:
- $array[Constants::MS_FOR_MENTEE] = 'my Mentee(s)';
- $array[Constants::MS_FOR_COORDINATOR] = 'my Coordinator';
- return $array;
- break;
case 'role':
$array[Constants::ROLE_ADMIN] = Constants::ROLE_ADMIN;
$array[Constants::ROLE_MANAGER] = Constants::ROLE_MANAGER;
=======================================
--- /trunk/smp-php/smp/view/common/menu.php Sat Oct 2 00:51:21 2010
+++ /trunk/smp-php/smp/view/common/menu.php Mon Oct 11 22:38:33 2010
@@ -20,6 +20,7 @@
<li><a href="index.php?cmd=mentor/listAllMentor">Mentor
List</a></li>
<li><a href="index.php?cmd=mentee/listAllMentee">Mentee
List</a></li>
<li><a href="index.php?cmd=course/list">Course List</a></li>
+ <li><a
href="index.php?cmd=mentee/listMenteesThatWantToBeMentor">Mentee->Mentor</a></li>
</ul>
</li>
<?php
@@ -34,6 +35,7 @@
<li><a href="index.php?cmd=mentee/listMatchedMentee">Matched
Mentees</a></li>
<li><a href="index.php?cmd=mentor/listActiveMentor">Mentor set
Limit</a></li>
<li><a
href="index.php?cmd=mentormentee/listAllMentorMentee">Contact
confirmed ?</a></li>
+ <li><a
href="index.php?cmd=mentee/listMenteesThatWantToBeMentor">Mentee->Mentor</a></li>
</ul>
</li>
<?php
=======================================
--- /trunk/smp-php/smp/view/mentee/showProfileMentor.php Sun Sep 19
19:01:25 2010
+++ /trunk/smp-php/smp/view/mentee/showProfileMentor.php Mon Oct 11
22:38:33 2010
@@ -8,7 +8,7 @@
*/
include("smp/view/common/header.php");

-$student = $request->getEntity();
+$mentee = $request->getEntity();

$indent = " ";
print $indent."<div class=\"form_container\">\r\n";
@@ -20,8 +20,8 @@
print $indent." <hr/>\r\n";
print $indent." </div>\r\n";

-$mentor=$student->getMentor();
- if (!is_null($mentor)) {
+$mentor=$mentee->getMentor();
+ if (!is_null($mentor->getId())) {
print $indent." <div class=\"grid_2\">\r\n";
print $indent." <label class=\"label\">Name :</label>\r\n";
print $indent." </div>\r\n";
@@ -35,16 +35,22 @@
print $indent." <label
class=\"labelValue\">".VH::chN($mentor->getContact()->getMobile())."</label>\r\n";
print $indent." </div>\r\n";
print $indent." <div class=\"grid_2\">\r\n";
- print $indent." <label class=\"label\">Email :</label>\r\n";
+ print $indent." <label class=\"label\">SCU Email :</label>\r\n";
print $indent." </div>\r\n";
print $indent." <div class=\"grid_10\">\r\n";
print $indent." <label
class=\"labelValue\">".VH::chN($mentor->getUser()->getScuEmail())."</label>\r\n";
print $indent." </div>\r\n";
+ print $indent." <div class=\"grid_2\">\r\n";
+ print $indent." <label class=\"label\">Email :</label>\r\n";
+ print $indent." </div>\r\n";
+ print $indent." <div class=\"grid_10\">\r\n";
+ print $indent." <label
class=\"labelValue\">".VH::chN($mentor->getContact()->getEmail())."</label>\r\n";
+ print $indent." </div>\r\n";
print $indent." <div class=\"grid_2\">\r\n";
print $indent." <label class=\"label\">Course :</label>\r\n";
print $indent." </div>\r\n";
print $indent." <div class=\"grid_10\">\r\n";
- print $indent." <label
class=\"labelValue\">".VH::chN($mentor->getStudent()->getCourseId())."</label>\r\n";
+ print $indent." <label
class=\"labelValue\">".VH::getValueFromDynamicArray('course',
$mentor->getStudent()->getCourseId())."</label>\r\n";
print $indent." </div>\r\n";
print $indent." <div class=\"grid_12\">\r\n";
print $indent." &nbsp;\r\n";
@@ -55,6 +61,15 @@
print $indent." </div>\r\n";
}

+if ($mentee->getExpired() && (!$mentee->getWantToBeMentor())) {
+ print $indent." <div class=\"grid_12\">\r\n";
+ print $indent." <a
href=\"index.php?cmd=mentee/wantToBeMentor&menteeId=".$mentee->getId()."\"
onClick=\"return confirmSubmit();\">Do you want apply for being
Mentor ?</a>\r\n";
+ print $indent." </div>\r\n";
+}else if ($mentee->getWantToBeMentor()) {
+ print $indent. " <p style=\"color:green;\">You already applied for being
Mentor,Now you need to wait for Coordinator confirm. Thank you.";
+}
+
+
print $indent."</div>\r\n";

include("smp/view/common/footer.php");
=======================================
--- /trunk/smp-php/smp/view/mentor/showProfileMentees.php Fri Sep 3
02:20:22 2010
+++ /trunk/smp-php/smp/view/mentor/showProfileMentees.php Mon Oct 11
22:38:33 2010
@@ -78,7 +78,7 @@
print $indent." </div>\r\n";
print $indent." <div class=\"grid_10\">\r\n";
print $indent." <img src=\"static/images/no.png\" >\r\n";
- print $indent." <a
href=\"index.php?cmd=mentor/confirmContactMentee&relation_id=$relationId\"
onClick=\"return confirmSubmit()\">Click here if contact with $fullName has
been achieved!</a>";
+ print $indent." <a
href=\"index.php?cmd=mentor/confirmContactMentee&relation_id=$relationId\"
onClick=\"return confirmSubmit()\">Click here if contact with $fullName has
been achieved?</a>";
print $indent." </div>\r\n";
if (!is_null($mentee->getRelation()->getCreateTime())) {
print $indent." <div class=\"grid_2\">\r\n";

Reply all
Reply to author
Forward
0 new messages