Buongiorno a tutti
ho bisogno di sapere quale file si occupa di inserire i dati nella tabella learning_organization
Prendendo ad esempio gli oggetti didattici htmlpage il log delle operazioni mysql eseguite è questo
447 Query INSERT INTO learning_trackingeneral
447 Query INSERT INTO learning_htmlpage
448 Query INSERT INTO learning_lo_param ( idParam, param_name, param_value ) VALUES ( '0', 'idReference', '' )
448 Query INSERT into learning_organization( idOrg, idParent, path, lev, title, objectType, idResource, idCategory, idUser, idAuthor, version, difficult, description, language, resource, objective, dateInsert, idCourse, prerequisites, isTerminator, idParam, visible, milestone, width, height, publish_from, publish_to ) VALUES (NULL,'0','/root/00000002','1', 'Titolo', 'htmlpage', '1', '0', '0', '1039', '1.0', '_MEDIUM', '', '', '', '', '2011-04-21 15:59:23' , '1', '', '0', '2', '1', '', 0, 0, '', '' )
ho dato un occhio ai sorgenti e ho trovato il file doceboLms/modules/htmlpage/htmlpage.php, alla riga 48 c'è la funzione inspage che si occupa di inserire i dati nella tabella learning_htmlpage
function inspage() {
checkPerm('view', false, 'storage');
$back_url = urldecode($_POST['back_url']);
$insert_query = "
INSERT INTO ".$GLOBALS['prefix_lms']."_htmlpage
SET title = '".( (trim($_POST['title']) == '') ? def('_NOTITLE', 'htmlpage', 'lms') : $_POST['title'] )."',
textof = 'PROVA_".$_POST['textof']."',
author = '".(int)getLogUserId()."'";
if(!mysql_query($insert_query)) {
$_SESSION['last_error'] = def('_ERR_SAVE', 'htmlpage', 'lms');
jumpTo( $back_url.'&create_result=0' );
}
mysql_query("update learning_organization LO set idPage=LO.idResource where objectType='htmlpage'");
list($idPage) = mysql_fetch_row(mysql_query("SELECT LAST_INSERT_ID()"));
jumpTo( $back_url.'&id_lo='.$idPage.'&create_result=1' );
}
inserendo quella query di update il sorgente funziona ma solo dall'inserimento successivo, come se la tupla viene inserita in learning_organization dopo il jumpTo.
Vorrei avere quindi qualche indicazione più precisa su che file andare a vedere per poter effettuare correttamente quell'update.
Grazie a tutti,
Gaetano





