public function update() { global $ilDB; parent::update(); $sql = 'SELECT * FROM ' . self::TABLE_NAME . ' WHERE orgu_id = ' . $ilDB->quote($this->getId(), 'integer'); $set = $ilDB->query($sql); if ($ilDB->numRows($set)) { $ilDB->update(self::TABLE_NAME, array('orgu_type_id' => array('integer', $this->getOrgUnitTypeId())), array('orgu_id' => array('integer', $this->getId()))); } else { $ilDB->insert(self::TABLE_NAME, array('orgu_type_id' => array('integer', $this->getOrgUnitTypeId()), 'orgu_id' => array('integer', $this->getId()))); } // Update selection for advanced meta data of the type if ($this->getOrgUnitTypeId()) { ilAdvancedMDRecord::saveObjRecSelection($this->getId(), 'orgu_type', $this->getOrgUnitType()->getAssignedAdvancedMDRecordIds()); } else { // If no type is assigned, delete relations by passing an empty array ilAdvancedMDRecord::saveObjRecSelection($this->getId(), 'orgu_type', array()); } }
/** * update complete object */ function update() { global $ilAppEventHandler, $ilLog; include_once './Services/Container/classes/class.ilContainerSortingSettings.php'; $sorting = new ilContainerSortingSettings($this->getId()); $sorting->setSortMode($this->getOrderType()); $sorting->update(); $this->updateMetaData(); $this->updateSettings(); parent::update(); $ilAppEventHandler->raise('Modules/Course', 'update', array('object' => $this, 'obj_id' => $this->getId(), 'appointments' => $this->prepareAppointments('update'))); }
/** * Update group */ function update() { global $ilDB, $ilAppEventHandler; if (!parent::update()) { return false; } $query = "UPDATE grp_settings " . "SET information = " . $ilDB->quote($this->getInformation(), 'text') . ", " . "grp_type = " . $ilDB->quote((int) $this->getGroupType(), 'integer') . ", " . "registration_type = " . $ilDB->quote($this->getRegistrationType(), 'integer') . ", " . "registration_enabled = " . $ilDB->quote($this->isRegistrationEnabled() ? 1 : 0, 'integer') . ", " . "registration_unlimited = " . $ilDB->quote($this->isRegistrationUnlimited() ? 1 : 0, 'integer') . ", " . "registration_start = " . $ilDB->quote($this->getRegistrationStart()->get(IL_CAL_DATETIME, ''), 'timestamp') . ", " . "registration_end = " . $ilDB->quote($this->getRegistrationEnd()->get(IL_CAL_DATETIME, ''), 'timestamp') . ", " . "registration_password = "******", " . "registration_mem_limit = " . $ilDB->quote((int) $this->isMembershipLimited(), 'integer') . ", " . "registration_max_members = " . $ilDB->quote($this->getMaxMembers(), 'integer') . ", " . "waiting_list = " . $ilDB->quote($this->isWaitingListEnabled() ? 1 : 0, 'integer') . ", " . "latitude = " . $ilDB->quote($this->getLatitude(), 'text') . ", " . "longitude = " . $ilDB->quote($this->getLongitude(), 'text') . ", " . "location_zoom = " . $ilDB->quote($this->getLocationZoom(), 'integer') . ", " . "enablemap = " . $ilDB->quote((int) $this->getEnableGroupMap(), 'integer') . ", " . 'reg_ac_enabled = ' . $ilDB->quote($this->isRegistrationAccessCodeEnabled(), 'integer') . ', ' . 'reg_ac = ' . $ilDB->quote($this->getRegistrationAccessCode(), 'text') . ', ' . 'view_mode = ' . $ilDB->quote($this->getViewMode(false), 'integer') . ', ' . 'mail_members_type = ' . $ilDB->quote($this->getMailToMembersType(), 'integer') . ' ' . "WHERE obj_id = " . $ilDB->quote($this->getId(), 'integer') . " "; $res = $ilDB->manipulate($query); $ilAppEventHandler->raise('Modules/Group', 'update', array('object' => $this, 'obj_id' => $this->getId(), 'appointments' => $this->prepareAppointments('update'))); return true; }
/** * update object data * * @access public * @return boolean */ function update() { global $ilDB; $this->ilincAPI->editCourse($this->getiLincId(), $_POST["Fobject"]); $response = $this->ilincAPI->sendRequest(); if ($response->isError()) { $this->error_msg = $response->getErrorMsg(); return false; } // TODO: alter akclassvalues of classes here if (!parent::update()) { $this->error_msg = "database_error"; return false; } $db_activated_value = is_bool($this->activated) ? $this->activated ? 'y' : 'n' : $this->activated; $r = $ilDB->manipulateF(' UPDATE ilinc_data SET activation_offline = %s, akclassvalue1 = %s, akclassvalue2 = %s WHERE obj_id = %s', array('text', 'text', 'text', 'integer'), array($db_activated_value, $this->getAKClassValue1(), $this->getAKClassValue2(), $this->getId())); return true; }