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


PHP addMessageAfterRedirect函数代码示例

本文整理汇总了PHP中addMessageAfterRedirect函数的典型用法代码示例。如果您正苦于以下问题:PHP addMessageAfterRedirect函数的具体用法?PHP addMessageAfterRedirect怎么用?PHP addMessageAfterRedirect使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: prepareInputForAdd

 function prepareInputForAdd($input)
 {
     global $LANG;
     if (!isset($input['profiles_id']) || $input['profiles_id'] <= 0 || !isset($input['entities_id']) || $input['entities_id'] < 0 || !isset($input['users_id']) || $input['users_id'] < 0) {
         addMessageAfterRedirect($LANG['common'][24], false, ERROR);
         return false;
     }
     return $input;
 }
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:9,代码来源:profile_user.class.php

示例2: prepareInputForAdd

 function prepareInputForAdd($input)
 {
     global $LANG;
     // Check override of segment : do not add
     if (count(self::getSegmentsBetween($input['calendars_id'], $input['day'], $input['begin'], $input['day'], $input['end'])) > 0) {
         addMessageAfterRedirect($LANG['calendar'][8], false, ERROR);
         return false;
     }
     return $input;
 }
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:10,代码来源:calendarsegment.class.php

示例3: prepareInputForAdd

 /**
  * Prepare input datas for adding the relation
  *
  * Overloaded to check is Disconnect needed (during OCS sync)
  * and to manage autoupdate feature
  *
  *@param $input datas used to add the item
  *
  *@return the modified $input array
  *
  **/
 function prepareInputForAdd($input)
 {
     global $DB, $CFG_GLPI, $LANG;
     switch ($input['itemtype']) {
         case 'Monitor':
             $item = new Monitor();
             $ocstab = 'import_monitor';
             break;
         case 'Phone':
             // shoul really never occurs as OCS doesn't sync phone
             $item = new Phone();
             $ocstab = '';
             break;
         case 'Printer':
             $item = new Printer();
             $ocstab = 'import_printer';
             break;
         case 'Peripheral':
             $item = new Peripheral();
             $ocstab = 'import_peripheral';
             break;
         default:
             return false;
     }
     if (!$item->getFromDB($input['items_id'])) {
         return false;
     }
     if (!$item->getField('is_global')) {
         // Handle case where already used, should never happen (except from OCS sync)
         $query = "SELECT `id`, `computers_id`\n                   FROM `glpi_computers_items`\n                   WHERE `glpi_computers_items`.`items_id` = '" . $input['items_id'] . "'\n                         AND `glpi_computers_items`.`itemtype` = '" . $input['itemtype'] . "'";
         $result = $DB->query($query);
         while ($data = $DB->fetch_assoc($result)) {
             $temp = clone $this;
             $temp->delete($data);
             if ($ocstab) {
                 OcsServer::deleteInOcsArray($data["computers_id"], $data["id"], $ocstab);
             }
         }
         // Autoupdate some fields - should be in post_addItem (here to avoid more DB access)
         $comp = new Computer();
         if ($comp->getFromDB($input['computers_id'])) {
             $updates = array();
             if ($CFG_GLPI["is_location_autoupdate"] && $comp->fields['locations_id'] != $item->getField('locations_id')) {
                 $updates['locations_id'] = addslashes($comp->fields['locations_id']);
                 addMessageAfterRedirect($LANG['computers'][48], true);
             }
             if ($CFG_GLPI["is_user_autoupdate"] && $comp->fields['users_id'] != $item->getField('users_id') || $CFG_GLPI["is_group_autoupdate"] && $comp->fields['groups_id'] != $item->getField('groups_id')) {
                 if ($CFG_GLPI["is_user_autoupdate"]) {
                     $updates['users_id'] = $comp->fields['users_id'];
                 }
                 if ($CFG_GLPI["is_group_autoupdate"]) {
                     $updates['groups_id'] = $comp->fields['groups_id'];
                 }
                 addMessageAfterRedirect($LANG['computers'][50], true);
             }
             if ($CFG_GLPI["is_contact_autoupdate"] && ($comp->fields['contact'] != $item->getField('contact') || $comp->fields['contact_num'] != $item->getField('contact_num'))) {
                 $updates['contact'] = addslashes($comp->fields['contact']);
                 $updates['contact_num'] = addslashes($comp->fields['contact_num']);
                 addMessageAfterRedirect($LANG['computers'][49], true);
             }
             if ($CFG_GLPI["state_autoupdate_mode"] < 0 && $comp->fields['states_id'] != $item->getField('states_id')) {
                 $updates['states_id'] = $comp->fields['states_id'];
                 addMessageAfterRedirect($LANG['computers'][56], true);
             }
             if ($CFG_GLPI["state_autoupdate_mode"] > 0 && $item->getField('states_id') != $CFG_GLPI["state_autoupdate_mode"]) {
                 $updates['states_id'] = $CFG_GLPI["state_autoupdate_mode"];
             }
             if (count($updates)) {
                 $updates['id'] = $input['items_id'];
                 $item->update($updates);
             }
         }
     }
     return $input;
 }
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:86,代码来源:computer_item.class.php

