From: <gbr...@us...> - 2004-01-06 20:27:31
|
Update of /cvsroot/phpwebsite-comm/modules/staffman/class In directory sc8-pr-cvs1:/tmp/cvs-serv25928/class Modified Files: staff.php staffmanager.php Log Message: Prepare for v1.3 release Index: staff.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/staffman/class/staff.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** staff.php 30 Jul 2003 22:44:50 -0000 1.2 --- staff.php 6 Jan 2004 20:26:55 -0000 1.3 *************** *** 19,22 **** --- 19,31 ---- */ + /* Make change required for 0.9.3-2 and above */ + if ($GLOBALS["core"]->version > "0.9.3-1") { + require_once(PHPWS_SOURCE_DIR . "core/Item.php"); + require_once(PHPWS_SOURCE_DIR . "core/Template.php"); + require_once(PHPWS_SOURCE_DIR . "core/EZform.php"); + require_once(PHPWS_SOURCE_DIR . "core/Text.php"); + require_once(PHPWS_SOURCE_DIR . "core/Error.php"); + } + class staffmember extends PHPWS_Item { *************** *** 115,119 **** $tags["TITLE"] = $_SESSION["translate"]->it("Add Staff Listing"); } ! $content = $GLOBALS["core"]->processTemplate($tags, "staffman", "back.tpl"); // Set up the edit form -- must be on a separate template or there is mixup with {START_FORM} etc. --- 124,132 ---- $tags["TITLE"] = $_SESSION["translate"]->it("Add Staff Listing"); } ! if ($GLOBALS["core"]->version < "0.9.3-2") { ! $content = $GLOBALS["core"]->processTemplate($tags, "staffman", "back.tpl"); ! } else { ! $content = PHPWS_Template::processTemplate($tags, "staffman", "back.tpl"); ! } // Set up the edit form -- must be on a separate template or there is mixup with {START_FORM} etc. *************** *** 179,185 **** $tags["PHOTO"] = $this->_photo; // just get filename $tags["PHOTO_REMOVE_LABEL"] = $_SESSION['translate']->it("Remove Photo"); ! $content .= $GLOBALS["core"]->processTemplate($tags, "staffman", "editphoto.tpl"); } else { ! $content .= $GLOBALS["core"]->processTemplate($tags, "staffman", "edit.tpl"); } return $content; --- 192,206 ---- $tags["PHOTO"] = $this->_photo; // just get filename $tags["PHOTO_REMOVE_LABEL"] = $_SESSION['translate']->it("Remove Photo"); ! if ($GLOBALS["core"]->version < "0.9.3-2") { ! $content .= $GLOBALS["core"]->processTemplate($tags, "staffman", "editphoto.tpl"); ! } else { ! $content .= PHPWS_Template::processTemplate($tags, "staffman", "editphoto.tpl"); ! } } else { ! if ($GLOBALS["core"]->version < "0.9.3-2") { ! $content .= $GLOBALS["core"]->processTemplate($tags, "staffman", "edit.tpl"); ! } else { ! $content .= PHPWS_Template::processTemplate($tags, "staffman", "edit.tpl"); ! } } return $content; *************** *** 240,245 **** $tags["PHOTO"] = $this->_photo; ! $content .= $GLOBALS["core"]->processTemplate($tags, "staffman", "confirm.tpl"); ! } --- 261,269 ---- $tags["PHOTO"] = $this->_photo; ! if ($GLOBALS["core"]->version < "0.9.3-2") { ! $content .= $GLOBALS["core"]->processTemplate($tags, "staffman", "confirm.tpl"); ! } else { ! $content .= PHPWS_Template::processTemplate($tags, "staffman", "confirm.tpl"); ! } } *************** *** 278,284 **** if ($this->_photo) { ! $content = $GLOBALS["core"]->processTemplate($tags, "staffman", "viewphoto.tpl"); } else { ! $content = $GLOBALS["core"]->processTemplate($tags, "staffman", "view.tpl"); } return $content; --- 302,316 ---- if ($this->_photo) { ! if ($GLOBALS["core"]->version < "0.9.3-2") { ! $content = $GLOBALS["core"]->processTemplate($tags, "staffman", "viewphoto.tpl"); ! } else { ! $content = PHPWS_Template::processTemplate($tags, "staffman", "viewphoto.tpl"); ! } } else { ! if ($GLOBALS["core"]->version < "0.9.3-2") { ! $content = $GLOBALS["core"]->processTemplate($tags, "staffman", "view.tpl"); ! } else { ! $content = PHPWS_Template::processTemplate($tags, "staffman", "view.tpl"); ! } } return $content; *************** *** 443,447 **** $tags = $form->getTemplate(); $tags["MESSAGE"] = $_SESSION["translate"]->it($message); ! $content = $GLOBALS["core"]->processTemplate($tags, "staffman", "continue.tpl"); return $content; --- 475,483 ---- $tags = $form->getTemplate(); $tags["MESSAGE"] = $_SESSION["translate"]->it($message); ! if ($GLOBALS["core"]->version < "0.9.3-2") { ! $content = $GLOBALS["core"]->processTemplate($tags, "staffman", "continue.tpl"); ! } else { ! $content = PHPWS_Template::processTemplate($tags, "staffman", "continue.tpl"); ! } return $content; Index: staffmanager.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/staffman/class/staffmanager.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** staffmanager.php 20 Sep 2003 20:40:49 -0000 1.5 --- staffmanager.php 6 Jan 2004 20:26:55 -0000 1.6 *************** *** 20,24 **** */ ! class STAFF_ListManager extends PHPWS_Manager { /** --- 20,30 ---- */ ! /* Make change required for 0.9.3-2 and above */ ! if ($GLOBALS["core"]->version > "0.9.3-1") { ! require_once(PHPWS_SOURCE_DIR . "core/Manager.php"); ! require_once(PHPWS_SOURCE_DIR . "core/Template.php"); ! } ! ! class STAFF_ListManager extends PHPWS_Manager { /** *************** *** 63,67 **** $tags["VIEW_ALL_HELP"] = $_SESSION['OBJ_help']->show_link("staffman", "smViewAll"); /* and process the template to produce the menu */ ! $content = $GLOBALS["core"]->processTemplate($tags, "staffman", "amenu.tpl"); /* add admin form of list */ $content .= $this->getList("admin", $_SESSION['translate']->it("Listing Staffmembers")); --- 69,77 ---- $tags["VIEW_ALL_HELP"] = $_SESSION['OBJ_help']->show_link("staffman", "smViewAll"); /* and process the template to produce the menu */ ! if ($GLOBALS["core"]->version < "0.9.3-2") { ! $content = $GLOBALS["core"]->processTemplate($tags, "staffman", "amenu.tpl"); ! } else { ! $content = PHPWS_Template::processTemplate($tags, "staffman", "amenu.tpl"); ! } /* add admin form of list */ $content .= $this->getList("admin", $_SESSION['translate']->it("Listing Staffmembers")); *************** *** 71,75 **** $tags["VIEW_ALL_LABEL"] = $_SESSION['translate']->it("View All"); $tags["VIEW_ALL_HELP"] = $_SESSION['OBJ_help']->show_link("staffman", "smViewAll"); ! $content = $GLOBALS["core"]->processTemplate($tags, "staffman", "umenu.tpl"); $content .= $this->getList("user", $_SESSION['translate']->it("Listing Staffmembers")); } --- 81,89 ---- $tags["VIEW_ALL_LABEL"] = $_SESSION['translate']->it("View All"); $tags["VIEW_ALL_HELP"] = $_SESSION['OBJ_help']->show_link("staffman", "smViewAll"); ! if ($GLOBALS["core"]->version < "0.9.3-2") { ! $content = $GLOBALS["core"]->processTemplate($tags, "staffman", "umenu.tpl"); ! } else { ! $content = PHPWS_Template::processTemplate($tags, "staffman", "umenu.tpl"); ! } $content .= $this->getList("user", $_SESSION['translate']->it("Listing Staffmembers")); } *************** *** 88,91 **** --- 102,106 ---- * @author George Brackett <gbr...@NO...> */ + function _edit() { // warn only one edit at a time *************** *** 138,150 **** function _view() { ! /* PHPWS_MAN_ITEMS[0] contains the an array of staffmember ids */ $GLOBALS["CNT_staffman"]["content"] = ""; ! // ask for a continue button only for the last id ! $i = 0; ! foreach($_REQUEST["PHPWS_MAN_ITEMS"] as $staffid) { ! $this->staffmember = new staffmember($staffid); ! $content = $this->staffmember->view($i == (sizeof($_REQUEST["PHPWS_MAN_ITEMS"]) - 1)); ! $GLOBALS["CNT_staffman"]["content"] .= $content; ! $i++; } $GLOBALS["CNT_staffman"]["title"] = $_SESSION['translate']->it("Staff Listing"); --- 153,172 ---- function _view() { ! /* PHPWS_MAN_ITEMS[0] contains an array of staffmember ids */ $GLOBALS["CNT_staffman"]["content"] = ""; ! if (isset($_REQUEST["PHPWS_MAN_ITEMS"][0])) { //if list is not empty ! // ask for a continue button only for the last id ! $i = 0; ! foreach($_REQUEST["PHPWS_MAN_ITEMS"] as $staffid) { ! $this->staffmember = new staffmember($staffid); ! $content = $this->staffmember->view($i == (sizeof($_REQUEST["PHPWS_MAN_ITEMS"]) - 1)); ! $GLOBALS["CNT_staffman"]["content"] .= $content; ! $i++; ! } ! } else { //empty list ! $content = "There are no items in the current list.<br />"; ! $this->staffmember = new staffmember(); ! $content .= $this->staffmember->view(TRUE); //display continue button ! $GLOBALS["CNT_staffman"]["content"] = $content; } $GLOBALS["CNT_staffman"]["title"] = $_SESSION['translate']->it("Staff Listing"); *************** *** 199,203 **** * Searches the list of positions using the mod/search module * Configuration for the search appears in boost/install.php, where ! * this module is registered with the search module. * This function is called by the search module itself, from an accessory block. * --- 221,226 ---- * Searches the list of positions using the mod/search module * Configuration for the search appears in boost/install.php, where ! * this module is registered with the search module. Also appears in ! * conf/search.php for use by phpWS versions > 0.9.3-2. * This function is called by the search module itself, from an accessory block. * |