|
From: <gbr...@us...> - 2003-07-31 23:56:18
|
Update of /cvsroot/phpwebsite-comm/modules/jobman/class
In directory sc8-pr-cvs1:/tmp/cvs-serv13519/class
Modified Files:
Job.php JobManager.php
Log Message:
handle edit, delete and view multiple job list items
Index: Job.php
===================================================================
RCS file: /cvsroot/phpwebsite-comm/modules/jobman/class/Job.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Job.php 26 May 2003 18:19:52 -0000 1.4
--- Job.php 31 Jul 2003 23:56:13 -0000 1.5
***************
*** 240,254 ****
* Displays current position listing
*
* @author George Brackett <gbr...@NO...>
*/
! function view() {
- $form = new EZform("JOB_VIEW");
- $form->add("CONTINUE_BUTTON", "submit", $_SESSION["translate"]->it("Continue"));
- $form->add("module", "hidden", "jobman");
- $form->add("JOB_MAN_op", "hidden", "list");
$tags = array();
! $tags = $form->getTemplate();
!
$tags["POSITION_LABEL"] = $_SESSION['translate']->it("Position");
$tags["STATUS_LABEL"] = $_SESSION['translate']->it("Status");
--- 240,256 ----
* Displays current position listing
*
+ * @param Boolean $continuebtn = TRUE if continue button is to be shown
* @author George Brackett <gbr...@NO...>
*/
! function view($continuebtn) {
$tags = array();
! if ($continuebtn) {
! $form = new EZform("JOB_VIEW");
! $form->add("CONTINUE_BUTTON", "submit", $_SESSION["translate"]->it("Continue"));
! $form->add("module", "hidden", "jobman");
! $form->add("JOB_MAN_op", "hidden", "list");
! $tags = $form->getTemplate();
! }
$tags["POSITION_LABEL"] = $_SESSION['translate']->it("Position");
$tags["STATUS_LABEL"] = $_SESSION['translate']->it("Status");
Index: JobManager.php
===================================================================
RCS file: /cvsroot/phpwebsite-comm/modules/jobman/class/JobManager.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** JobManager.php 21 May 2003 22:29:34 -0000 1.1.1.1
--- JobManager.php 31 Jul 2003 23:56:13 -0000 1.2
***************
*** 83,89 ****
*/
function _edit() {
$this->job = new Job($_REQUEST["PHPWS_MAN_ITEMS"][0]); /* PHPWS_MAN_ITEMS[0] contains the jobid */
! $content = $this->job->edit();
/* set display variables */
--- 83,95 ----
*/
function _edit() {
+ // warn only one edit at a time
+ if (sizeof($_REQUEST["PHPWS_MAN_ITEMS"]) > 1) {
+ $content = "<span class=\"errortext\">" . $_SESSION['translate']->it("You may only edit one job listing at a time.") . "</span><br />";
+ } else {
+ $content = "";
+ }
$this->job = new Job($_REQUEST["PHPWS_MAN_ITEMS"][0]); /* PHPWS_MAN_ITEMS[0] contains the jobid */
! $content .= $this->job->edit();
/* set display variables */
***************
*** 102,107 ****
function _delete() {
$this->job = new Job($_REQUEST["PHPWS_MAN_ITEMS"][0]); /* PHPWS_MAN_ITEMS[0] contains the jobid */
! $content = $this->job->delete();
/* set display variables */
--- 108,119 ----
function _delete() {
+ // warn only one deletion at a time
+ if (sizeof($_REQUEST["PHPWS_MAN_ITEMS"]) > 1) {
+ $content = "<span class=\"errortext\">" . $_SESSION['translate']->it("You may only delete one job listing at a time.") . "</span><br />";
+ } else {
+ $content = "";
+ }
$this->job = new Job($_REQUEST["PHPWS_MAN_ITEMS"][0]); /* PHPWS_MAN_ITEMS[0] contains the jobid */
! $content .= $this->job->delete();
/* set display variables */
***************
*** 120,128 ****
function _view() {
! $this->job = new Job($_REQUEST["PHPWS_MAN_ITEMS"][0]); /* PHPWS_MAN_ITEMS[0] contains the jobid */
! $content = $this->job->view();
!
! /* set display variables */
! $GLOBALS["CNT_jobman"]["content"] = $content;
$GLOBALS["CNT_jobman"]["title"] = $_SESSION['translate']->it("Positions Available");
--- 132,145 ----
function _view() {
! /* PHPWS_MAN_ITEMS[0] contains the an array of job ids */
! $GLOBALS["CNT_staffman"]["content"] = "";
! // ask for a continue button only for the last id
! $i = 0;
! foreach($_REQUEST["PHPWS_MAN_ITEMS"] as $jobid) {
! $this->job = new Job($jobid);
! $content = $this->job->view($i == (sizeof($_REQUEST["PHPWS_MAN_ITEMS"]) - 1));
! $GLOBALS["CNT_jobman"]["content"] .= $content;
! $i++;
! }
$GLOBALS["CNT_jobman"]["title"] = $_SESSION['translate']->it("Positions Available");
***************
*** 146,150 ****
case "sView": /* view an item chosen from search results */
$this->job = new Job($_REQUEST["JOB_id"]);
! $content = $this->job->view();
/* set display variables */
--- 163,167 ----
case "sView": /* view an item chosen from search results */
$this->job = new Job($_REQUEST["JOB_id"]);
! $content = $this->job->view(TRUE); // show continue button
/* set display variables */
|