Documentation is available at basic_model_createfuture.php
1 <?php
2 /**
3 * @author Jan H. Andersen <jha@ipwsystems.dk>
4 * @author Martin R. Larsen <mrl@ipwsystems.dk>
5 * @copyright {@link http://www.ipwsystems.dk/ IPW Systems a.s}
6 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
7 * @package METAjour
8 * @subpackage model
9 * $Id: basic_model_createfuture.php,v 1.1 2005/02/07 09:58:03 jan Exp $
10 */
11
12 require_once('basic_model.php');
13
14 class basic_model_createfuture extends basic_model {
15
16 function model() {
17 foreach($this->objectid as $curid) {
18 $oldobject = owRead($curid);
19 if (!$oldobject->hasFutureRevision()) {
20 /* allow only one future revision per object */
21 $obj = owNew($this->otype);
22 $obj->createObject($oldobject->elements[0],$oldobject->getParentId());
23 $obj->setFutureRevisionOf($curid);
24 $obj->setApproved(false);
25 $id = $obj->getObjectId();
26
27 $childs = $oldobject->getChilds();
28 foreach ($childs as $order) {
29 $oldsectionobj = owRead($order);
30 $newsectionobj = owNew($oldsectionobj->getType());
31 $newsectionobj->createObject($oldsectionobj->elements[0],$id);
32 }
33 $this->userhandler->setObjectIdStack($id);
34 }
35 }
36 }
37 }
38
39 ?>
Documentation generated on Thu, 9 Jun 2005 06:51:08 +0200 by phpDocumentor 1.2.3