예제 #1
0
        $comment->update($_POST);
        Html::back();
    } else {
        if (isset($_POST["delete"])) {
            $comment->check($_POST['id'], 'w');
            $comment->delete($_POST, 1);
            Html::redirect(Toolbox::getItemTypeFormURL('PluginIdeaboxIdeabox') . "?id=" . $_POST["plugin_ideabox_ideaboxes_id"]);
        } else {
            if (isset($_POST["delete_comment"])) {
                foreach ($_POST["check"] as $ID => $value) {
                    $comment->check($ID, 'w');
                    $comment->delete(array("id" => $ID), 1);
                }
                Html::back();
            } else {
                $comment->checkGlobal("r");
                if ($_SESSION['glpiactiveprofile']['interface'] == 'central') {
                    Html::header(PluginIdeaboxIdeabox::getTypeName(2), '', "plugins", "ideabox");
                } else {
                    Html::helpHeader(PluginIdeaboxIdeabox::getTypeName(2));
                }
                $comment->showForm($_GET["id"], array('plugin_ideabox_ideaboxes_id' => $_GET["plugin_ideabox_ideaboxes_id"]));
                if ($_SESSION['glpiactiveprofile']['interface'] == 'central') {
                    Html::footer();
                } else {
                    Html::helpFooter();
                }
            }
        }
    }
}
예제 #2
0
파일: hook.php 프로젝트: geldarr/hack-space
function plugin_ideabox_AssignToTicket($types)
{
    if (plugin_ideabox_haveRight("open_ticket", "1")) {
        $types['PluginIdeaboxIdeabox'] = PluginIdeaboxIdeabox::getTypeName(2);
    }
    return $types;
}
예제 #3
0
 function showComments(PluginIdeaboxIdeabox $ideabox)
 {
     global $DB, $CFG_GLPI;
     $instID = $ideabox->fields['id'];
     if (!$ideabox->can($instID, "r")) {
         return false;
     }
     $rand = mt_rand();
     $canedit = $ideabox->can($instID, 'w');
     $query = "SELECT `glpi_plugin_ideabox_comments`.`name` AS name,\n                        `glpi_plugin_ideabox_comments`.`id`,\n                        `glpi_plugin_ideabox_comments`.`plugin_ideabox_ideaboxes_id`,\n                        `glpi_plugin_ideabox_comments`.`date_comment`,\n                        `glpi_plugin_ideabox_comments`.`comment`,\n                        `glpi_plugin_ideabox_comments`.`users_id` AS users_id\n               FROM `glpi_plugin_ideabox_comments` ";
     $query .= " LEFT JOIN `glpi_plugin_ideabox_ideaboxes`\n      ON (`glpi_plugin_ideabox_ideaboxes`.`id` = `glpi_plugin_ideabox_comments`.`plugin_ideabox_ideaboxes_id`)";
     $query .= " WHERE `glpi_plugin_ideabox_comments`.`plugin_ideabox_ideaboxes_id` = '{$instID}'\n          ORDER BY `glpi_plugin_ideabox_comments`.`name`";
     $result = $DB->query($query);
     $number = $DB->numrows($result);
     echo "<div class='spaced'>";
     if ($canedit && $number) {
         Html::openMassiveActionsForm('mass' . __CLASS__ . $rand);
         $massiveactionparams = array();
         Html::showMassiveActions(__CLASS__, $massiveactionparams);
     }
     if ($number != 0) {
         echo "<table class='tab_cadre_fixe'>";
         echo "<tr>";
         if ($canedit && $number) {
             echo "<th width='10'>" . Html::getCheckAllAsCheckbox('mass' . __CLASS__ . $rand) . "</th>";
         }
         echo "<th>" . __('Name') . "</th>";
         echo "<th>" . __('Author') . "</th>";
         echo "<th>" . __('Date') . "</th>";
         echo "<th>" . __('Content') . "</th>";
         echo "</tr>";
         Session::initNavigateListItems($this->getType(), PluginIdeaboxIdeabox::getTypeName(2) . " = " . $ideabox->fields["name"]);
         $i = 0;
         $row_num = 1;
         while ($data = $DB->fetch_array($result)) {
             Session::addToNavigateListItems($this->getType(), $data['id']);
             $i++;
             $row_num++;
             echo "<tr class='tab_bg_1 center'>";
             echo "<td width='10'>";
             if ($canedit) {
                 Html::showMassiveActionCheckBox(__CLASS__, $data["id"]);
             }
             echo "</td>";
             echo "<td class='center'>";
             echo "<a href='" . $CFG_GLPI["root_doc"] . "/plugins/ideabox/front/comment.form.php?id=" . $data["id"] . "&amp;plugin_ideabox_ideaboxes_id=" . $data["plugin_ideabox_ideaboxes_id"] . "'>";
             echo $data["name"];
             if ($_SESSION["glpiis_ids_visible"] || empty($data["name"])) {
                 echo " (" . $data["id"] . ")";
             }
             echo "</a></td>";
             echo "<td class='center'>" . getusername($data["users_id"]) . "</td>";
             echo "<td class='center'>" . Html::convdatetime($data["date_comment"]) . "</td>";
             echo "<td class='left'>" . nl2br($data["comment"]) . "</td>";
             echo "</tr>";
         }
         echo "</table>";
     }
     if ($canedit && $number) {
         $paramsma['ontop'] = false;
         Html::showMassiveActions(__CLASS__, $paramsma);
         Html::closeForm();
     }
     echo "</div>";
 }
