Przeglądaj źródła

- Put back support of templates
- Make sure that unwanted parameters cannot be set when creating the ticket

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3058 a333f486-631f-4898-b8df-5754b55c2be0

dflaven 11 lat temu
rodzic
commit
1bb761211c
1 zmienionych plików z 7 dodań i 1 usunięć
  1. 7 1
      portal/index.php

+ 7 - 1
portal/index.php

@@ -536,6 +536,10 @@ EOF
 				}
 			}
 		}
+		if (isset($aParameters['template_id']) && ($aParameters['template_id'] != 0))
+		{
+			$oP->add("<input type=\"hidden\" name=\"attr_template_id\" value=\"{$aParameters['template_id']}\">");
+		}
 
 		$oAttPlugin = new AttachmentPlugIn();
 		$oAttPlugin->OnDisplayRelations($oRequest, $oP, true /* edit */);
@@ -610,9 +614,11 @@ function DoCreateRequest($oP, $oUserOrg)
 
 	$sClass = ComputeClass($oServiceSubCategory->GetKey());
 	$oRequest = MetaModel::NewObject($sClass);
+	$aAttList = array_merge(explode(',', GetConstant($sClass, 'FORM_ATTRIBUTES')), array('service_id', 'servicesubcategory_id'));
+	$oRequest->UpdateObjectFromPostedForm('' /* form prefix */, $aAttList);
 	$oRequest->Set('org_id', $oUserOrg->GetKey());
 	$oRequest->Set('caller_id', UserRights::GetContactId());
-	$oRequest->UpdateObjectFromPostedForm();
+
 	if (isset($aParameters['moreinfo']))
 	{
 		// There is a template, insert it into the description