Exemplo n.º 1
0
 /**
  * update object data
  *
  * @access	public
  * @return	boolean
  */
 function update()
 {
     global $ilDB;
     $this->updateMetaData();
     parent::update();
     $ilDB->manipulate("UPDATE file_based_lm SET " . " is_online = " . $ilDB->quote(ilUtil::tf2yn($this->getOnline()), "text") . ", startfile = " . $ilDB->quote($this->getStartFile(), "text") . " " . ", show_lic = " . $ilDB->quote($this->getShowLicense(), "integer") . " " . ", show_bib = " . $ilDB->quote($this->getShowBibliographicalData(), "integer") . " " . " WHERE id = " . $ilDB->quote($this->getId(), "integer"));
     return true;
 }
 /**
  * update object data
  *
  * @access	public
  * @return	boolean
  */
 function update()
 {
     global $ilDB;
     if (!parent::update()) {
         return false;
     }
     return true;
 }
 /**
  * update object data
  *
  * @access	public
  * @return	boolean
  */
 function update()
 {
     if (!parent::update()) {
         return false;
     }
     // put here object specific stuff
     return true;
 }
 /**
  * update object data
  *
  * @access	public
  * @return	boolean
  */
 function update()
 {
     $this->updateMetaData();
     if (!parent::update()) {
         return false;
     }
     // put here object specific stuff
     return true;
 }
 /**
  * update object data
  * @return	boolean
  */
 function update()
 {
     global $ilDB;
     if (!parent::update()) {
         return false;
     }
     // put here object specific stuff
     if ($this->getId()) {
         $ilDB->update("booking_settings", $this->getDBFields(), array("booking_pool_id" => array("integer", $this->getId())));
     }
     return true;
 }
 /**
  * update object data
  *
  * @access	public
  * @return	boolean
  */
 function update()
 {
     global $ilDB;
     if (!parent::update()) {
         return false;
     }
     // save styles of style folder
     $q = "DELETE FROM style_folder_styles WHERE folder_id = " . $ilDB->quote($this->getId(), "integer");
     $ilDB->manipulate($q);
     foreach ($this->styles as $style) {
         $q = "INSERT INTO style_folder_styles (folder_id, style_id) VALUES" . "(" . $ilDB->quote((int) $this->getId(), "integer") . ", " . $ilDB->quote((int) $style["id"], "integer") . ")";
         $ilDB->manipulate($q);
     }
     return true;
 }
    /**
     * update object data
     *
     * @access	public
     * @return	boolean
     */
    function update()
    {
        global $ilDB;
        $this->updateMetaData();
        parent::update();
        $statement = $ilDB->manipulateF('
			UPDATE sahs_lm  
			SET c_online = %s, 
				api_adapter = %s, 
				api_func_prefix = %s,
				auto_review = %s,
				default_lesson_mode = %s,
				c_type = %s,
				stylesheet = %s, 
				editable = %s, 
				max_attempt = %s, 
				module_version = %s, 
				credit = %s, 
				glossary = %s, 
				question_tries = %s,
				unlimited_session = %s,
				no_menu = %s,
				hide_navig = %s,
				sequencing = %s,
				interactions = %s,
				objectives = %s,
				comments = %s,
				time_from_lms = %s,
				debug = %s,
				localization = %s,
				seq_exp_mode = %s,
				debugpw = %s,
				open_mode = %s,
				width = %s,
				height = %s,
				auto_continue = %s,
				auto_last_visited = %s,
				check_values = %s,
				offline_mode = %s,
				auto_suspend = %s
			WHERE id = %s', array('text', 'text', 'text', 'text', 'text', 'text', 'integer', 'integer', 'integer', 'integer', 'text', 'integer', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'text', 'integer', 'integer', 'integer', 'text', 'text', 'text', 'text', 'text', 'integer'), array(ilUtil::tf2yn($this->getOnline()), $this->getAPIAdapterName(), $this->getAPIFunctionsPrefix(), $this->getAutoReviewChar(), $this->getDefaultLessonMode(), $this->getSubType(), $this->getStyleSheetId(), $this->getEditable(), $this->getMaxAttempt(), $this->getModuleVersion(), $this->getCreditMode(), $this->getAssignedGlossary(), $this->getTries(), ilUtil::tf2yn($this->getSession()), ilUtil::tf2yn($this->getNoMenu()), ilUtil::tf2yn($this->getHideNavig()), ilUtil::tf2yn($this->getSequencing()), ilUtil::tf2yn($this->getInteractions()), ilUtil::tf2yn($this->getObjectives()), ilUtil::tf2yn($this->getComments()), ilUtil::tf2yn($this->getTime_from_lms()), ilUtil::tf2yn($this->getDebug()), $this->getLocalization(), $this->getSequencingExpertMode(), $this->getDebugPw(), $this->getOpenMode(), $this->getWidth(), $this->getHeight(), ilUtil::tf2yn($this->getAutoContinue()), ilUtil::tf2yn($this->getAuto_last_visited()), ilUtil::tf2yn($this->getCheck_values()), ilUtil::tf2yn($this->getOfflineMode()), ilUtil::tf2yn($this->getAutoSuspend()), $this->getId()));
        return true;
    }
Exemplo n.º 8
0
 /**
  * update media object in db
  */
 function update($a_upload = false)
 {
     parent::update();
     if (!$a_upload) {
         $this->updateMetaData();
     }
     ilMediaItem::deleteAllItemsOfMob($this->getId());
     // iterate all items
     $media_items =& $this->getMediaItems();
     $j = 1;
     foreach ($media_items as $key => $val) {
         $item =& $media_items[$key];
         if (is_object($item)) {
             $item->setMobId($this->getId());
             $item->setNr($j);
             if ($item->getLocationType() == "Reference") {
                 $item->extractUrlParameters();
             }
             $item->create();
             $j++;
         }
     }
     self::handleQuotaUpdate($this);
     global $ilAppEventHandler;
     $ilAppEventHandler->raise('Services/MediaObjects', 'update', array('object' => $this, 'obj_type' => 'mob', 'obj_id' => $this->getId()));
 }
 /**
  * update complete object (meta data and properties)
  */
 function update()
 {
     $this->updateMetaData();
     parent::update();
     $this->updateProperties();
     $this->updateAutoGlossaries();
 }
 protected function afterSave(ilObject $a_new_object)
 {
     $a_new_object->setOffline(true);
     $a_new_object->setNumberOfSlots(4);
     $a_new_object->update();
     // always send a message
     ilUtil::sendSuccess($this->lng->txt("book_pool_added"), true);
     $this->ctrl->setParameter($this, "ref_id", $a_new_object->getRefId());
     $this->ctrl->redirect($this, "edit");
 }
Exemplo n.º 11
0
 /**
  * Update
  */
 function update()
 {
     $ret = parent::update();
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     ilObjStyleSheet::writeStyleUsage($this->getId(), $this->getStyleSheetId());
     return $ret;
 }
Exemplo n.º 12
0
 /**
  * updates a record "user" and write it into database
  * @access	public
  */
 function update()
 {
     global $ilErr, $ilDB, $ilAppEventHandler;
     $this->syncActive();
     if (!$this->active) {
         $this->setInactivationDate(ilUtil::now());
     }
     $update_array = array("gender" => array("text", $this->gender), "title" => array("text", $this->utitle), "firstname" => array("text", $this->firstname), "lastname" => array("text", $this->lastname), "email" => array("text", trim($this->email)), "birthday" => array('date', $this->getBirthday()), "hobby" => array("text", $this->hobby), "institution" => array("text", $this->institution), "department" => array("text", $this->department), "street" => array("text", $this->street), "city" => array("text", $this->city), "zipcode" => array("text", $this->zipcode), "country" => array("text", $this->country), "sel_country" => array("text", $this->sel_country), "phone_office" => array("text", $this->phone_office), "phone_home" => array("text", $this->phone_home), "phone_mobile" => array("text", $this->phone_mobile), "fax" => array("text", $this->fax), "referral_comment" => array("text", $this->referral_comment), "matriculation" => array("text", $this->matriculation), "client_ip" => array("text", $this->client_ip), "approve_date" => array("timestamp", $this->approve_date), "active" => array("integer", $this->active), "time_limit_unlimited" => array("integer", $this->getTimeLimitUnlimited()), "time_limit_until" => array("integer", $this->getTimeLimitUntil()), "time_limit_from" => array("integer", $this->getTimeLimitFrom()), "time_limit_owner" => array("integer", $this->getTimeLimitOwner()), "time_limit_message" => array("integer", $this->getTimeLimitMessage()), "profile_incomplete" => array("integer", $this->getProfileIncomplete()), "auth_mode" => array("text", $this->getAuthMode()), "ext_account" => array("text", $this->getExternalAccount()), "im_icq" => array("text", $this->im_icq), "im_yahoo" => array("text", $this->im_yahoo), "im_msn" => array("text", $this->im_msn), "im_aim" => array("text", $this->im_aim), "im_skype" => array("text", $this->im_skype), "delicious" => array("text", $this->delicious), "latitude" => array("text", $this->latitude), "longitude" => array("text", $this->longitude), "loc_zoom" => array("integer", (int) $this->loc_zoom), "last_password_change" => array("integer", $this->last_password_change_ts), "im_jabber" => array("text", $this->im_jabber), "im_voip" => array("text", $this->im_voip), "last_update" => array("timestamp", ilUtil::now()), 'inactivation_date' => array('timestamp', $this->inactivation_date));
     if (isset($this->agree_date) && (strtotime($this->agree_date) !== false || $this->agree_date == null)) {
         $update_array["agree_date"] = array("timestamp", $this->agree_date);
     }
     switch ($this->passwd_type) {
         case IL_PASSWD_PLAIN:
             if (strlen($this->passwd)) {
                 $update_array["i2passwd"] = array("text", (string) "");
                 $update_array["passwd"] = array("text", (string) md5($this->passwd));
             } else {
                 $update_array["i2passwd"] = array("text", (string) "");
                 $update_array["passwd"] = array("text", (string) $this->passwd);
             }
             break;
         case IL_PASSWD_MD5:
             $update_array["i2passwd"] = array("text", (string) "");
             $update_array["passwd"] = array("text", (string) $this->passwd);
             break;
         case IL_PASSWD_CRYPT:
             $update_array["i2passwd"] = array("text", (string) $this->passwd);
             $update_array["passwd"] = array("text", (string) "");
             break;
         default:
             $ilErr->raiseError("<b>Error: passwd_type missing in function update()" . $this->id . "!</b><br />class: " . get_class($this) . "<br />Script: " . __FILE__ . "<br />Line: " . __LINE__, $ilErr->FATAL);
     }
     $ilDB->update("usr_data", $update_array, array("usr_id" => array("integer", $this->id)));
     $this->writePrefs();
     // update user defined fields
     $this->updateUserDefinedFields();
     parent::update();
     parent::updateOwner();
     $this->read();
     $ilAppEventHandler->raise("Services/User", "afterUpdate", array("user_obj" => $this));
     return true;
 }
 /**
  * update object in db
  *
  * @return	boolean	true on success
  */
 public function update()
 {
     parent::update();
     $this->write();
 }
Exemplo n.º 14
0
 /**
  * updates a record "role" and write it into database
  * @access	public
  */
 function update()
 {
     global $ilDB;
     $query = "UPDATE role_data SET " . "allow_register= " . $ilDB->quote($this->allow_register, 'integer') . ", " . "assign_users = " . $ilDB->quote($this->getAssignUsersStatus(), 'integer') . ", " . "disk_quota = " . $ilDB->quote($this->getDiskQuota(), 'integer') . ", " . "wsp_disk_quota = " . $ilDB->quote($this->getPersonalWorkspaceDiskQuota(), 'integer') . " " . "WHERE role_id= " . $ilDB->quote($this->id, 'integer') . " ";
     $res = $ilDB->manipulate($query);
     parent::update();
     $this->read();
     return true;
 }
Exemplo n.º 15
0
 /**
  * update object
  *
  * @access public
  * @param
  * @return bool success
  */
 public function update()
 {
     global $ilDB;
     global $ilAppEventHandler;
     if (!parent::update()) {
         return false;
     }
     $query = "UPDATE event SET " . "location = " . $this->db->quote($this->getLocation(), 'text') . "," . "tutor_name = " . $this->db->quote($this->getName(), 'text') . ", " . "tutor_phone = " . $this->db->quote($this->getPhone(), 'text') . ", " . "tutor_email = " . $this->db->quote($this->getEmail(), 'text') . ", " . "details = " . $this->db->quote($this->getDetails(), 'text') . ", " . "registration = " . $this->db->quote($this->enabledRegistration(), 'integer') . " " . "WHERE obj_id = " . $this->db->quote($this->getId(), 'integer') . " ";
     $res = $ilDB->manipulate($query);
     $ilAppEventHandler->raise('Modules/Session', 'update', array('object' => $this, 'obj_id' => $this->getId(), 'appointments' => $this->prepareCalendarAppointments('update')));
     return true;
 }
Exemplo n.º 16
0
    /**
     * update forum data
     * @access    public
     */
    function update()
    {
        /**
         * @var $ilDB ilDB
         */
        global $ilDB;
        if (parent::update()) {
            $statement = $ilDB->manipulateF('
				UPDATE frm_data 
				SET top_name = %s,
					top_description = %s,
					top_update = %s,
					update_user = %s
				WHERE top_frm_fk =%s', array('text', 'text', 'timestamp', 'integer', 'integer'), array($this->getTitle(), $this->getDescription(), date("Y-m-d H:i:s"), (int) $_SESSION["AccountId"], (int) $this->getId()));
            return true;
        }
        return false;
    }
Exemplo n.º 17
0
 /**
  * Update object
  */
 function update()
 {
     global $ilDB;
     $this->updateMetaData();
     $ilDB->manipulate("UPDATE glossary SET " . " is_online = " . $ilDB->quote(ilUtil::tf2yn($this->getOnline()), "text") . "," . " virtual = " . $ilDB->quote($this->getVirtualMode(), "text") . "," . " public_xml_file = " . $ilDB->quote($this->getPublicExportFile("xml"), "text") . "," . " public_html_file = " . $ilDB->quote($this->getPublicExportFile("html"), "text") . "," . " glo_menu_active = " . $ilDB->quote(ilUtil::tf2yn($this->isActiveGlossaryMenu()), "text") . "," . " downloads_active = " . $ilDB->quote(ilUtil::tf2yn($this->isActiveDownloads()), "text") . ", " . " pres_mode = " . $ilDB->quote($this->getPresentationMode(), "text") . ", " . " show_tax = " . $ilDB->quote((int) $this->getShowTaxonomy(), "integer") . ", " . " snippet_length = " . $ilDB->quote((int) $this->getSnippetLength(), "integer") . " " . " WHERE id = " . $ilDB->quote($this->getId(), "integer"));
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     ilObjStyleSheet::writeStyleUsage($this->getId(), $this->getStyleSheetId());
     parent::update();
 }
 protected function afterSave(ilObject $a_new_object)
 {
     $target_obj_id = ilObject::_lookupObjId((int) $_REQUEST['target_id']);
     $a_new_object->setTargetId($target_obj_id);
     $a_new_object->update();
     ilUtil::sendSuccess($this->lng->txt("object_added"), true);
     $this->ctrl->setParameter($this, 'ref_id', $a_new_object->getRefId());
     $this->ctrl->redirect($this, 'firstEdit');
 }
Exemplo n.º 19
0
 /**
  * update media object in db
  */
 function update($a_upload = false)
 {
     parent::update();
     if (!$a_upload) {
         $this->updateMetaData();
     }
     ilMediaItem::deleteAllItemsOfMob($this->getId());
     // iterate all items
     $media_items =& $this->getMediaItems();
     $j = 1;
     foreach ($media_items as $key => $val) {
         $item =& $media_items[$key];
         if (is_object($item)) {
             $item->setMobId($this->getId());
             $item->setNr($j);
             if ($item->getLocationType() == "Reference") {
                 $item->extractUrlParameters();
             }
             $item->create();
             $j++;
         }
     }
     self::handleQuotaUpdate($this);
 }
Exemplo n.º 20
0
 final function update()
 {
     if ($this->beforeUpdate()) {
         if (!parent::update()) {
             return false;
         }
         $this->doUpdate();
         return true;
     }
     return false;
 }
Exemplo n.º 21
0
 /**
  * update object in db
  * 
  * Note: This is mostly the same as method update in class.ilObject.php.
  *       In addition to updating descriptional properties, we also update the
  *       "type" property. This is needed, because a Null Resource can be converted
  *       into another resource type using a PUT or a MKCOL request by a WebDAV client.
  *
  * @access	public
  * @return	boolean	true on success
  */
 function update()
 {
     parent::update();
     $q = "UPDATE object_data" . " SET" . " type = '" . ilUtil::prepareDBString($this->getType()) . "'" . " WHERE obj_id = '" . $this->getId() . "'";
     $this->ilias->db->query($q);
     return true;
 }
 /**
  * update object
  */
 function update()
 {
     $this->updateMetaData();
     parent::update();
 }
Exemplo n.º 23
0
 function update()
 {
     global $ilDB;
     parent::update();
     $this->read();
     // this could be done better
     $this->writeCSSFile();
     $q = "UPDATE style_data " . "SET category = " . $ilDB->quote((int) $this->getScope(), "integer") . " WHERE id = " . $ilDB->quote($this->getId(), "integer");
     $ilDB->manipulate($q);
 }
Exemplo n.º 24
0
 /**
  * update object data
  *
  * @access	public
  * @return	boolean
  */
 function update($a_prevent_start_page_creation = false)
 {
     global $ilDB;
     if (!parent::update()) {
         return false;
     }
     $ilDB->update("il_wiki_data", array("is_online" => array("integer", $this->getOnline()), "startpage" => array("text", $this->getStartPage()), "short" => array("text", $this->getShortTitle()), "rating_overall" => array("integer", $this->getRatingOverall()), "rating" => array("integer", $this->getRating()), "rating_side" => array("integer", (bool) $this->getRatingAsBlock()), "rating_new" => array("integer", $this->getRatingForNewPages()), "rating_ext" => array("integer", $this->getRatingCategories()), "public_notes" => array("integer", $this->getPublicNotes()), "introduction" => array("clob", $this->getIntroduction()), "imp_pages" => array("integer", $this->getImportantPages()), "page_toc" => array("integer", $this->getPageToc()), "empty_page_templ" => array("integer", $this->getEmptyPageTemplate())), array("id" => array("integer", $this->getId())));
     // check whether start page exists
     include_once "./Modules/Wiki/classes/class.ilWikiPage.php";
     if (!ilWikiPage::exists($this->getId(), $this->getStartPage()) && !$a_prevent_start_page_creation) {
         $start_page = new ilWikiPage();
         $start_page->setWikiId($this->getId());
         $start_page->setTitle($this->getStartPage());
         $start_page->create();
     }
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     ilObjStyleSheet::writeStyleUsage($this->getId(), $this->getStyleSheetId());
     return true;
 }
 protected function afterSave(ilObject $a_new_object)
 {
     $a_new_object->notify("new", $_GET["ref_id"], $_GET["parent_non_rbac_id"], $_GET["ref_id"], $a_new_object->getRefId());
     $a_new_object->setCleanFrames(true);
     $a_new_object->update();
     // create content object tree
     $a_new_object->createLMTree();
     // create a first chapter
     $a_new_object->addFirstChapterAndPage();
     // always send a message
     ilUtil::sendSuccess($this->lng->txt($this->type . "_added"), true);
     ilUtil::redirect("ilias.php?ref_id=" . $a_new_object->getRefId() . "&baseClass=ilLMEditorGUI");
 }
 function update()
 {
     global $ilDB;
     parent::update();
     /*$query = "UPDATE exc_data SET ".
     			"instruction = ".$ilDB->quote($this->getInstruction()).", ".
     			"time_stamp = ".$ilDB->quote($this->getTimestamp())." ".
     			"WHERE obj_id = ".$ilDB->quote($this->getId());
     		*/
     if ($this->getPassMode() == "all") {
         $pass_nr = null;
     } else {
         $pass_nr = $this->getPassNr();
     }
     $ilDB->update("exc_data", array("instruction" => array("clob", $this->getInstruction()), "time_stamp" => array("integer", $this->getTimestamp()), "pass_mode" => array("text", $this->getPassMode()), "pass_nr" => array("integer", $this->getPassNr()), "show_submissions" => array("integer", (int) $this->getShowSubmissions()), 'compl_by_submission' => array('integer', (int) $this->isCompletionBySubmissionEnabled())), array("obj_id" => array("integer", $this->getId())));
     $this->updateAllUsersStatus();
     //$res = $this->ilias->db->query($query);
     #$this->members_obj->update();
     return true;
 }
 /**
  * update object data
  *
  * @access	public
  * @return	boolean
  */
 function update()
 {
     global $ilDB;
     if (!parent::update()) {
         return false;
     }
     // put here object specific stuff
     $ilDB->manipulate("UPDATE mep_data SET " . " default_width = " . $ilDB->quote($this->getDefaultWidth(), "integer") . "," . " default_height = " . $ilDB->quote($this->getDefaultHeight(), "integer") . " WHERE id = " . $ilDB->quote($this->getId(), "integer"));
     return true;
 }
Exemplo n.º 28
0
 /**
  * save object
  * @access	public
  */
 protected function afterSave(ilObject $a_new_object)
 {
     global $rbacadmin, $ilUser;
     $a_new_object->getMemberObject()->add($ilUser->getId(), IL_CRS_ADMIN);
     $a_new_object->getMemberObject()->updateNotification($ilUser->getId(), 1);
     $a_new_object->update();
     // BEGIN ChangeEvent: Record write event.
     require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
     global $ilUser;
     ilChangeEvent::_recordWriteEvent($a_new_object->getId(), $ilUser->getId(), 'create');
     // END ChangeEvent: Record write event.
     // always send a message
     ilUtil::sendSuccess($this->lng->txt("crs_added"), true);
     $this->ctrl->setParameter($this, "ref_id", $a_new_object->getRefId());
     ilUtil::redirect($this->getReturnLocation("save", $this->ctrl->getLinkTarget($this, "edit", "", false, false)));
 }
Exemplo n.º 29
0
 /**
  * update object
  *
  * @access public
  * @param
  * @return
  */
 public function update()
 {
     global $ilDB;
     parent::update();
     $query = "DELETE FROM container_reference " . "WHERE obj_id = " . $ilDB->quote($this->getId(), 'integer') . " ";
     $ilDB->manipulate($query);
     $query = "INSERT INTO container_reference (obj_id, target_obj_id, title_type) " . "VALUES( " . $ilDB->quote($this->getId(), 'integer') . ", " . $ilDB->quote($this->getTargetId(), 'integer') . ", " . $ilDB->quote($this->getTitleType(), 'integer') . ' ' . ")";
     $ilDB->manipulate($query);
 }
Exemplo n.º 30
0
 /**
  * update object data
  *
  * @access	public
  * @return	boolean
  */
 function update()
 {
     global $ilDB;
     if (!parent::update()) {
         return false;
     }
     // update media cast data
     $query = "UPDATE il_media_cast_data SET " . " is_online = " . $ilDB->quote((int) $this->getOnline(), "integer") . ", public_files = " . $ilDB->quote((int) $this->getPublicFiles(), "integer") . ", downloadable = " . $ilDB->quote((int) $this->getDownloadable(), "integer") . ", def_access = " . $ilDB->quote((int) $this->getDefaultAccess(), "integer") . ", sortmode = " . $ilDB->quote((int) $this->getOrder(), "integer") . ", viewmode = " . $ilDB->quote($this->getViewMode(), "text") . " WHERE id = " . $ilDB->quote((int) $this->getId(), "integer");
     $ilDB->manipulate($query);
     return true;
 }