public static function generateFormSelectListForFormCreator($metadata = TRUE) { if ($metadata === TRUE) { if (($forms = forms::getMetadataForms()) === FALSE) { errorHandle::errorMsg("Error getting Metadata Forms"); return FALSE; } } else { if ($metadata === FALSE) { if (($forms = forms::getObjectForms()) === FALSE) { errorHandle::errorMsg("Error getting Object Forms"); return FALSE; } } } $formList = '<ul class="pickList">'; foreach ($forms as $form) { if (!mfcsPerms::isViewer($form['ID'])) { continue; } $formList .= sprintf('<li><a href="index.php?id=%s" class="btn">%s</a></li>', htmlSanitize($form['ID']), forms::title($form['ID'])); } $formList .= "<ul>"; return $formList; }
if (!isset($compatibleForms[$engine->cleanPost['MYSQL']['form']])) { throw new Exception("Selected form is not compatible with original form."); } // @TODO this logic shouldn't be here $sql = sprintf("UPDATE `objects` SET `formID`='%s' WHERE `ID`='%s' AND `formID`='%s' LIMIT 1", $engine->cleanPost['MYSQL']['form'], $engine->openDB->escape($engine->cleanPost['MYSQL']['objectID']), $engine->openDB->escape($form['ID'])); $sqlResult = $engine->openDB->query($sql); if (!$sqlResult['result']) { errorHandle::newError(__METHOD__ . "() - : " . $sqlResult['error'], errorHandle::DEBUG); throw new Exception("Error updating object record."); } if (($form = forms::get($engine->cleanPost['MYSQL']['form'])) === FALSE) { throw new Exception("Error retrieving form."); } log::insert("Data Entry: Move: Successful Move", $engine->cleanPost['MYSQL']['objectID'], $form['ID'], $engine->cleanPost['MYSQL']['form']); errorHandle::successMsg("Object Moved."); localvars::add("originalFormTitle", forms::title($form['ID'])); } } catch (Exception $e) { log::insert("Data Entry: Move: Error", 0, 0, $e->getMessage()); errorHandle::errorMsg($e->getMessage()); } log::insert("Data Entry: Move: Page View"); localVars::add("results", displayMessages()); $engine->eTemplate("include", "header"); ?> {local var="projectWarning"} <section> <header class="page-header"> <h1>{local var="formName"}</h1>