[phpwebapp-commits] CVS: top10/templates/proj_list/footer list_footer.php,1.1.1.1,1.2 list_footer.js
Brought to you by:
dashohoxha
From: Dashamir H. <das...@us...> - 2003-09-30 10:24:29
|
Update of /cvsroot/phpwebapp/top10/templates/proj_list/footer In directory sc8-pr-cvs1:/tmp/cvs-serv22218/templates/proj_list/footer Modified Files: list_footer.php list_footer.js list_footer.html list_footer.db Log Message: 'list_footer' is different for admin. Index: list_footer.php =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_list/footer/list_footer.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** list_footer.php 23 Sep 2003 14:04:14 -0000 1.1.1.1 --- list_footer.php 30 Sep 2003 10:24:22 -0000 1.2 *************** *** 29,45 **** } ! function on_approve($event_args) { $selected = $event_args["selected"]; - //WebApp::message("approve: $selected"); //debug $params = array("selected_projects" => $this->reformat($selected)); ! WebApp::execDBCmd("approve", $params); ! WebApp::setSVar("proj_list_rs->recount", "true"); } function on_delete($event_args) { $selected = $event_args["selected"]; - //WebApp::message("delete: $selected"); //debug $params = array("selected_projects" => $this->reformat($selected)); WebApp::execDBCmd("delete", $params); --- 29,47 ---- } ! function on_edit($event_args) { + if (ADMIN <> 'true') return; + $selected = $event_args["selected"]; $params = array("selected_projects" => $this->reformat($selected)); ! //ToDo: do editing of projects ! //WebApp::execDBCmd("approve", $params); } function on_delete($event_args) { + if (ADMIN <> 'true') return; + $selected = $event_args["selected"]; $params = array("selected_projects" => $this->reformat($selected)); WebApp::execDBCmd("delete", $params); *************** *** 47,69 **** } ! function on_approve_all($event_args) { ! //WebApp::message("approve_all"); //debug ! WebApp::execDBCmd("approve_all"); ! WebApp::setSVar("proj_list->new", "false"); ! WebApp::setSVar("proj_list->select_condition", "(1=1)"); WebApp::setSVar("proj_list_rs->recount", "true"); } ! function on_add_to_list($event_args) { ! $selected = $event_args["selected"]; ! WebApp::message("add_to_list"); //debug ! /* WebApp::execDBCmd("approve_all"); ! WebApp::setSVar("proj_list->new", "false"); ! WebApp::setSVar("proj_list->select_condition", "(1=1)"); WebApp::setSVar("proj_list_rs->recount", "true"); - */ } --- 49,69 ---- } ! function on_approve($event_args) { ! if (ADMIN <> 'true') return; ! ! $selected = $event_args["selected"]; ! $params = array("selected_projects" => $this->reformat($selected)); ! WebApp::execDBCmd("approve", $params); WebApp::setSVar("proj_list_rs->recount", "true"); } ! function on_approve_all($event_args) { ! if (ADMIN <> 'true') return; ! WebApp::execDBCmd("approve_all"); ! WebApp::setSVar("proj_list->status", "approved"); WebApp::setSVar("proj_list_rs->recount", "true"); } Index: list_footer.js =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_list/footer/list_footer.js,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** list_footer.js 30 Sep 2003 07:02:41 -0000 1.3 --- list_footer.js 30 Sep 2003 10:24:22 -0000 1.4 *************** *** 95,96 **** --- 95,114 ---- SendEvent("list_footer", "delete", "selected="+selected); } + + /** Used by admin to approve new projects. */ + function approve_selected() + { + var selected = get_checked_projects(); + if (selected=="") + { + alert("Nothing Selected"); + return; + } + SendEvent("list_footer", "approve", "selected="+selected); + } + + /** Used by admin to approve all the new projects. */ + function approve_all() + { + SendEvent("list_footer", "approve_all"); + } Index: list_footer.html =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_list/footer/list_footer.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** list_footer.html 30 Sep 2003 07:02:41 -0000 1.3 --- list_footer.html 30 Sep 2003 10:24:22 -0000 1.4 *************** *** 25,34 **** </td> <td align="right"> <If condition="'{{ADMIN}}'=='true'"> ! <a class="button" href="javascript:del_selected()">Delete Selected</a> ! <a class="button" href="javascript:edit_selected()">Edit Selected</a> </If> - <a class="button" href="javascript:add_new_project()">Add New Project</a> - <a class="button" href="javascript:add_to_list()">Add to My List</a> </td> </tr> --- 25,38 ---- </td> <td align="right"> + <a class="button" href="javascript:add_new_project()">Add New Project</a> <If condition="'{{ADMIN}}'=='true'"> ! <a class="button" href="javascript:edit_selected()">Edit</a> ! <a class="button" href="javascript:del_selected()">Delete</a> ! <a class="button" href="javascript:approve_selected()">Approve</a> ! <a class="button" href="javascript:approve_all()">Approve All</a> ! </If> ! <If condition="'{{ADMIN}}'!='true'"> ! <a class="button" href="javascript:add_to_list()">Add to My List</a> </If> </td> </tr> Index: list_footer.db =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_list/footer/list_footer.db,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** list_footer.db 23 Sep 2003 14:04:14 -0000 1.1.1.1 --- list_footer.db 30 Sep 2003 10:24:22 -0000 1.2 *************** *** 1,15 **** <!--# -*-SQL-*- #tell emacs to use SQL mode #--> ! <dbCommand ID="approve"> <Query> ! UPDATE proj_list ! SET status = 'approved' WHERE proj_id IN ({{selected_projects}}) </Query> </dbCommand> ! <dbCommand ID="delete"> <Query> ! DELETE FROM proj_list WHERE proj_id IN ({{selected_projects}}) </Query> --- 1,15 ---- <!--# -*-SQL-*- #tell emacs to use SQL mode #--> ! <dbCommand ID="delete"> <Query> ! DELETE FROM proj_list WHERE proj_id IN ({{selected_projects}}) </Query> </dbCommand> ! <dbCommand ID="approve"> <Query> ! UPDATE proj_list ! SET status = 'approved' WHERE proj_id IN ({{selected_projects}}) </Query> |