示例4: addFiles

 /**
  * add files (from $_FILES) to a ticket
  * create document if needed
  * create link from document to ticket
  *
  * @param $id of the ticket
  *
  * @return array of doc added name
  **/
 function addFiles($id)
 {
     global $LANG, $CFG_GLPI;
     if (!isset($_FILES)) {
         return array();
     }
     $docadded = array();
     $doc = new Document();
     $docitem = new Document_Item();
     // add Document if exists
     if (isset($_FILES['multiple'])) {
         unset($_FILES['multiple']);
         $TMPFILE = $_FILES;
     } else {
         $TMPFILE = array($_FILES);
     }
     foreach ($TMPFILE as $_FILES) {
         if (isset($_FILES['filename']) && count($_FILES['filename']) > 0 && $_FILES['filename']["size"] > 0) {
             // Check for duplicate
             if ($doc->getFromDBbyContent($this->fields["entities_id"], $_FILES['filename']['tmp_name'])) {
                 $docID = $doc->fields["id"];
             } else {
                 $input2 = array();
                 $input2["name"] = addslashes($LANG['tracking'][24] . " {$id}");
                 $input2["tickets_id"] = $id;
                 $input2["entities_id"] = $this->fields["entities_id"];
                 $input2["documentcategories_id"] = $CFG_GLPI["documentcategories_id_forticket"];
                 $input2["_only_if_upload_succeed"] = 1;
                 $input2["entities_id"] = $this->fields["entities_id"];
                 $docID = $doc->add($input2);
             }
             if ($docID > 0) {
                 if ($docitem->add(array('documents_id' => $docID, 'itemtype' => $this->getType(), 'items_id' => $id))) {
                     $docadded[] = stripslashes($doc->fields["name"] . " - " . $doc->fields["filename"]);
                 }
             }
         } else {
             if (!empty($_FILES['filename']['name']) && isset($_FILES['filename']['error']) && $_FILES['filename']['error']) {
                 addMessageAfterRedirect($LANG['document'][46], false, ERROR);
             }
         }
     }
     unset($_FILES);
     return $docadded;
 }
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:54,代码来源:ticket.class.php

示例5: Copyright

  ------------------------------------------------------------------------

  @package   Plugin Monitoring for GLPI
  @author    David Durieux
  @co-author 
  @comment   
  @copyright Copyright (c) 2011-2012 Plugin Monitoring for GLPI team
  @license   AGPL License 3.0 or (at your option) any later version
             http://www.gnu.org/licenses/agpl-3.0-standalone.html
  @link      https://forge.indepnet.net/projects/monitoring/
  @since     2011

  ------------------------------------------------------------------------
