Changeset 21 for trunk/bin/module_maker/skel/admin.php
- Timestamp:
- Nov 17, 2005 7:37:40 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/module_maker/skel/admin.php
r20 r21 216 216 if (!$frm = mysql_fetch_assoc($qid)) { 217 217 App::logMsg('Could not find record with %PRIMARY_KEY%: ' . $id, LOG_WARNING, __FILE__, __LINE__); 218 App::raiseMsg(sprintf(_("The requested record %s could not be found "), $id), MSG_ERR, __FILE__, __LINE__);218 App::raiseMsg(sprintf(_("The requested record %s could not be found."), $id), MSG_ERR, __FILE__, __LINE__); 219 219 App::dieBoomerangURL(); 220 220 } … … 244 244 if ($lock->isLocked() && !$lock->isMine()) { 245 245 $lock->dieErrorPage(); 246 } else {247 // Break the cache because we are changing the list data. 248 SessionCache::breakCache($_SERVER['PHP_SELF']);249 250 // Get the information for this object.251 $qid = DB::query("252 SELECT <##>253 FROM %DB_TBL%254 WHERE %PRIMARY_KEY% = '" . addslashes($id) . "'255 ");256 if (! list($name) = mysql_fetch_row($qid)) {257 App::logMsg('Could not find record with %PRIMARY_KEY%: ' . $id, LOG_WARNING, __FILE__, __LINE__);258 App::raiseMsg(sprintf(_("The requested record %s could not be found"), $id), MSG_ERR, __FILE__, __LINE__);259 App::dieBoomerangURL();260 }261 262 // Delete the record.263 DB::query("DELETE FROM %DB_TBL% WHERE %PRIMARY_KEY% = '" . addslashes($id) . "'");264 265 App::raiseMsg(sprintf(_("The %ITEM_TITLE% <strong>%s</strong> has been deleted."), $name), MSG_SUCCESS, __FILE__, __LINE__);266 267 // Unlock record. 268 $lock->remove();269 }246 } 247 248 // Break the cache because we are changing the list data. 249 SessionCache::breakCache($_SERVER['PHP_SELF']); 250 251 // Get the information for this object. 252 $qid = DB::query(" 253 SELECT <##> 254 FROM %DB_TBL% 255 WHERE %PRIMARY_KEY% = '" . addslashes($id) . "' 256 "); 257 if (! list($name) = mysql_fetch_row($qid)) { 258 App::logMsg('Could not find record with %PRIMARY_KEY%: ' . $id, LOG_WARNING, __FILE__, __LINE__); 259 App::raiseMsg(sprintf(_("The requested record %s could not be found."), $id), MSG_ERR, __FILE__, __LINE__); 260 App::dieBoomerangURL(); 261 } 262 263 // Delete the record. 264 DB::query("DELETE FROM %DB_TBL% WHERE %PRIMARY_KEY% = '" . addslashes($id) . "'"); 265 266 App::raiseMsg(sprintf(_("The %ITEM_TITLE% <strong>%s</strong> has been deleted."), $name), MSG_SUCCESS, __FILE__, __LINE__); 267 268 // Unlock record. 269 $lock->remove(); 270 270 } 271 271 … … 297 297 if ($lock->isLocked() && !$lock->isMine()) { 298 298 $lock->dieErrorPage(); 299 } else { 300 // Break the cache because we are changing the list data. 301 SessionCache::breakCache($_SERVER['PHP_SELF']); 299 } 300 301 // Break the cache because we are changing the list data. 302 SessionCache::breakCache($_SERVER['PHP_SELF']); 302 303 303 304 %UPDATE% 304 305 // Create version. 306 $version = RecordVersion::getInstance($GLOBALS['auth']); 307 $version->create('%DB_TBL%', '%PRIMARY_KEY%', $frm['%PRIMARY_KEY%'], $frm['<##>']); 308 309 App::raiseMsg(sprintf(_("The %ITEM_TITLE% <strong>%s</strong> has been updated."), $frm['<##>']), MSG_SUCCESS, __FILE__, __LINE__); 310 311 // Unlock record. 312 $lock->remove(); 313 } 305 306 // Create version. 307 $version = RecordVersion::getInstance($GLOBALS['auth']); 308 $version->create('%DB_TBL%', '%PRIMARY_KEY%', $frm['%PRIMARY_KEY%'], $frm['<##>']); 309 310 App::raiseMsg(sprintf(_("The %ITEM_TITLE% <strong>%s</strong> has been updated."), $frm['<##>']), MSG_SUCCESS, __FILE__, __LINE__); 311 312 // Unlock record. 313 $lock->remove(); 314 314 } 315 315
Note: See TracChangeset
for help on using the changeset viewer.