本文整理汇总了PHP中Ticket_User::check方法的典型用法代码示例。如果您正苦于以下问题:PHP Ticket_User::check方法的具体用法?PHP Ticket_User::check怎么用?PHP Ticket_User::check使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ticket_User
的用法示例。
在下文中一共展示了Ticket_User::check方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sprintf
$track->check($_POST['id'], 'd');
if ($track->restore($_POST)) {
Event::log($_POST["id"], "ticket", 4, "tracking", sprintf(__('%s restores an item'), $_SESSION["glpiname"]));
}
$track->redirectToList();
} else {
if (isset($_POST['sla_delete'])) {
$track->check($_POST["id"], 'w');
$track->deleteSLA($_POST["id"]);
Event::log($_POST["id"], "ticket", 4, "tracking", sprintf(__('%s updates an item'), $_SESSION["glpiname"]));
Html::redirect($CFG_GLPI["root_doc"] . "/front/ticket.form.php?id=" . $_POST["id"]);
} else {
if (isset($_POST['delete_user'])) {
///TODO try to move it to specific form page
$ticket_user = new Ticket_User();
$ticket_user->check($_POST['id'], 'd');
$ticket_user->delete($_POST);
Event::log($_POST['tickets_id'], "ticket", 4, "tracking", sprintf(__('%s deletes an actor'), $_SESSION["glpiname"]));
Html::redirect($CFG_GLPI["root_doc"] . "/front/ticket.form.php?id=" . $_POST['tickets_id']);
} else {
if (isset($_POST['delete_group'])) {
$group_ticket = new Group_Ticket();
$group_ticket->check($_POST['id'], 'd');
$group_ticket->delete($_POST);
Event::log($_POST['tickets_id'], "ticket", 4, "tracking", sprintf(__('%s deletes an actor'), $_SESSION["glpiname"]));
Html::redirect($CFG_GLPI["root_doc"] . "/front/ticket.form.php?id=" . $_POST['tickets_id']);
} else {
if (isset($_POST['delete_supplier'])) {
$supplier_ticket = new Supplier_Ticket();
$supplier_ticket->check($_POST['id'], 'd');
$supplier_ticket->delete($_POST);
示例2: array
if (isset($_POST['sla_delete'])) {
$track->check($_POST["id"], 'w');
$track->deleteSLA($_POST["id"]);
Event::log($_POST["id"], "ticket", 4, "tracking", $_SESSION["glpiname"] . " " . $LANG['log'][21]);
glpi_header($CFG_GLPI["root_doc"] . "/front/ticket.form.php?id=" . $_POST["id"]);
} else {
if (isset($_REQUEST['delete_link'])) {
$ticket_ticket = new Ticket_Ticket();
$ticket_ticket->check($_REQUEST['id'], 'w');
$ticket_ticket->delete($_REQUEST);
Event::log($_REQUEST['tickets_id'], "ticket", 4, "tracking", $_SESSION["glpiname"] . " " . $LANG['log'][120]);
glpi_header($CFG_GLPI["root_doc"] . "/front/ticket.form.php?id=" . $_REQUEST['tickets_id']);
} else {
if (isset($_REQUEST['delete_user'])) {
$ticket_user = new Ticket_User();
$ticket_user->check($_REQUEST['id'], 'w');
$ticket_user->delete($_REQUEST);
Event::log($_REQUEST['tickets_id'], "ticket", 4, "tracking", $_SESSION["glpiname"] . " " . $LANG['log'][122]);
glpi_header($CFG_GLPI["root_doc"] . "/front/ticket.form.php?id=" . $_REQUEST['tickets_id']);
} else {
if (isset($_REQUEST['delete_group'])) {
$group_ticket = new Group_Ticket();
$group_ticket->check($_REQUEST['id'], 'w');
$group_ticket->delete($_REQUEST);
Event::log($_REQUEST['tickets_id'], "ticket", 4, "tracking", $_SESSION["glpiname"] . " " . $LANG['log'][122]);
glpi_header($CFG_GLPI["root_doc"] . "/front/ticket.form.php?id=" . $_REQUEST['tickets_id']);
} else {
if (isset($_REQUEST['addme_observer'])) {
$ticket_user = new Ticket_User();
$track->check($_REQUEST['tickets_id'], 'r');
$input = array('tickets_id' => $_REQUEST['tickets_id'], 'users_id' => getLoginUserID(), 'use_notification' => 1, 'type' => Ticket::OBSERVER);
示例3:
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GLPI 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 GLPI; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
--------------------------------------------------------------------------
*/
// ----------------------------------------------------------------------
// Original Author of file: Walid Nouh
// Purpose of file:
// ----------------------------------------------------------------------
$ticket_user = new Ticket_User();
if (isset($_REQUEST["update"])) {
$ticket_user->check($_REQUEST["id"], 'w');
$ticket_user->update($_REQUEST);
echo "<script type='text/javascript' >\n";
echo "window.opener.location.reload();";
echo "window.close()";
echo "</script>";
} else {
if (isset($_REQUEST["id"])) {
$ticket_user->showForm($_REQUEST["id"]);
}
}
示例4: Ticket
You should have received a copy of the GNU General Public License
along with GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
if (!defined('GLPI_ROOT')) {
include '../inc/includes.php';
}
$link = new Ticket_User();
$item = new Ticket();
Session::checkLoginUser();
Html::popHeader(__('Email followup'), $_SERVER['PHP_SELF']);
if (isset($_POST["update"])) {
$link->check($_POST["id"], UPDATE);
$link->update($_POST);
echo "<script type='text/javascript' >\n";
echo "window.parent.location.reload();";
echo "</script>";
} else {
if (isset($_POST['delete'])) {
$link->check($_POST['id'], DELETE);
$link->delete($_POST);
Event::log($link->fields['tickets_id'], "ticket", 4, "tracking", sprintf(__('%s deletes an actor'), $_SESSION["glpiname"]));
if ($item->can($link->fields["tickets_id"], READ)) {
Html::redirect($CFG_GLPI["root_doc"] . "/front/ticket.form.php?id=" . $link->fields['tickets_id']);
}
Session::addMessageAfterRedirect(__('You have been redirected because you no longer have access to this item'), true, ERROR);
Html::redirect($CFG_GLPI["root_doc"] . "/front/ticket.php");
} else {
示例5:
GLPI 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 GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
if (!defined('GLPI_ROOT')) {
include '../inc/includes.php';
}
$ticket_user = new Ticket_User();
Session::checkLoginUser();
if (isset($_POST["update"])) {
$ticket_user->check($_POST["id"], 'w');
$ticket_user->update($_POST);
echo "<script type='text/javascript' >\n";
echo "window.opener.location.reload();";
echo "window.close()";
echo "</script>";
} else {
if (isset($_GET["id"])) {
$ticket_user->showUserNotificationForm($_GET["id"]);
} else {
Html::displayErrorAndDie('Lost');
}
}
示例6: manageTicket
private function manageTicket($closed = true)
{
global $DB, $CFG_GLPI;
$DB->connect();
$_SESSION['glpiactive_entity'] = 0;
$CFG_GLPI['root_doc'] = "http://127.0.0.1/fusion0.83/";
$plugin = new Plugin();
$plugin->getFromDBbyDir("timelineticket");
$plugin->activate($plugin->fields['id']);
Plugin::load("timelineticket");
Session::loadLanguage("en_GB");
$ticket = new Ticket();
$group = new Group();
$group_ticket = new Group_Ticket();
$GLPIlog = new GLPIlogs();
$ticket_User = new Ticket_User();
$_SESSION['plugin_timelineticket_date'] = array();
$group->add(array('name' => 'grtech1'));
$group->add(array('name' => 'grtech2'));
// * 01/
$_SESSION["glpi_currenttime"] = date("Y-m-d H:i:s");
$a_storedate = array('1' => $_SESSION["glpi_currenttime"]);
$input = array();
$input['name'] = 'Pb with the ticket';
$input['content'] = 'I have a problem with the ticket';
$tickets_id = $ticket->add($input);
$GLPIlog->testSQLlogs('01/');
$GLPIlog->testPHPlogs('01/');
// * 02/
sleep(2);
// * 03/
$_SESSION["glpi_currenttime"] = date("Y-m-d H:i:s");
$a_storedate[3] = $_SESSION["glpi_currenttime"];
$input = array();
$input['id'] = $tickets_id;
$input['_itil_assign']['_type'] = 'group';
$input['_itil_assign']['groups_id'] = 1;
$ticket->update($input);
$input['_itil_assign']['_type'] = 'user';
$input['_itil_assign']['users_id'] = 2;
$ticket->update($input);
$GLPIlog->testSQLlogs('03/');
$GLPIlog->testPHPlogs('03/');
$a_db = getAllDatasFromTable('glpi_groups_tickets');
$a_ref = array();
$a_ref[1] = array('id' => '1', 'tickets_id' => '1', 'groups_id' => '1', 'type' => '2');
$this->assertEquals($a_ref, $a_db, 'May have ticket assigned to group1');
$a_db = getAllDatasFromTable('glpi_tickets_users');
$a_ref = array();
$a_ref[1] = array('id' => '1', 'tickets_id' => '1', 'users_id' => '2', 'type' => '1', 'use_notification' => '1', 'alternative_email' => '');
$a_ref[2] = array('id' => '2', 'tickets_id' => '1', 'users_id' => '2', 'type' => '2', 'use_notification' => '1', 'alternative_email' => '');
$this->assertEquals($a_ref, $a_db, 'May have ticket assigned to user 2 (glpi)');
// * 04/
sleep(2);
// * 05/
$_SESSION["glpi_currenttime"] = date("Y-m-d H:i:s");
$a_storedate[5] = $_SESSION["glpi_currenttime"];
$input = array();
$input['id'] = $tickets_id;
$input['status'] = Ticket::WAITING;
$ticket->update($input);
$GLPIlog->testSQLlogs('05/');
$GLPIlog->testPHPlogs('05/');
$ticket->getFromDB(1);
$this->assertEquals('waiting', $ticket->fields['status'], 'May have status waiting');
// * 06/
sleep(1);
// * 07/
$_SESSION["glpi_currenttime"] = date("Y-m-d H:i:s");
$a_storedate[7] = $_SESSION["glpi_currenttime"];
$input = array();
$input['id'] = 2;
$input['itickets_id'] = $tickets_id;
$ticket_User->check($input['id'], 'w');
$ticket_User->delete($input);
$input = array();
$input['id'] = 1;
$input['itickets_id'] = $tickets_id;
$group_ticket->check($input['id'], 'w');
$group_ticket->delete($input);
$GLPIlog->testSQLlogs('07/');
$GLPIlog->testPHPlogs('07/');
$a_db = getAllDatasFromTable('glpi_groups_tickets');
$this->assertEquals(array(), $a_db, 'May have no group assigned');
// * 08/
sleep(1);
// * 09/
$_SESSION["glpi_currenttime"] = date("Y-m-d H:i:s");
$a_storedate[9] = $_SESSION["glpi_currenttime"];
$input = array();
$input['id'] = $tickets_id;
$input['_itil_assign']['_type'] = 'group';
$input['_itil_assign']['groups_id'] = 2;
$ticket->update($input);
$GLPIlog->testSQLlogs('09/');
$GLPIlog->testPHPlogs('09/');
$a_db = getAllDatasFromTable('glpi_groups_tickets');
$a_ref = array();
$a_ref[2] = array('id' => '2', 'tickets_id' => '1', 'groups_id' => '2', 'type' => '2');
$this->assertEquals($a_ref, $a_db, 'May have ticket assigned to group2');
//.........这里部分代码省略.........