linea21-core
[ class tree: linea21-core ] [ index: linea21-core ] [ all elements ]

Source for file list.php

Documentation is available at list.php

  1. <?php
  2. /**
  3.  * @package linea21.core
  4.  * @subpackage home
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  *  'Home' module is used into the back-office
  10.  */
  11.  
  12. //////////// Check Inclusion de pages ////////////
  13. if (!class_exists('auth')){
  14.   include_once("../lib/lib_common.php");
  15.   ReloadIndex('admin');
  16. }
  17. ////////////
  18.  
  19. // Comments
  20. if(defined('MOD_COMMENT'&& MOD_COMMENT == 1{
  21.   include_once(override('../comment/display.php'));
  22.   include_once(override('../comment/'.SQL.'.inc.php'));
  23.   include_once('../class/class.comment.php');
  24.   if(COMMENT_MODERATION == 1{
  25.     $status array('D');
  26.     $comm new comment();
  27.     $data $comm->getAllByModule($status$sql_objectfalse'date');
  28.     $nb_comments count($data);
  29.     $html_comments getMarkup($datatrue);
  30.   else {
  31.     $status array('P');
  32.     $comm new comment();
  33.     $data $comm->getAllByModule($status$sql_object10'date');
  34.     $nb_comments count($data);
  35.     $html_comments getMarkup($datafalse);
  36.   }
  37.   echo getAjaxFunction();
  38. }
  39.  
  40. // workgroups users moderation
  41. if(defined('MOD_WORKSHOP'&& MOD_WORKSHOP == 1{
  42.     include_once(override('../languages/'.U_L.'/lang_workshop.'.CHARSET.'.php'));
  43.     
  44.     $r $sql_object -> DBSelect(SQL_getWorkgroupsPendingUsers());
  45.  
  46.     if ($r[0]['user_login']==""$nb_pendingusers=0;
  47.     else $nb_pendingusers count($r);
  48.  
  49.     $cnt_pending_users 0;
  50.     $liste_pendingusers '';
  51.     
  52.     if ($nb_pendingusers != 0{
  53.         
  54.         for ($i 0;$i count($r);$i++{
  55.             // we display only workgroups current user is in charge of
  56.             if ($l21auth->isWorkgroupOrganiser($l21auth->GetSessionElement('id')$sql_object$r[$i]['workshop_id']|| $l21auth->isSuperAdmin()){
  57.                 $cnt_pending_users++;
  58.                 $link_accept '../workshop/_user.php?action=accept&amp;id='$r[$i]['workshop_id'].'&amp;u_id='.$r[$i]['user_id'];
  59.                 $link_revoke '../workshop/_user.php?action=unaccept&amp;id='$r[$i]['workshop_id'].'&amp;u_id='.$r[$i]['user_id'];
  60.                 // we display user link only if admin
  61.                 if($l21auth->isSuperAdmin()) {
  62.                     $username '<a href="?rub=user&amp;todo=det&amp;id='.$r[$i]['user_id'].'"  title="' $GLOBALS['links'][U_L]['user-profile']['desc'].'">'.$r[$i]['user_login'].'</a>';
  63.                 else {
  64.                     $username $r[$i]['user_login'];
  65.                 }
  66.                 if(!empty($r[$i]['profile_firstname']|| !empty($r[$i]['profile_lastname'])) {
  67.                     $username .= ' ('.$r[$i]['profile_firstname']'' $r[$i]['profile_lastname'.')';
  68.                 }
  69.                 $username .= ' - <a href="mailto:'.$r[$i]['profile_email'].'">'.$r[$i]['profile_email'].'</a>';
  70.                 $liste_pendingusers .= "\t<li class=\"li2 to-moderate\">"formatText($username'2HTML'"<br />" .sprintf(_t('workshop''workshop_join')formatText('<a href="?rub=workshop&amp;todo=det&amp;id='.$r[$i]['workshop_id'].'">'.$r[$i]['workshop_denomination'].'</a>''2HTML'))"<a href=\"".$link_accept."\"  title=\""._t('workshop','add_new_user')."\" class=\"ico_add user-action\"></a><a href=\"".$link_revoke."\"  title=\""._t('workshop','del_user')."\" class=\"ico_sup user-action\"></a></li>\n\n";
  71.             }
  72.         }
  73.         if(empty($liste_pendingusers)) $liste_pendingusers .= "\t<li><div class=\"info\">" ._t('home','noupdate')"</div></li>\n\n";
  74.         
  75.         // ajax code
  76.         $js '$("a.user-action").click(function() {
  77.         
  78.         var el = this;
  79.         var url = $(this).attr("href") + "&mode=ajax";
  80.  
  81.         $.ajax({
  82.             type: "GET",
  83.             url: url,
  84.             dataType: "json",
  85.             success: function(data){
  86.                 if(data.status==1) {
  87.                     // we update the user counter
  88.                     $("#cu").text( parseInt($("#cu").text()) - 1);
  89.                     // humane.success(data.msg);
  90.                     $(el).closest("li").fadeOut();
  91.                 } else {
  92.                     // humane.error(data.msg);
  93.                 }
  94.             }
  95.         });
  96.             
  97.         return false;
  98.         
  99.         });
  100.         ';
  101.         
  102.         footerAddInlineJS($js);
  103.     else   $liste_pendingusers .= "\t<li><div class=\"info\">" ._t('home','noupdate')"</div></li>\n\n";
  104. }
  105.  
  106.  
  107. $result_yp $sql_object -> DBSelect($req_yp);
  108. if ($result_yp[0]['yellowp_id']==""$nb_yp=0;
  109. else $nb_yp count($result_yp);
  110. $link_yp "index.php?rub=yellowpages&amp;todo=det&amp;id=";
  111. $liste_yp '';
  112.  
  113. if ($nb_yp<>0{
  114.   for ($i 0;$i count($result_yp);$i++{
  115.     $liste_yp .= "\t<li class=\"li2\"><a href=\"" $link_yp $result_yp[$i]['yellowp_id'"\" title=\"" formatText($result_yp[$i]['yellowp_name']'2ATT'"\">" formatText($result_yp[$i]['yellowp_name']'2HTML'"</a></li>\n\n";
  116.   }
  117. }else   $liste_yp .= "\t<li><div class=\"info\">" ._t('home','noupdate')"</div></li>\n\n";
  118.  
  119.  
  120.  
  121. $result_sdi $sql_object -> DBSelect($req_sdi);
  122. if ($result_sdi[0]['sdii_id']==""$nb_dashboard=0;
  123. else $nb_dashboard count($result_sdi);
  124. $liste_dashboard '';
  125. $link_dashboard "index.php?rub=dashboard&amp;todo=det&amp;id=";
  126. if ($nb_dashboard<>0{
  127.   for ($i 0;$i count($result_sdi);$i++{
  128.     $liste_dashboard .= "\t<li class=\"li2\"><a href=\"" $link_dashboard $result_sdi[$i]['sdii_id'"&amp;scale_id=" $result_sdi[$i]['scale_id'"\" title=\"" formatText($result_sdi[$i]['sdii_name']'2ATT'"\">" formatText($result_sdi[$i]['sdii_name']'2HTML'"</a> <span class=\"scale\">   (" formatText($result_sdi[$i]['scale_denomination']'2HTML'") </span></li>\n\n";
  129.   }
  130. }else   $liste_dashboard .= "\t<li><div class=\"info\">" ._t('home','noupdate')"</div></li>\n\n";
  131.  
  132.  
  133. if (isset($_SESSION['lastcon'])){
  134.     
  135.   $req_user SQL_getUser($_SESSION['lastcon']);
  136.   $resultu $sql_object -> DBSelect($req_user);
  137.   
  138.   if ($resultu[0]['user_id']==""$nb_user=0;
  139.   else $nb_user count($resultu);
  140.   
  141.   $liste_user '';
  142.   $link_user "index.php?rub=user&amp;todo=det&amp;id=";
  143.   
  144.   if ($nb_user<>0{
  145.     for ($i 0;$i count($resultu);$i++{
  146.       $fullname '';
  147.       if(!empty($resultu[$i]['profile_firstname']|| $resultu[$i]['profile_lastname']{
  148.         $fullname ' - '$resultu[$i]['profile_firstname'].' '.$resultu[$i]['profile_lastname'];
  149.       }
  150.       $liste_user .= "\t<li class=\"li2\"><a href=\"" $link_user $resultu[$i]['user_id'"\" title=\"" formatText($resultu[$i]['user_login']'2ATT'"\">" formatText($resultu[$i]['user_login']'2HTML')  "</a>".$fullname."</li>\n\n";
  151.     }
  152.   }else   $liste_user .= "\t<li><div class=\"info\">" ._t('home','noupdate')"</div></li>\n\n";
  153. }
  154.  
  155. $result_news $sql_object -> DBSelect($req_news);
  156. $liste_news '';
  157. if ($result_news[0]['news_id']==""$nb_news=0;
  158. else $nb_news count($result_news);
  159. $link_news "index.php?rub=news&amp;todo=det&amp;id=";
  160. if ($nb_news<>0{
  161.   for ($i 0;$i count($result_news);$i++{
  162.     $liste_news .= "\t<li class=\"li2\"><a href=\"" $link_news $result_news[$i]['news_id'"\" title=\"" formatText($result_news[$i]['news_title']'2ATT'"\">" formatText($result_news[$i]['news_title']'2HTML'"</a></li>\n\n";
  163.   }
  164. else   $liste_news .= "\t<li><div class=\"info\">" ._t('home','noresult')"</div></li>\n\n";
  165.  
  166.  
  167. $result_publi $sql_object -> DBSelect($req_publi);
  168. $link_publi "index.php?rub=publication&amp;todo=det&amp;id=";
  169. if ($result_publi[0]['publi_id']==""$nb_publi=0;
  170. else $nb_publi count($result_publi);
  171. if ($nb_publi<>0$liste_publi "\t<li class=\"li2\"><a href=\"" $link_publi $result_publi[0]['publi_id'"\" title=\"" formatText($result_publi[0]['publi_title']'2HTML'"\">" formatText($result_publi[0]['publi_title']'2HTML'"</a></li>\n\n";
  172. else  $liste_publi "\t<li><div class=\"info\">" ._t('home','noresult')"</div></li>\n\n";
  173.  
  174. $result_rep $sql_object -> DBSelect($req_rep);
  175. if ($result_rep[0]['workrep_id']==""$nb_rep=0;
  176. else $nb_rep count($result_rep);
  177. $link_rep "index.php?rub=workshoprep&amp;todo=det&amp;id=";
  178. if ($nb_rep<>0$liste_rep "\t<li class=\"li2\"><a href=\"" $link_rep $result_rep[0]['workrep_id'"\" title=\"" formatText($result_rep[0]['workrep_title']'2ATT'"\">" formatText($result_rep[0]['workrep_title']'2HTML'"</a></li>\n\n";
  179. else  $liste_rep "\t<li><div class=\"info\">" ._t('home','noresult')"</div></li>\n\n";
  180.  
  181. $rProjects $sql_object->DBSelect(SQL_getProjects()'OBJECT');
  182. $lProjects '';
  183. if ($rProjects == 0$nbProjects=0;
  184. else $nbProjects count($rProjects);
  185. $link_projects "index.php?rub=project&amp;todo=det&amp;id=";
  186. if ($nbProjects 0{
  187.   for ($i 0;$i count($rProjects);$i++{
  188.     $lProjects .= "\t<li class=\"li2\"><a href=\"" $link_projects $rProjects[$i]->project_id "\" title=\"" formatText($rProjects[$i]->project_name'2ATT'"\">" formatText($rProjects[$i]->project_name'2HTML'.' ('$rProjects[$i]->project_estimated_date_display ")</a></li>\n\n";
  189.   }
  190. else   $lProjects .= "\t<li><div class=\"info\">" ._t('home','noresult')"</div></li>\n\n";
  191.  
  192.  
  193. ?>
  194. <div id="chemin">
  195. <ul>
  196.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home'?></a>
  197.     </li>
  198. </ul>
  199. </div>
  200. <!--end barre haute -->
  201. <?php
  202. include_once(THEME_ADMIN_PATH."quickicons.php");
  203.  
  204. ?>
  205. <div class="contentcontainer"><?php include_once(override($dir.'/menurub.php'THEME_ADMIN_PATH));
  206.  
  207. ?>
  208. <div id="content"><?php
  209. $listing '';
  210. $listing .= "<div class=\"scale\">" _t('home','accueil'": <a href=\"mailto:".MAIL_LINEA."\" title=\"".MAIL_LINEA."\">".MAIL_LINEA."</a></div>";
  211. $listing .= "<h2>" _t('home','resume'"</h2><br class=\"brendstep\" />";
  212.  
  213.  
  214. if ($l21auth->isSuperAdmin(&& defined('MOD_COMMENT'&& MOD_COMMENT == 1{
  215.     if($nb_comments 0$class='block';
  216.     else $class='none';
  217.     $c ($class == 'block''open' '';
  218.     
  219.   if(COMMENT_MODERATION == 1{
  220.     $title sprintf(_t('home','comment_to_moderate')'<span id="cc">'.$nb_comments.'</span>');
  221.   else {
  222.     $title sprintf(_t('home','comment')$nb_comments);
  223.   }
  224.   $listing .= "<div class=\"toggle_title\"><a href=\"#\" class=\""$c ."\">" $title"</a></div>";
  225.   $listing .= "<div class=\"contboxgray\" id=\"comments\" style=\"display:".$class.";\">\n";
  226.   if(!empty($html_comments)) $listing .= $html_comments;
  227.   else $listing .= "<div class=\"info\">"._t('home','noresult')."</div>";
  228.   $listing .= "</div>\n";
  229. }
  230.  
  231. if ($l21auth->hasRight('workshop'&& defined('MOD_WORKSHOP'&& MOD_WORKSHOP == 1{
  232.     if($cnt_pending_users 0$class='block';
  233.     else $class='none';
  234.     $c ($class == 'block''open' '';
  235.     
  236.     $title sprintf(_t('home','workshop_pending_users')'<span id="cu">'.$cnt_pending_users.'</span>');
  237.     $listing .= "<div class=\"toggle_title\"><a href=\"#\" class=\""$c ."\">" $title "</a></div>";
  238.     $listing .= "<div class=\"contboxgray\" id=\"workgroup-users\" style=\"display:".$class.";\">\n";
  239.     $listing .= "<ul>\n";
  240.     $listing .= $liste_pendingusers;
  241.     $listing .= "</ul>\n";
  242.     $listing .= "</div>\n";
  243. }
  244.  
  245. if ($l21auth->hasRight('dashboard'&& defined('MOD_DASHBOARD'&& MOD_DASHBOARD == 1{
  246.     if($nb_dashboard 0$class='block';
  247.     else $class='none';
  248.     $c ($class == 'block''open' '';
  249.     
  250.   $listing .= "<div class=\"toggle_title\"><a href=\"#\" class=\""$c ."\">" $nb_dashboard " " _t('home','dashboard'"</a></div>";
  251.   $listing .= "<div class=\"contboxgray\" id=\"general\" style=\"display:".$class.";\">\n";
  252.   $listing .= "<ul>\n";
  253.   $listing .= $liste_dashboard;
  254.   $listing .= "</ul>\n";
  255.   $listing .= "</div>\n";
  256. }
  257.  
  258. if ($l21auth->isSuperAdmin(&& defined('MOD_PROJECT'&& MOD_PROJECT == 1{
  259.   $listing .= "<div class=\"toggle_title\"><a href=\"#\">" _t('home','project'"</a></div>";
  260.   $listing .= "<div class=\"contboxgray\" id=\"projects\" style=\"display:none;\" >\n";
  261.   $listing .= "<ul>\n";
  262.   $listing .= $lProjects;
  263.   $listing .= "</ul>\n";
  264.   $listing .= "</div>\n";
  265. }
  266.  
  267. if ($l21auth->isSuperAdmin(&& defined('MOD_USER'&& MOD_USER == 1){
  268.       if($nb_user 0$class='block';
  269.       else $class='none';
  270.     $listing .= "<div class=\"toggle_title\"><a href=\"#\" class=\""$c ."\">" $nb_user " " _t('home','user'"</a></div>";
  271.     $listing .= "<div class=\"contboxgray\" id=\"user\" style=\"display:".$class.";\">\n";
  272.     $listing .= "<ul>\n";
  273.     $listing .= $liste_user;
  274.     $listing .= "</ul>\n";
  275.     $listing .= "</div>\n";
  276. }
  277.  
  278.  
  279. if ($l21auth->isSuperAdmin(&& defined('MOD_YELLOWPAGES'&& MOD_YELLOWPAGES == 1){
  280.     if($nb_yp 0$class='block';
  281.     else $class='none';
  282.     $c ($class == 'block''open' '';
  283.     
  284.   $listing .= "<div class=\"toggle_title\"><a href=\"#\" class=\""$c ."\">" $nb_yp " " _t('home','yp'"</a></div>";
  285.   $listing .= "<div class=\"contboxgray\" id=\"yp\" style=\"display:".$class.";\">\n";
  286.   $listing .= "<ul>\n";
  287.   $listing .= $liste_yp;
  288.   $listing .= "</ul>\n";
  289.   $listing .= "</div>\n";
  290. }
  291. if ($l21auth->hasRight('news'&& defined('MOD_NEWS'&& MOD_NEWS == 1){
  292.   $listing .= "<h3>" _t('home','news'"</h3>";
  293.   $listing .= "<div class=\"contboxgray\">\n";
  294.   $listing .= "<ul>\n";
  295.   $listing .= $liste_news;
  296.   $listing .= "</ul>\n";
  297.   $listing .= "</div>\n";
  298. }
  299. if ($l21auth->hasRight('publication'&& defined('MOD_PUBLICATION'&& MOD_PUBLICATION == 1{
  300.   $listing .= "<h3>" _t('home','publi'"</h3>";
  301.   $listing .= "<div class=\"contboxgray\">\n";
  302.   $listing .= "<ul>\n";
  303.   $listing .= $liste_publi;
  304.   $listing .= "</ul>\n";
  305.   $listing .= "<div class=\"scale\">" formatText($result_publi[0]['publi_resume']'2HTML'"</div>";
  306.   $listing .= "</div>\n";
  307. }
  308. if ($l21auth->hasRight('workshop'&& defined('MOD_WORKSHOP'&& MOD_WORKSHOP == 1{
  309.   $listing .= "<h3>" _t('home','report'"</h3>";
  310.   $listing .= "<div class=\"contboxgray\">\n";
  311.   $listing .= "<ul>\n";
  312.   $listing .= $liste_rep;
  313.   $listing .= "</ul>\n";
  314.   $listing .= "<div class=\"scale\">" formatText($result_rep[0]['workrep_resume']'2HTML'"</div>";
  315.   $listing .= "</div>\n";
  316. }
  317.  
  318. echo $listing;
  319.  
  320. ?></div>
  321. <?php include_once(override($dir.'/help.php'THEME_ADMIN_PATH))?></div>

Documentation generated on Mon, 08 Apr 2013 18:15:24 +0200 by phpDocumentor 1.4.1