/** * Validate model for update * * @return boolean */ public function validateForUpdate() { return !Tools::isNullOrEmptyString(Tools::param('id')) && !Tools::isNullOrEmptyString(Tools::param('value')) && Tools::isNumeric(Tools::param('sortKey')); }
/** * Validate model for update * * @return boolean */ public function validateForUpdate() { return !Tools::isNullOrEmptyString(Tools::param('id')) && Tools::isNumeric(Tools::param('id')) && !Tools::isNullOrEmptyString(Tools::param('appliesToTable')) && ('job' === Tools::param('appliesToTable') || 'company' === Tools::param('appliesToTable') || 'contact' === Tools::param('appliesToTable') || 'keyword' === Tools::param('appliesToTable') || 'search' === Tools::param('appliesToTable')) && !Tools::isNullOrEmptyString(Tools::param('appliesToId')) && Tools::isNumeric(Tools::param('appliesToId')) && !Tools::isNullOrEmptyString(Tools::param('noteText')); }
/** * * @return string */ public function getForm($readOnly = 'readwrite') { $RO = 'readonly' === $readOnly ? 'READONLY="READONLY" ' : ''; $searchModel = $this->_searchModel; $title = $this->getTitle(); $id = $searchModel->getId(); $engineName = htmlspecialchars($searchModel->getEngineName()); $searchName = htmlspecialchars($searchModel->getSearchName()); $url = htmlspecialchars($searchModel->getUrl()); $created = $searchModel->getCreated(); $updated = $searchModel->getUpdated(); $buttonLabel = $this->getButtonLabel(); if (Tools::isNumeric($id)) { $noteController = new NoteController('read'); $noteModels = $noteController->getSome("appliesToTable = 'search' and appliesToId = {$id}"); $noteListView = new NoteListView('html', $noteModels); $noteListView->setNoteModels($noteModels); $noteListView->setAppliesToTable('search'); $noteListView->setAppliesToId($id); $noteListViewText = $noteListView->getView(); } else { $noteListViewText = ''; } $returnValue = <<<HTML <h2>{$title}</h2> <form name="search" onsubmit="return validateSearch()" method="GET"> <table border="1" cellspacing="1" cellpadding="2"> <tr> <th>ID</th> <td><input type="text" name="id" value="{$id}" readonly="readonly" /></td> </tr> <tr> <th>Engine Name *</th> <td><input type="text" name="engineName" value="{$engineName}" {$RO} /></td> </tr> <tr> <th>Search Name *</th> <td><input type="text" name="searchName" value="{$searchName}" {$RO} /></td> </tr> <tr> <th>URL *</th> <td><input type="text" name="url" value="{$url}" {$RO} /></td> </tr> <tr> <th>Created</th> <td><input type="text" name="created" value="{$created}" disabled="disabled" /></td> </tr> <tr> <th>Updated</th> <td><input type="text" name="updated" value="{$updated}" disabled="disabled" /></td> </tr> <tr> <td colspan="2"> <center> <input type="reset" /> <input type="submit" name="act" value="{$buttonLabel}" /> </center> </td> </tr> </table> </form> {$noteListViewText} HTML; return $returnValue; }
/** * Validate model for update * * @return boolean */ public function validateForUpdate() { return !Tools::isNullOrEmptyString(Tools::param('id')) && Tools::isNumeric(Tools::param('id')) && !Tools::isNullOrEmptyString(Tools::param('userName')) && !Tools::isNullOrEmptyString(Tools::param('password')) && !Tools::isNullOrEmptyString(Tools::param('pSalt')); }