Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //in uis_script.php (controller)
- public function dynDeleteUISScript($script_id) {
- $objResponse = new xajaxResponse();
- $script = new UnattendedScript();
- $script->getScriptbyId($script_id);
- $memotable_dbh = new DbObject('UIS_script_memotable');
- $memotable_dbh->id = $this->memo_id;
- $remove_element = $script_id . "_row";
- if ( $script->dbh->delete && $memotable_dbh->delete ) {
- $objResponse->remove($remove_element);
- return $objResponse->getXML();
- }
- else {
- ipm_error ( 2,
- "Unable to delete : "
- . $this->script_path
- . ", script id: "
- . $this->script_id );
- return FALSE;
- }
- }
- //in view_scripts.php (view)
- <?php
- $scripts = Template::getVar ('scripts');
- $os_level = Template::getVar ('os_level');
- ?>
- <h1>Scripts available for <?=$os_level?></h1>
- <table>
- <tr>
- <th>Script ID</th>
- <th>Script Path</th>
- <th>Created By</th>
- <th>Last Edited By</th>
- <th>Last Edited At</th>
- <th>Script Type</th>
- <th>CVS Version</th>
- <th>Actions</th>
- </tr>
- <? foreach ( $script AS $scripts ) { ?>
- <tr>
- <td><?=$script->script_id?></td>
- <td><?=$script->script_path?></td>
- <td><?=$script->created_by?></td>
- <td><?=$script->last_edited_by?></td>
- <td><?=$script->last_edited_ts?></td>
- <td><?=$script->cvs_ver?></td>
- <td><? if (hasPerm ("aaisunixadmin")) { ?>
- <a href="?op=EditUISScript&script_id=<?=$script->script_id?>">[Edit]</a>
- <a onClick='ajax("dynDeleteUISScript", <?=$script->script_id?>)' href="#">[Delete]</a>
- </td>
- </tr>
- <? } ?>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement