Ejemplo n.º 1
0
    $mes = editHostInfo($id);
} elseif ($act == "addCate") {
    $mes = addCate();
} elseif ($act == "editCate") {
    $where = "id={$id}";
    $mes = editCate($where);
} elseif ($act == "delCate") {
    $mes = delCate($id);
} elseif ($act == "addHouse") {
    $mes = addHouse();
} elseif ($act == "editHouse") {
    $mes = editHouse($id);
} elseif ($act == "editCalendar") {
    $mes = editCalendar($id);
} elseif ($act == "editLocation") {
    $mes = editLocation($id);
} elseif ($act == "editServices") {
    $mes = editServices($id);
} elseif ($act == "delPro") {
    $mes = delPro($id);
} elseif ($act == "addUser") {
    $mes = addUser();
} elseif ($act == "delUser") {
    $mes = delUser($id);
} elseif ($act == "delHostInfo") {
    $mes = delHostInfo($id);
} elseif ($act == "editUser") {
    $mes = editUser($id);
} elseif ($act == "waterText") {
    $mes = doWaterText($id);
} elseif ($act == "waterPic") {
Ejemplo n.º 2
0
 * You should have received a copy of the GNU General Public License
 * along with MMC; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
require "modules/base/computers/localSidebar.php";
require "graph/navbar.inc.php";
require_once "modules/pulse2/includes/locations_xmlrpc.inc.php";
// Receiving form data
if (isset($_POST['name'], $_POST['parent'], $_POST['description'])) {
    if (empty($_GET['id'])) {
        addLocation($_POST['name'], $_POST['parent'], $_POST['description']);
        if (!isXMLRPCError()) {
            new NotifyWidgetSuccess(_T("The location has been added successfully.", "glpi"));
        }
    } else {
        editLocation($_GET['id'], $_POST['name'], $_POST['parent'], $_POST['description']);
        if (!isXMLRPCError()) {
            new NotifyWidgetSuccess(_T("The location has been edited successfully.", "glpi"));
        }
    }
}
$page_title = _T("Add location", 'glpi');
// Init form vars
$location_name = '';
$parent = 1;
$description = '';
if (isset($_GET['id'])) {
    $page_title = _T("Edit location", 'glpi');
    // Edition mode : init vars
    // Get the corresponding location
    $params = array();