*/
if (!defined('GLPI_ROOT')) {
    define('GLPI_ROOT', '../../..');
}
include GLPI_ROOT . "/inc/includes.php";
PluginMonitoringProfile::checkRight("config", "w");
commonHeader($LANG['plugin_monitoring']['title'][0], $_SERVER["PHP_SELF"], "plugins", "monitoring", "rrdtemplates");
if (isset($_FILES['filename'])) {
    if (strstr($_FILES['filename']['name'], ".json")) {
        if (Document::renameForce($_FILES['filename']['tmp_name'], GLPI_PLUGIN_DOC_DIR . "/monitoring/templates/" . $_FILES['filename']['name'])) {
            addMessageAfterRedirect($LANG['document'][26]);
        }
    }
    glpi_header($_SERVER['HTTP_REFERER']);
}
$pmRrdtool = new PluginMonitoringRrdtool();
$pmRrdtool->addTemplate();
commonFooter();
开发者ID:RubichonL,项目名称:glpi_monitoring,代码行数:31,代码来源:rrdtemplate.form.php

示例6: prepareInputForUpdate

 function prepareInputForUpdate($input)
 {
     global $LANG;
     $job = new Ticket();
     $forbid_fields = array();
     if ($this->fields["users_id_validate"] == getLoginUserID()) {
         if ($input["status"] == "rejected" && (!isset($input["comment_validation"]) || $input["comment_validation"] == '')) {
             addMessageAfterRedirect($LANG['validation'][29], false, ERROR);
             return false;
         }
         if ($input["status"] == "waiting") {
             //             $input["comment_validation"] = '';
             $input["validation_date"] = 'NULL';
         } else {
             $input["validation_date"] = $_SESSION["glpi_currenttime"];
         }
         $forbid_fields = array('entities_id', 'users_id', 'tickets_id', 'users_id_validate', 'comment_submission', 'submission_date');
     } else {
         if (haveRight('create_validation', 1)) {
             // Update validation request
             $forbid_fields = array('entities_id', 'tickets_id', 'status', 'comment_validation', 'validation_date');
         }
     }
     if (count($forbid_fields)) {
         foreach ($forbid_fields as $key => $val) {
             if (isset($input[$key])) {
                 unset($input[$key]);
             }
         }
     }
     return $input;
 }
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:32,代码来源:ticketvalidation.class.php

