当前位置: 首页>>代码示例>>PHP>>正文


PHP RSSFeed::addVisibilityJoins方法代码示例

本文整理汇总了PHP中RSSFeed::addVisibilityJoins方法的典型用法代码示例。如果您正苦于以下问题:PHP RSSFeed::addVisibilityJoins方法的具体用法?PHP RSSFeed::addVisibilityJoins怎么用?PHP RSSFeed::addVisibilityJoins使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RSSFeed的用法示例。


在下文中一共展示了RSSFeed::addVisibilityJoins方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addDefaultJoin

 /**
  * Generic Function to add Default left join to a request
  *
  * @param $itemtype                    reference ID
  * @param $ref_table                   reference table
  * @param &$already_link_tables  array of tables already joined
  *
  * @return Left join string
  **/
 static function addDefaultJoin($itemtype, $ref_table, array &$already_link_tables)
 {
     switch ($itemtype) {
         // No link
         case 'User':
             return self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_profiles_users", "profiles_users_id", 0, 0, array('jointype' => 'child'));
         case 'Reminder':
             return Reminder::addVisibilityJoins();
         case 'RSSFeed':
             return RSSFeed::addVisibilityJoins();
         case 'ProjectTask':
             // Same structure in addDefaultWhere
             $out = '';
             $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_projecttaskteams", "projecttaskteams_id", 0, 0, array('jointype' => 'child'));
             return $out;
         case 'Project':
             // Same structure in addDefaultWhere
             $out = '';
             if (!Session::haveRight("project", Project::READALL)) {
                 $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_projectteams", "projectteams_id", 0, 0, array('jointype' => 'child'));
             }
             return $out;
         case 'Ticket':
             // Same structure in addDefaultWhere
             $out = '';
             if (!Session::haveRight("ticket", Ticket::READALL)) {
                 $searchopt =& self::getOptions($itemtype);
                 // show mine : requester
                 $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_tickets_users", "tickets_users_id", 0, 0, $searchopt[4]['joinparams']['beforejoin']['joinparams']);
                 if (Session::haveRight("ticket", Ticket::READGROUP)) {
                     if (count($_SESSION['glpigroups'])) {
                         $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_groups_tickets", "groups_tickets_id", 0, 0, $searchopt[71]['joinparams']['beforejoin']['joinparams']);
                     }
                 }
                 // show mine : observer
                 $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_tickets_users", "tickets_users_id", 0, 0, $searchopt[66]['joinparams']['beforejoin']['joinparams']);
                 if (count($_SESSION['glpigroups'])) {
                     $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_groups_tickets", "groups_tickets_id", 0, 0, $searchopt[65]['joinparams']['beforejoin']['joinparams']);
                 }
                 if (Session::haveRight("ticket", Ticket::OWN)) {
                     // Can own ticket : show assign to me
                     $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_tickets_users", "tickets_users_id", 0, 0, $searchopt[5]['joinparams']['beforejoin']['joinparams']);
                 }
                 if (Session::haveRightsOr("ticket", array(Ticket::READMY, Ticket::READASSIGN))) {
                     // show mine + assign to me
                     $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_tickets_users", "tickets_users_id", 0, 0, $searchopt[5]['joinparams']['beforejoin']['joinparams']);
                     if (count($_SESSION['glpigroups'])) {
                         $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_groups_tickets", "groups_tickets_id", 0, 0, $searchopt[8]['joinparams']['beforejoin']['joinparams']);
                     }
                 }
                 if (Session::haveRightsOr('ticketvalidation', array(TicketValidation::VALIDATEINCIDENT, TicketValidation::VALIDATEREQUEST))) {
                     $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_ticketvalidations", "ticketvalidations_id", 0, 0, $searchopt[58]['joinparams']['beforejoin']['joinparams']);
                 }
             }
             return $out;
         case 'Change':
         case 'Problem':
             if ($itemtype == 'Change') {
                 $right = 'change';
                 $table = 'changes';
                 $groupetable = "glpi_changes_groups";
                 $linkfield = "changes_groups_id";
             } else {
                 if ($itemtype == 'Problem') {
                     $right = 'problem';
                     $table = 'problems';
                     $groupetable = "glpi_groups_problems";
                     $linkfield = "groups_problems_id";
                 }
             }
             // Same structure in addDefaultWhere
             $out = '';
             if (!Session::haveRight("{$right}", $itemtype::READALL)) {
                 $searchopt =& self::getOptions($itemtype);
                 if (Session::haveRight("{$right}", $itemtype::READMY)) {
                     // show mine : requester
                     $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_" . $table . "_users", $table . "_users_id", 0, 0, $searchopt[4]['joinparams']['beforejoin']['joinparams']);
                     if (count($_SESSION['glpigroups'])) {
                         $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, $groupetable, $linkfield, 0, 0, $searchopt[71]['joinparams']['beforejoin']['joinparams']);
                     }
                     // show mine : observer
                     $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_" . $table . "_users", $table . "_users_id", 0, 0, $searchopt[66]['joinparams']['beforejoin']['joinparams']);
                     if (count($_SESSION['glpigroups'])) {
                         $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, $groupetable, $linkfield, 0, 0, $searchopt[65]['joinparams']['beforejoin']['joinparams']);
                     }
                     // show mine : assign
                     $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_" . $table . "_users", $table . "_users_id", 0, 0, $searchopt[5]['joinparams']['beforejoin']['joinparams']);
                     if (count($_SESSION['glpigroups'])) {
                         $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, $groupetable, $linkfield, 0, 0, $searchopt[8]['joinparams']['beforejoin']['joinparams']);
                     }
                 }
