[ Index ] |
|
Code source de eZ Publish 3.9.0 |
1 <?php 2 // 3 // Created on: <16-Apr-2002 11:00:12 amos> 4 // 5 // SOFTWARE NAME: eZ publish 6 // SOFTWARE RELEASE: 3.9.0 7 // BUILD VERSION: 17785 8 // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS 9 // SOFTWARE LICENSE: GNU General Public License v2.0 10 // NOTICE: > 11 // This program is free software; you can redistribute it and/or 12 // modify it under the terms of version 2.0 of the GNU General 13 // Public License as published by the Free Software Foundation. 14 // 15 // This program is distributed in the hope that it will be useful, 16 // but WITHOUT ANY WARRANTY; without even the implied warranty of 17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 // GNU General Public License for more details. 19 // 20 // You should have received a copy of version 2.0 of the GNU General 21 // Public License along with this program; if not, write to the Free 22 // Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 23 // MA 02110-1301, USA. 24 // 25 // 26 27 include_once ( "kernel/classes/ezworkflowgroup.php" ); 28 include_once ( "kernel/classes/ezworkflowgrouplink.php" ); 29 include_once ( "lib/ezutils/classes/ezhttptool.php" ); 30 include_once ( "lib/ezutils/classes/ezhttppersistence.php" ); 31 32 $Module =& $Params["Module"]; 33 if ( isset( $Params["WorkflowGroupID"] ) ) 34 $WorkflowGroupID = $Params["WorkflowGroupID"]; 35 else 36 $WorkflowGroupID = false; 37 38 // include_once( "lib/ezutils/classes/ezexecutionstack.php" ); 39 // $execStack =& eZExecutionStack::instance(); 40 // $execStack->addEntry( $Module->functionURI( "groupedit" ) . "/" . $WorkflowGroupID, 41 // $Module->attribute( "name" ), "groupedit" ); 42 43 if ( is_numeric( $WorkflowGroupID ) ) 44 { 45 $workflowGroup = eZWorkflowGroup::fetch( $WorkflowGroupID, true ); 46 } 47 else 48 { 49 include_once ( "kernel/classes/datatypes/ezuser/ezuser.php" ); 50 $user =& eZUser::currentUser(); 51 $user_id = $user->attribute( "contentobject_id" ); 52 $workflowGroup = eZWorkflowGroup::create( $user_id ); 53 $workflowGroup->setAttribute( "name", ezi18n( 'kernel/workflow/groupedit', "New WorkflowGroup" ) ); 54 $WorkflowGroupID = $workflowGroup->attribute( "id" ); 55 } 56 57 //$assignedWorkflows =& $workflowGroup->fetchWorkflowList(); 58 //$isRemoveTried = false; 59 60 $http =& eZHttpTool::instance(); 61 if ( $http->hasPostVariable( "DiscardButton" ) ) 62 { 63 $Module->redirectTo( $Module->functionURI( "grouplist" ) ); 64 return; 65 } 66 67 // Validate input 68 include_once ( "lib/ezutils/classes/ezinputvalidator.php" ); 69 $requireFixup = false; 70 // Apply HTTP POST variables 71 eZHttpPersistence::fetch( "WorkflowGroup", eZWorkflowGroup::definition(), 72 $workflowGroup, $http, false ); 73 74 // Set new modification date 75 $date_time = time(); 76 $workflowGroup->setAttribute( "modified", $date_time ); 77 include_once ( "kernel/classes/datatypes/ezuser/ezuser.php" ); 78 $user =& eZUser::currentUser(); 79 $user_id = $user->attribute( "contentobject_id" ); 80 $workflowGroup->setAttribute( "modifier_id", $user_id ); 81 82 // Discard existing events, workflow version 1 and store version 0 83 if ( $http->hasPostVariable( "StoreButton" ) ) 84 { 85 if ( $http->hasPostVariable( "WorkflowGroup_name" ) ) 86 { 87 $name = $http->postVariable( "WorkflowGroup_name" ); 88 } 89 $workflowGroup->setAttribute( "name", $name ); 90 // Set new modification date 91 include_once ( "lib/ezlocale/classes/ezdatetime.php" ); 92 $date_time = time(); 93 $workflowGroup->setAttribute( "modified", $date_time ); 94 include_once ( "kernel/classes/datatypes/ezuser/ezuser.php" ); 95 $user =& eZUser::currentUser(); 96 $user_id = $user->attribute( "contentobject_id" ); 97 $workflowGroup->setAttribute( "modifier_id", $user_id ); 98 $workflowGroup->store(); 99 $Module->redirectTo( $Module->functionURI( 'grouplist' ) ); 100 return; 101 } 102 103 $Module->setTitle( ezi18n( 'kernel/workflow', 'Edit workflow group' ) . ' ' . 104 $workflowGroup->attribute( "name" ) ); 105 106 // Template handling 107 include_once ( "kernel/common/template.php" ); 108 $tpl =& templateInit(); 109 110 $res =& eZTemplateDesignResource::instance(); 111 $res->setKeys( array( array( "workflow_group", $workflowGroup->attribute( "id" ) ) ) ); // WorkflowGroup ID 112 113 $tpl->setVariable( "http", $http ); 114 $tpl->setVariable( "require_fixup", $requireFixup ); 115 $tpl->setVariable( "module", $Module ); 116 $tpl->setVariable( "workflow_group", $workflowGroup ); 117 //$tpl->setVariable( "assigned_workflow_list", $assignedWorkflows ); 118 119 $Result = array(); 120 $Result['content'] =& $tpl->fetch( "design:workflow/groupedit.tpl" ); 121 $Result['path'] = array( array( 'text' => ezi18n( 'kernel/workflow', 'Workflow' ), 122 'url' => false ), 123 array( 'text' => ezi18n( 'kernel/workflow', 'Group edit' ), 124 'url' => false ) ); 125 126 127 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sat Feb 24 10:30:04 2007 | par Balluche grâce à PHPXref 0.7 |