示例7: explode

         $splitter = explode("_", $_POST["_my_items"]);
         if (count($splitter) == 2) {
             $_POST["itemtype"] = $splitter[0];
             $_POST["items_id"] = $splitter[1];
         }
     }
     $track->update($_POST);
     Event::log($_POST["id"], "ticket", 4, "tracking", $_SESSION["glpiname"] . " " . $LANG['log'][21]);
     // Copy solution to KB redirect to KB
     if (isset($_POST['_sol_to_kb']) && $_POST['_sol_to_kb']) {
         glpi_header($CFG_GLPI["root_doc"] . "/front/knowbaseitem.form.php?id=new&tickets_id=" . $_POST["id"]);
     } else {
         if ($track->can($_POST["id"], 'r')) {
             glpi_header($CFG_GLPI["root_doc"] . "/front/ticket.form.php?id=" . $_POST["id"]);
         }
         addMessageAfterRedirect($LANG['job'][26], true, ERROR);
         glpi_header($CFG_GLPI["root_doc"] . "/front/ticket.php");
     }
 } else {
     if (isset($_POST['delete'])) {
         $track->check($_POST['id'], 'd');
         $track->delete($_POST);
         Event::log($_POST["id"], "ticket", 4, "tracking", $_SESSION["glpiname"] . " " . $LANG['log'][22]);
         $track->redirectToList();
         /*
         } else if (isset($_POST['add']) || isset($_POST['add_close']) || isset($_POST['add_reopen'])) {
            checkSeveralRightsOr(array('add_followups'     => '1',
                                       'global_add_followups' => '1',
                                       'show_assign_ticket' => '1'));
            $newID = $fup->add($_POST);
            Event::log($_POST["tickets_id"], "ticket", 4, "tracking",
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:31,代码来源:ticket.form.php

示例8: prepareInputForAdd

 function prepareInputForAdd($input)
 {
     global $LANG;
     //      $input["_isadmin"] = haveRight("global_add_followups","1");
     $input["_job"] = new Ticket();
     if (!$input["_job"]->getFromDB($input["tickets_id"])) {
         return false;
     }
     // Manage File attached (from mailgate)
     $docadded = $input["_job"]->addFiles($input["tickets_id"]);
     if (count($docadded) > 0) {
         $input['content'] .= "\n";
         foreach ($docadded as $name) {
             $input['content'] .= "\n" . $LANG['mailing'][26] . " {$name}";
         }
     }
     // Pass old assign From Ticket in case of assign change
     //       if (isset($input["_old_assign"])) {
     //          $input["_job"]->fields["_old_assign"] = $input["_old_assign"];
     //       }
     //      if (!isset($input["type"])) {
     //         $input["type"] = "followup";
     //      }
     //      $input["_type"] = $input["type"];
     //      unset($input["type"]);
     $input['_close'] = 0;
     unset($input["add"]);
     if (!isset($input["users_id"]) && ($uid = getLoginUserID())) {
         $input["users_id"] = $uid;
     }
     //      if ($input["_isadmin"] && $input["_type"]!="update") {
     if (isset($input["add_close"])) {
         $input['_close'] = 1;
     }
     unset($input["add_close"]);
     if (isset($input["add_reopen"])) {
         if ($input["content"] == '') {
             addMessageAfterRedirect($LANG['jobresolution'][5], false, ERROR);
             return false;
         }
         $input['_reopen'] = 1;
     }
     unset($input["add_reopen"]);
     //      }
     $input["date"] = $_SESSION["glpi_currenttime"];
     return $input;
 }
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:47,代码来源:ticketfollowup.class.php

示例9: explode

                    } else {
                        $mailcollector->deleteOrImportSeveralEmails($emails_ids, 1, $_POST['entities_id']);
                    }
                }
                break;
            default:
                // Plugin specific actions
                $split = explode('_', $_POST["action"]);
                if ($split[0] == 'plugin' && isset($split[1])) {
                    // Normalized name plugin_name_action
                    // Allow hook from any plugin on any (core or plugin) type
                    doOneHook($split[1], 'MassiveActionsProcess', $_POST);
                } else {
                    if ($plug = isPluginItemType($_POST["itemtype"])) {
                        // non-normalized name
                        // hook from the plugin defining the type
                        doOneHook($plug['plugin'], 'MassiveActionsProcess', $_POST);
                    }
                }
        }
        addMessageAfterRedirect($LANG['common'][23]);
        glpi_header($REDIRECT);
    } else {
        //action, itemtype or item not defined
        echo "<div class='center'>" . "<img src='" . $CFG_GLPI["root_doc"] . "/pics/warning.png' alt='warning'><br><br>";
        echo "<b>" . $LANG['common'][24] . "</b></div>";
        displayBackLink();
    }
    commonFooter();
}
// itemtype defined
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:31,代码来源:massiveaction.php

示例10: RemoteStartAgent

 function RemoteStartAgent($ID, $ip)
 {
     $ptcm = new PluginFusioninventoryConfigModules();
     $pfia = new PluginFusioninventoryAgents();
     if (!$ptcm->isActivated('remotehttpagent') and !PluginFusioninventory::haveRight("remotecontrol", "w")) {
         return false;
     }
     $pfia->getFromDB($ID);
     if (!($fp = fsockopen($ip, 62354, $errno, $errstr, 1))) {
         $input = 'Agent don\'t respond';
         addMessageAfterRedirect($input);
         return false;
     } else {
         $handle = fopen("http://" . $ip . ":62354/now/" . $pfia->fields['token'], "r");
         $input = 'Agent run Now';
         fclose($fp);
         addMessageAfterRedirect($input);
         return true;
     }
 }
开发者ID:Hawke,项目名称:fusioninventory-for-glpi,代码行数:20,代码来源:task.class.php

示例11: cronInfocom

 /**
  * Cron action on infocom : alert on expired warranty
  *
  * @param $task to log, if NULL use display
  *
  * @return 0 : nothing to do 1 : done with success
  **/
 static function cronInfocom($task = NULL)
 {
     global $DB, $CFG_GLPI, $LANG;
     if (!$CFG_GLPI["use_mailing"]) {
         return 0;
     }
     $message = array();
     $cron_status = 0;
     $items_infos = array();
     $items_messages = array();
     foreach (Entity::getEntitiesToNotify('use_infocoms_alert') as $entity => $value) {
         $query_end = "SELECT `glpi_infocoms`.*\n                       FROM `glpi_infocoms`\n                       LEFT JOIN `glpi_alerts` ON (`glpi_infocoms`.`id` = `glpi_alerts`.`items_id`\n                                                   AND `glpi_alerts`.`itemtype` = 'Infocom'\n                                                   AND `glpi_alerts`.`type`='" . Alert::END . "')\n                       WHERE (`glpi_infocoms`.`alert` & " . pow(2, Alert::END) . ") >'0'\n                             AND `glpi_infocoms`.`entities_id`='" . $entity . "'\n                             AND `glpi_infocoms`.`warranty_duration`>'0'\n                             AND `glpi_infocoms`.`warranty_date` IS NOT NULL\n                             AND DATEDIFF(ADDDATE(`glpi_infocoms`.`warranty_date`,\n                                                  INTERVAL (`glpi_infocoms`.`warranty_duration`) MONTH),\n                                          CURDATE() )<'0'\n                             AND `glpi_alerts`.`date` IS NULL";
         foreach ($DB->request($query_end) as $data) {
             $item_infocom = new $data["itemtype"]();
             if ($item_infocom->getFromDB($data["items_id"])) {
                 $entity = $data['entities_id'];
                 $warranty = getWarrantyExpir($data["warranty_date"], $data["warranty_duration"]);
                 $message = $LANG['mailing'][40] . " " . $item_infocom->getTypeName() . " - " . $item_infocom->getName() . " : " . $warranty . "<br>";
                 $data['warrantyexpiration'] = $warranty;
                 $data['item_name'] = $item_infocom->getName();
                 $items_infos[$entity][$data['id']] = $data;
                 if (!isset($items_messages[$entity])) {
                     $items_messages[$entity] = $LANG['mailing'][40] . "<br />";
                 }
                 $items_messages[$entity] .= $message;
             }
         }
     }
     foreach ($items_infos as $entity => $items) {
         if (NotificationEvent::raiseEvent("alert", new self(), array('entities_id' => $entity, 'items' => $items))) {
             $message = $items_messages[$entity];
             $cron_status = 1;
             if ($task) {
                 $task->log(Dropdown::getDropdownName("glpi_entities", $entity) . ":  {$message}\n");
                 $task->addVolume(1);
             } else {
                 addMessageAfterRedirect(Dropdown::getDropdownName("glpi_entities", $entity) . ":  {$message}");
             }
             $alert = new Alert();
             $input["itemtype"] = 'Infocom';
             $input["type"] = Alert::END;
             foreach ($items as $id => $item) {
                 $input["items_id"] = $id;
                 $alert->add($input);
                 unset($alert->fields['id']);
             }
         } else {
             if ($task) {
                 $task->log(Dropdown::getDropdownName("glpi_entities", $entity) . ":  Send infocom alert failed\n");
             } else {
                 addMessageAfterRedirect(Dropdown::getDropdownName("glpi_entities", $entity) . ":  Send infocom alert failed", false, ERROR);
             }
         }
     }
     return $cron_status;
 }
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:63,代码来源:infocom.class.php

示例12: post_updateItem

 function post_updateItem($history = 1)
 {
     global $DB, $LANG, $CFG_GLPI;
     // Manage changes for OCS if more than 1 element (date_mod)
     // Need dohistory==1 if dohistory==2 no locking fields
     if ($this->fields["is_ocs_import"] && $history == 1 && count($this->updates) > 1) {
         OcsServer::mergeOcsArray($this->fields["id"], $this->updates, "computer_update");
     }
     if (isset($this->input["_auto_update_ocs"])) {
         $query = "UPDATE `glpi_ocslinks`\n                   SET `use_auto_update` = '" . $this->input["_auto_update_ocs"] . "'\n                   WHERE `computers_id` = '" . $this->input["id"] . "'";
         $DB->query($query);
     }
     for ($i = 0; $i < count($this->updates); $i++) {
         // Update contact of attached items
         if (($this->updates[$i] == "contact" || $this->updates[$i] == "contact_num") && $CFG_GLPI["is_contact_autoupdate"]) {
             $items = array('Monitor', 'Peripheral', 'Phone', 'Printer');
             $update_done = false;
             $updates3[0] = "contact";
             $updates3[1] = "contact_num";
             foreach ($items as $t) {
                 $query = "SELECT *\n                         FROM `glpi_computers_items`\n                         WHERE `computers_id` = '" . $this->fields["id"] . "'\n                               AND `itemtype` = '" . $t . "'";
                 if ($result = $DB->query($query)) {
                     $resultnum = $DB->numrows($result);
                     $item = new $t();
                     if ($resultnum > 0) {
                         for ($j = 0; $j < $resultnum; $j++) {
                             $tID = $DB->result($result, $j, "items_id");
                             $item->getFromDB($tID);
                             if (!$item->getField('is_global')) {
                                 if ($item->getField('contact') != $this->fields['contact'] || $item->getField('contact_num') != $this->fields['contact_num']) {
                                     $tmp["id"] = $item->getField('id');
                                     $tmp['contact'] = $this->fields['contact'];
                                     $tmp['contact_num'] = $this->fields['contact_num'];
                                     $item->update($tmp);
                                     $update_done = true;
                                 }
                             }
                         }
                     }
                 }
             }
             if ($update_done) {
                 addMessageAfterRedirect($LANG['computers'][49], true);
             }
         }
         // Update users and groups of attached items
         if ($this->updates[$i] == "users_id" && $this->fields["users_id"] != 0 && $CFG_GLPI["is_user_autoupdate"] || $this->updates[$i] == "groups_id" && $this->fields["groups_id"] != 0 && $CFG_GLPI["is_group_autoupdate"]) {
             $items = array('Monitor', 'Peripheral', 'Phone', 'Printer');
             $update_done = false;
             $updates4[0] = "users_id";
             $updates4[1] = "groups_id";
             foreach ($items as $t) {
                 $query = "SELECT *\n                         FROM `glpi_computers_items`\n                         WHERE `computers_id` = '" . $this->fields["id"] . "'\n                               AND `itemtype` = '" . $t . "'";
                 if ($result = $DB->query($query)) {
                     $resultnum = $DB->numrows($result);
                     $item = new $t();
                     if ($resultnum > 0) {
                         for ($j = 0; $j < $resultnum; $j++) {
                             $tID = $DB->result($result, $j, "items_id");
                             $item->getFromDB($tID);
                             if (!$item->getField('is_global')) {
                                 if ($item->getField('users_id') != $this->fields["users_id"] || $item->getField('groups_id') != $this->fields["groups_id"]) {
                                     $tmp["id"] = $item->getField('id');
                                     if ($CFG_GLPI["is_user_autoupdate"]) {
                                         $tmp["users_id"] = $this->fields["users_id"];
                                     }
                                     if ($CFG_GLPI["is_group_autoupdate"]) {
                                         $tmp["groups_id"] = $this->fields["groups_id"];
                                     }
                                     $item->update($tmp);
                                     $update_done = true;
                                 }
                             }
                         }
                     }
                 }
             }
             if ($update_done) {
                 addMessageAfterRedirect($LANG['computers'][50], true);
             }
         }
         // Update state of attached items
         if ($this->updates[$i] == "states_id" && $CFG_GLPI["state_autoupdate_mode"] < 0) {
             $items = array('Monitor', 'Peripheral', 'Phone', 'Printer');
             $update_done = false;
             foreach ($items as $t) {
                 $query = "SELECT *\n                         FROM `glpi_computers_items`\n                         WHERE `computers_id` = '" . $this->fields["id"] . "'\n                               AND `itemtype` = '" . $t . "'";
                 if ($result = $DB->query($query)) {
                     $resultnum = $DB->numrows($result);
                     $item = new $t();
                     if ($resultnum > 0) {
                         for ($j = 0; $j < $resultnum; $j++) {
                             $tID = $DB->result($result, $j, "items_id");
                             $item->getFromDB($tID);
                             if (!$item->getField('is_global')) {
                                 if ($item->getField('states_id') != $this->fields["states_id"]) {
                                     $tmp["id"] = $item->getField('id');
                                     $tmp["states_id"] = $this->fields["states_id"];
                                     $item->update($tmp);
                                     $update_done = true;
//.........这里部分代码省略.........
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:101,代码来源:computer.class.php

示例13: post_updateItem

 function post_updateItem($history = 1)
 {
     global $DB, $LANG;
     if (in_array('is_helpdesk_default', $this->updates)) {
         if ($this->input["is_helpdesk_default"]) {
             $query = "UPDATE `" . $this->getTable() . "`\n                      SET `is_helpdesk_default` = '0'\n                      WHERE `id` <> '" . $this->input['id'] . "'";
             $DB->query($query);
         } else {
             addMessageAfterRedirect($LANG['setup'][313], true);
         }
     }
     if (in_array('is_mail_default', $this->updates)) {
         if ($this->input["is_mail_default"]) {
             $query = "UPDATE `" . $this->getTable() . "`\n                      SET `is_mail_default` = '0'\n                      WHERE `id` <> '" . $this->input['id'] . "'";
             $DB->query($query);
         } else {
             addMessageAfterRedirect($LANG['setup'][313], true);
         }
     }
 }
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:20,代码来源:requesttype.class.php

示例14: computerImport

 /**
  * @param $params array
  **/
 static function computerImport($params = array())
 {
     if (isset($params['id'])) {
         $notimported = new PluginOcsinventoryngNotimportedcomputer();
         $notimported->getFromDB($params['id']);
         $changes = self::getOcsComputerInfos($notimported->fields);
         if (isset($params['force'])) {
             $result = PluginOcsinventoryngOcsServer::processComputer($notimported->fields['ocsid'], $notimported->fields['plugin_ocsinventoryng_ocsservers_id'], 0, $params['entity'], 0);
         } else {
             $result = PluginOcsinventoryngOcsServer::processComputer($notimported->fields['ocsid'], $notimported->fields['plugin_ocsinventoryng_ocsservers_id']);
         }
         if (in_array($result['status'], array(PluginOcsinventoryngOcsServer::COMPUTER_IMPORTED, PluginOcsinventoryngOcsServer::COMPUTER_LINKED, PluginOcsinventoryngOcsServer::COMPUTER_SYNCHRONIZED))) {
             $notimported->delete(array('id' => $params['id']));
             //If serial has been changed in order to import computer
             if (in_array('serial', $changes)) {
                 PluginOcsinventoryngOcsServer::mergeOcsArray($result['computers_id'], array('serial'), "computer_update");
             }
             addMessageAfterRedirect(__('Model'));
             return true;
         }
         $tmp = $notimported->fields;
         $tmp['reason'] = $result['status'];
         if (isset($result['entities_id'])) {
             $tmp["entities_id"] = $result['entities_id'];
         } else {
             $tmp['entities_id'] = 0;
         }
         $tmp["rules_id"] = json_encode($result['rule_matched']);
         $notimported->update($tmp);
         return false;
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:35,代码来源:notimportedcomputer.class.php

示例15: checkBeforeInsert

 /**
  * Perform checks to be sure that an itemtype and at least a field are selected
  *
  * @param input the values to insert in DB
  *
  * @return input the values to insert, but modified
  **/
 static function checkBeforeInsert($input)
 {
     global $LANG;
     if (!$input['itemtype'] || empty($input['_fields'])) {
         addMessageAfterRedirect($LANG['setup'][817], true, ERROR);
         $input = array();
     } else {
         $input['fields'] = implode(',', $input['_fields']);
         unset($input['_fields']);
     }
     return $input;
 }
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:19,代码来源:fieldunicity.class.php


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