View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Support us on Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - Function drawSubProjects (model/project.php) - ProjeQtOr
 
 

Function drawSubProjects (model/project.php)

More
05 Jul 2011 09:51 #1 by logan59
Nouvelle version de la fonction (augmente les performances de Projectorria) :


New version of the function (increases performance Projectorria):

public function drawSubProjects($selectField=null, $recursiveCall=false, $limitToUserProjects=false, $limitToActiveProjects=false, $visibleProjectsList = null) {
if ($limitToUserProjects) {
$user=$_SESSION;
if (! $user->_accessControlVisibility) {
$user->getAccessControlRights(); // Force setup of accessControlVisibility
}
if (!$visibleProjectsList){
$visibleProjectsList=$user->getHierarchicalViewOfVisibleProjects();
}
$reachableProjectsList=$user->getVisibleProjects();
} else {
$visibleProjectsList=array();
$reachableProjectsList=array();
}
$result="";
$clickEvent=' onClick=""';
$subList=$this->getSubProjects($limitToActiveProjects);
if ($selectField!=null and ! $recursiveCall) {
$result .= '<table ><tr><td>';
$clickEvent=' onClick=\'setSelectedProject("*", "<i>' . i18n('allProjects') . '</i>", "' . $selectField . '");\' ';
$result .= '<div ' . $clickEvent . ' class="menuTree" style="width:100%;">';
$result .= '<i>' . i18n('allProjects') . '</i>';
$result .= '</div></td></tr></table>';
}
$result .='<table >';
if (count($subList)>0) {
foreach ($subList as $prj) {
$showLine=true;
$reachLine=true;
if ($limitToUserProjects) {
if ($user->_accessControlVisibility != 'ALL') {
if (! array_key_exists('#' . $prj->id,$visibleProjectsList)) {
$showLine=false;
}
if (! array_key_exists($prj->id,$reachableProjectsList)) {
$reachLine=false;
}
}
}
if ($showLine) {
$result .='<tr><td valign="top" width="20px"><img src="css/images/iconList16.png" height="16px" /></td>';
if ($selectField==null) {
$result .= '<td class="display" style="width: 100%;" NOWRAP>' . $prj->name;
} else if (! $reachLine) {
$result .= '<td class="display" style="width: 100%; color: #AAAAAA;" NOWRAP>' . $prj->name;
} else {
$clickEvent=' onClick=\'setSelectedProject("' . $prj->id . '", "' . htmlEncode($prj->name) . '", "' . $selectField . '");\' ';
$result .= '<td><div ' . $clickEvent . ' class="menuTree" style="width:100%;">';
$result .= htmlEncode($prj->name);
$result .= '</div>';
}
$result .= $prj->drawSubProjects($selectField,true,$limitToUserProjects,$limitToActiveProjects, $visibleProjectsList);
$result .= '</td></tr>';
}
}
}
$result .='</table>';
return $result;
}

Please Log in or Create an account to join the conversation.

More
12 Jul 2011 22:09 #2 by babynus
Great performance improvement when dealing with many projects !

Will be integrated in V1.6.1.

Many thanks.

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.037 seconds

Cookies settings

×

Functional Cookies

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Please login to see yours activities!

Other cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.