//.........这里部分代码省略.........
开发者ID:jose-martins,项目名称:glpi,代码行数:101,代码来源:search.class.php

示例2: addDefaultJoin

 /**
  * Generic Function to add Default left join to a request
  *
  * @param $itemtype                    reference ID
  * @param $ref_table                   reference table
  * @param &$already_link_tables  array of tables already joined
  *
  * @return Left join string
  **/
 static function addDefaultJoin($itemtype, $ref_table, array &$already_link_tables)
 {
     switch ($itemtype) {
         // No link
         case 'User':
             return self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_profiles_users", "profiles_users_id", 0, 0, array('jointype' => 'child'));
         case 'RSSFeed':
             return RSSFeed::addVisibilityJoins();
         case 'Reminder':
             return Reminder::addVisibilityJoins();
             /*
             $out  = self::addLeftJoin($itemtype, $ref_table, $already_link_tables,
                                       "glpi_reminders_users", "reminders_users_id", 0, 0,
                                        array('jointype' => 'child'));
             $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables,
                                       "glpi_groups_reminders", "groups_reminders_id", 0, 0,
                                        array('jointype' => 'child'));
             $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables,
                                       "glpi_entities_reminders", "entities_reminders_id", 0, 0,
                                        array('jointype' => 'child'));
             $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables,
                                       "glpi_profiles_reminders", "profiles_reminders_id", 0, 0,
                                        array('jointype' => 'child'));
             return $out;
             */
         /*
         $out  = self::addLeftJoin($itemtype, $ref_table, $already_link_tables,
                                   "glpi_reminders_users", "reminders_users_id", 0, 0,
                                    array('jointype' => 'child'));
         $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables,
                                   "glpi_groups_reminders", "groups_reminders_id", 0, 0,
                                    array('jointype' => 'child'));
         $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables,
                                   "glpi_entities_reminders", "entities_reminders_id", 0, 0,
                                    array('jointype' => 'child'));
         $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables,
                                   "glpi_profiles_reminders", "profiles_reminders_id", 0, 0,
                                    array('jointype' => 'child'));
         return $out;
         */
         case 'Ticket':
             // Same structure in addDefaultWhere
             $out = '';
             //if (!Session::haveRight("show_all_ticket","1")) {
             if (!Session::haveRight("ticket", Ticket::READALL)) {
                 $searchopt =& self::getOptions($itemtype);
                 //                $requester_table      = '`glpi_tickets_users_'.self::computeComplexJoinID($searchopt[4]['joinparams']['beforejoin']['joinparams']).'`';
                 //                $requestergroup_table = '`glpi_groups_tickets_'.self::computeComplexJoinID($searchopt[71]['joinparams']['beforejoin']['joinparams']).'`';
                 //                $assign_table      = '`glpi_tickets_users_'.self::computeComplexJoinID($searchopt[5]['joinparams']['beforejoin']['joinparams']).'`';
                 //                $assigngroup_table = '`glpi_groups_tickets_'.self::computeComplexJoinID($searchopt[8]['joinparams']['beforejoin']['joinparams']).'`';
                 //               $observer_table      = '`glpi_tickets_users_'.self::computeComplexJoinID($searchopt[66]['joinparams']['beforejoin']['joinparams']).'`';
                 //               $observergroup_table = '`glpi_groups_tickets_'.self::computeComplexJoinID($searchopt[65]['joinparams']['beforejoin']['joinparams']).'`';
                 // show mine : requester
                 $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_tickets_users", "tickets_users_id", 0, 0, $searchopt[4]['joinparams']['beforejoin']['joinparams']);
                 //if (Session::haveRight("show_group_ticket",1)) {
                 if (Session::haveRight("ticket", Ticket::READGROUP)) {
                     if (count($_SESSION['glpigroups'])) {
                         $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_groups_tickets", "groups_tickets_id", 0, 0, $searchopt[71]['joinparams']['beforejoin']['joinparams']);
                     }
                 }
                 // show mine : observer
                 $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_tickets_users", "tickets_users_id", 0, 0, $searchopt[66]['joinparams']['beforejoin']['joinparams']);
                 if (count($_SESSION['glpigroups'])) {
                     $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_groups_tickets", "groups_tickets_id", 0, 0, $searchopt[65]['joinparams']['beforejoin']['joinparams']);
                 }
                 if (Session::haveRight("ticket", Ticket::OWN)) {
                     // Can own ticket : show assign to me
                     $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_tickets_users", "tickets_users_id", 0, 0, $searchopt[5]['joinparams']['beforejoin']['joinparams']);
                 }
                 //if (Session::haveRight("show_assign_ticket","1")) { // show mine + assign to me
                 if (Session::haveRightsOr("ticket", array(Ticket::READMY, Ticket::READASSIGN))) {
                     // show mine + assign to me
                     $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_tickets_users", "tickets_users_id", 0, 0, $searchopt[5]['joinparams']['beforejoin']['joinparams']);
                     if (count($_SESSION['glpigroups'])) {
                         $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_groups_tickets", "groups_tickets_id", 0, 0, $searchopt[8]['joinparams']['beforejoin']['joinparams']);
                     }
                 }
                 //if (Session::haveRight('validate_incident', 1)
                 //    || Session::haveRight('validate_request', 1)) {
                 if (Session::haveRightsOr('ticketvalidation', array(TicketValidation::VALIDATEINCIDENT, TicketValidation::VALIDATEREQUEST))) {
                     $out .= self::addLeftJoin($itemtype, $ref_table, $already_link_tables, "glpi_ticketvalidations", "ticketvalidations_id", 0, 0, $searchopt[58]['joinparams']['beforejoin']['joinparams']);
                 }
             }
             return $out;
         default:
             // Plugin can override core definition for its type
             if ($plug = isPluginItemType($itemtype)) {
                 $function = 'plugin_' . $plug['plugin'] . '_addDefaultJoin';
                 if (function_exists($function)) {
                     $out = $function($itemtype, $ref_table, $already_link_tables);
                     if (!empty($out)) {
//.........这里部分代码省略.........
开发者ID:JULIO8,项目名称:respaldo_glpi,代码行数:101,代码来源:searcha.class.php


注:本文中的RSSFeed::addVisibilityJoins方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。