예제 #4
0
 function showForm($ID, $options = array())
 {
     if (!Session::haveRight("profile", "r")) {
         return false;
     }
     $prof = new Profile();
     if ($ID) {
         $this->getFromDBByProfile($ID);
         $prof->getFromDB($ID);
     }
     $options['colspan'] = 1;
     $this->showFormHeader($options);
     echo "<tr class='tab_bg_2'>";
     echo "<th colspan='4'>" . sprintf(__('%1$s - %2$s'), __('Rights management', 'ideabox'), $prof->fields["name"]) . "</th>";
     echo "</tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('Read - add ideas', 'ideabox') . ":</td><td>";
     Profile::dropdownNoneReadWrite("ideabox", $this->fields["ideabox"], 1, 1, 1);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('Associable items to a ticket') . " - " . PluginIdeaboxIdeabox::getTypeName(2) . "</td><td>";
     if ($prof->fields['create_ticket']) {
         Dropdown::showYesNo("open_ticket", $this->fields["open_ticket"]);
     } else {
         echo Dropdown::getYesNo(0);
     }
     echo "</td>";
     echo "</tr>";
     echo "<input type='hidden' name='id' value=" . $this->fields["id"] . ">";
     $options['candel'] = false;
     $this->showFormButtons($options);
 }
예제 #5
0
Ideabox is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Ideabox. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
if ($_SESSION['glpiactiveprofile']['interface'] == 'central') {
    Html::header(PluginIdeaboxIdeabox::getTypeName(2), '', "plugins", "ideabox");
} else {
    Html::helpHeader(PluginIdeaboxIdeabox::getTypeName(2));
}
$idea = new PluginIdeaboxIdeabox();
if ($idea->canView() || Session::haveRight("config", "w")) {
    if ($_SESSION['glpiactiveprofile']['interface'] != 'central') {
        if ($idea->canCreate()) {
            echo "<div align='center'><table class='tab_cadre_fixe' cellpadding='5'>";
            echo "<tr><th>" . __('Menu', 'ideabox') . "</th></tr>";
            echo "<tr class='tab_bg_1'><td class='center'>";
            echo "<a href=\"./ideabox.form.php\">";
            _e('Submit an idea', 'ideabox');
            echo "</a>";
            echo "</td></tr>";
            echo " </table></div>";
        }
        Search::manageGetValues("PluginIdeaboxIdeabox");
        $_GET["field"] = array(0 => "2");
        $_GET["contains"] = array(0 => $_SESSION["glpiname"]);
예제 #6
0
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Ideabox. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
if (!isset($_GET["id"])) {
    $_GET["id"] = "";
}
if (!isset($_GET["withtemplate"])) {
    $_GET["withtemplate"] = "";
}
$idea = new PluginIdeaboxIdeabox();
if (isset($_POST["add"])) {
    $idea->check(-1, 'w', $_POST);
    $newID = $idea->add($_POST);
    Html::back();
} else {
    if (isset($_POST["delete"])) {
        $idea->check($_POST['id'], 'w');
        $idea->delete($_POST);
        $idea->redirectToList();
    } else {
        if (isset($_POST["restore"])) {
            $idea->check($_POST['id'], 'w');
            $idea->restore($_POST);
            $idea->redirectToList();
        } else {