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


PHP Profile::getField方法代码示例

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


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

示例1: showForm

 /**
  * Show profile form
  *
  * @param $items_id integer id of the profile
  * @param $target value url of target
  *
  * @return nothing
  **/
 function showForm($profiles_id = 0, $openform = TRUE, $closeform = TRUE)
 {
     echo "<div class='firstbloc'>";
     if (($canedit = Session::haveRightsOr(self::$rightname, array(CREATE, UPDATE, PURGE))) && $openform) {
         $profile = new Profile();
         echo "<form method='post' action='" . $profile->getFormURL() . "'>";
     }
     $profile = new Profile();
     $profile->getFromDB($profiles_id);
     if ($profile->getField('interface') == 'central') {
         $rights = $this->getAllRights();
         $profile->displayRightsChoiceMatrix($rights, array('canedit' => $canedit, 'default_class' => 'tab_bg_2', 'title' => __('General')));
     }
     echo "<table class='tab_cadre_fixehov'>";
     echo "<tr class='tab_bg_1'><th colspan='4'>" . __('Helpdesk') . "</th></tr>\n";
     $effective_rights = ProfileRight::getProfileRights($profiles_id, array('plugin_racks_open_ticket'));
     echo "<tr class='tab_bg_2'>";
     echo "<td width='20%'>" . __('Associable items to a ticket') . "</td>";
     echo "<td colspan='5'>";
     Html::showCheckbox(array('name' => '_plugin_racks_open_ticket', 'checked' => $effective_rights['plugin_racks_open_ticket']));
     echo "</td></tr>\n";
     echo "</table>";
     if ($canedit && $closeform) {
         echo "<div class='center'>";
         echo Html::hidden('id', array('value' => $profiles_id));
         echo Html::submit(_sx('button', 'Save'), array('name' => 'update'));
         echo "</div>\n";
         Html::closeForm();
     }
     echo "</div>";
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:39,代码来源:profile.class.php

示例2: purgeProfiles

 static function purgeProfiles(Profile $prof)
 {
     $plugprof = new ProfileRight();
     foreach (self::getAllRights(true) as $right) {
         $plugprof->deleteByCriteria(array('profiles_id' => $prof->getField("id"), 'name' => $right));
     }
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:7,代码来源:profile.class.php

示例3: showForProfile

 /**
  * @param $prof   Profile object
  **/
 static function showForProfile(Profile $prof)
 {
     global $DB;
     $canedit = Session::haveRightsOr(self::$rightname, array(CREATE, UPDATE, PURGE));
     if ($canedit) {
         echo "<form method='post' action='" . $prof->getFormURL() . "'>";
     }
     $rights = self::getAllRights();
     $prof->displayRightsChoiceMatrix($rights, array('canedit' => $canedit, 'default_class' => 'tab_bg_2', 'title' => __('Rights management by profil', 'reports')));
     if ($canedit) {
         echo "<div class='center'>";
         echo Html::hidden('id', array('value' => $prof->getField('id')));
         echo Html::submit(_sx('button', 'Save'), array('name' => 'update'));
         echo "</div>\n";
         Html::closeForm();
     }
     echo "</div>";
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:21,代码来源:profile.class.php

示例4: showForm

 public function showForm($profiles_id = 0, $openform = TRUE, $closeform = TRUE)
 {
     echo "<div class='firstbloc'>";
     if (($canedit = Session::haveRightsOr(self::$rightname, array(CREATE, UPDATE, PURGE))) && $openform) {
         $profile = new Profile();
         echo "<form method='post' action='" . $profile->getFormURL() . "'>";
     }
     $profile = new Profile();
     $profile->getFromDB($profiles_id);
     //$rights = array('rights' => self::getRights($profile->getField('interface'),);
     $rights = array();
     if ($profile->getField('interface') == 'central') {
         $rights = $this->getAllRights();
     }
     $profile->displayRightsChoiceMatrix($rights, array('canedit' => $canedit, 'default_class' => 'tab_bg_2', 'title' => __('Orders', 'order')));
     if ($canedit && $closeform) {
         echo "<div class='center'>";
         echo Html::hidden('id', array('value' => $profiles_id));
         echo Html::submit(_sx('button', 'Save'), array('name' => 'update'));
         echo "</div>\n";
         Html::closeForm();
     }
     echo "</div>";
 }
开发者ID:korial29,项目名称:order,代码行数:24,代码来源:profile.class.php

示例5: purgeProfiles

 static function purgeProfiles(Profile $prof)
 {
     $plugprof = new self();
     $plugprof->deleteByCriteria(array('profiles_id' => $prof->getField("id")));
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:5,代码来源:profile.class.php

示例6: cleanProfiles

 static function cleanProfiles(Profile $prof)
 {
     $plugprof = new self();
     $plugprof->delete(array('id' => $prof->getField("id")));
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:5,代码来源:profile.class.php

示例7: purgeProfiles

 static function purgeProfiles(Profile $prof)
 {
     $plugprof = new self();
     $plugprof->cleanProfiles($prof->getField("id"));
 }
开发者ID:JULIO8,项目名称:respaldo_glpi,代码行数:5,代码来源:profile.class.php

示例8: showForProfile

 /**
  * @param $prof   Profile object
  **/
 static function showForProfile(Profile $prof)
 {
     global $DB, $LANG;
     $target = Toolbox::getItemTypeFormURL(__CLASS__);
     $profiles_id = $prof->getField('id');
     $prof->check($profiles_id, 'r');
     $canedit = $prof->can($profiles_id, 'w');
     $prof = new Profile();
     if ($profiles_id) {
         $prof->getFromDB($profiles_id);
     }
     $rights = self::getAllRights(array('profiles_id' => $profiles_id));
     if ($canedit) {
         echo "<form action='" . $target . "' method='post'>";
     }
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr><th colspan='4' class='center b'>";
     printf(__('%1$s: %2$s'), __('Rights management by profil', 'reports'), $prof->fields["name"]);
     echo "</th></tr>";
     $plugname = array();
     foreach (searchReport() as $key => $plug) {
         $mod = $plug == 'reports' ? $key : "{$plug}_{$key}";
         echo "<tr class='tab_bg_1'>";
         if (!isset($plugname[$plug])) {
             // Retrieve the plugin name
             $function = "plugin_version_{$plug}";
             $tmp = $function();
             $plugname[$plug] = $tmp['name'];
         }
         echo "<td>" . $plugname[$plug] . "</td>";
         if (strpos($key, 'stat') === false) {
             echo "<td>" . _n('Report', 'Reports', 2) . "</td>";
         } else {
             echo "<td>" . __('Statistics') . "</td>";
         }
         echo "<td>" . $LANG["plugin_{$plug}"][$key] . "</td><td>";
         if (isStat($key) && $prof->getField('statistic') == 1 || !isStat($key) && $prof->getField('reports') == 'r') {
             Profile::dropdownNoneReadWrite($mod, isset($rights[$mod]) ? $rights[$mod] : '', 1, 1, 0);
         } else {
             // Can't access because missing right from GLPI core
             // Profile::dropdownNoneReadWrite($mod,'',1,0,0);
             echo "<input type='hidden' name='{$mod}' value='NULL'>" . __('No Access');
             echo isStat($key) ? " **" : " *";
         }
         echo "</td></tr>";
     }
     if ($prof->getField('statistic') != 1 || $prof->getField('reports') != 'r') {
         echo "<tr class='b tab_bg_4'><td colspan='4'>";
         if ($prof->getField('reports') != 'r') {
             echo '*  ' . __('No right on Tools / Reports', 'reports') . '.<br>';
         }
         if ($prof->getField('statistic') != 1) {
             echo '** ' . __('No right on Assistance / Statistics', 'reports') . '.';
         }
         echo "</td></tr>\n";
     }
     if ($canedit) {
         echo "<tr class='tab_bg_1'>";
         echo "<td class='center' colspan='4'>";
         echo "<input type='hidden' name='profiles_id' value={$profiles_id}>";
         echo "<input type='submit' name='update_user_profile' value='" . _sx('button', 'Update') . "'\n                class='submit'>";
         echo "</td></tr>\n";
         echo "</table>";
         Html::closeForm();
     } else {
         echo "</table>";
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:71,代码来源:profile.class.php


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