func (VS *Server) editStep(c *gin.Context) {
	prodID, b := VS.getIDParamFromURL(c, "id")
	if !b {
		return
	}
	indexOrder, b := VS.getIntFromHTML(c, "indexOrder", "Step")
	if !b {
		return
	}
	oldStep := VS.getStepByProductIDAndIndexOrder(c, prodID, indexOrder, "h_videos", "editStep", "oldStep := VS.getStepByProductIDAndIndexOrder")
	newStep, b := VS.getNewStep(c, oldStep.ID)
	if !b {
		return
	}

	// Here for taking the different values of the checkboxes with the same name
	tools := c.Request.MultipartForm.Value["tool"]
	materials := c.Request.MultipartForm.Value["material"]

	// Warnings
	var warnings []string
	var w string
	for i := 1; i <= 6; i++ {
		w = c.PostForm("warning" + strconv.Itoa(i))
		if w != "" {
			warnings = append(warnings, w)
		}
	}
	// Now we transform into ID the Items
	var idTools []bson.ObjectId
	for _, tool := range tools {
		idTools = append(idTools, bson.ObjectIdHex(tool))
	}
	// Now we transform into ID the materials
	var idMaterials []bson.ObjectId
	for _, mat := range materials {
		idMaterials = append(idMaterials, bson.ObjectIdHex(mat))
	}
	if VS.isTranslation(c, newStep, newStep.ID) {
		return
	}
	VS.editElementInDatabaseWithRegisterFromCentral(c, newStep, oldStep, newStep.ID, "h_videos", "editStep", "VS.editElementInDatabaseWithRegisterFromCentral")
	idservicetype, b := VS.getIDParamFromURL(c, "idservicetype")
	if !b {
		return
	}
	VS.goodFeedback(c, "videos/see-list/"+idservicetype.Hex())
}
// Saves the new information of the Step to the Database
Saves the new information of the Step to the Database
// Saves the new information of the Step to the Database
func (VS *Server) editStep(c *gin.Context) {
	prodID, b := VS.getIDParamFromURL(c, "id")
	if !b {
		return
	}
	indexOrder, b := VS.getIntFromHTML(c, "indexOrder", "Step")
	if !b {
		return
	}
	oldStep := VS.getStepByProductIDAndIndexOrder(c, prodID, indexOrder, "h_videos", "editStep", "oldStep := VS.getStepByProductIDAndIndexOrder")
	newStep, b := VS.getNewStep(c, oldStep.ID)
	if !b {
		return
	}
	tools := c.Request.MultipartForm.Value["tool"]
	materials := c.Request.MultipartForm.Value["material"]
	var warnings []string
	var w string
	for i := 1; i <= 6; i++ {
		w = c.PostForm("warning" + strconv.Itoa(i))
		if w != "" {
			warnings = append(warnings, w)
		}
	}
	var idTools []bson.ObjectId
	for _, tool := range tools {
		idTools = append(idTools, bson.ObjectIdHex(tool))
	}
	var idMaterials []bson.ObjectId
	for _, mat := range materials {
		idMaterials = append(idMaterials, bson.ObjectIdHex(mat))
	}
	if VS.isTranslation(c, newStep, newStep.ID) {
		return
	}
	VS.editElementInDatabaseWithRegisterFromCentral(c, newStep, oldStep, newStep.ID, "h_videos", "editStep", "VS.editElementInDatabaseWithRegisterFromCentral")
	idservicetype, b := VS.getIDParamFromURL(c, "idservicetype")
	if !b {
		return
	}
	VS.goodFeedback(c, "videos/see-list/"+idservicetype.Hex())
}
func ( VS * Server ) editStep ( c * gin . Context ) { prodID , b := VS . getIDParamFromURL ( c , " " ) if ! b { return } indexOrder , b := VS . getIntFromHTML ( c , " " , " " ) if ! b { return } oldStep := VS . getStepByProductIDAndIndexOrder ( c , prodID , indexOrder , " " , " " , " " ) newStep , b := VS . getNewStep ( c , oldStep . ID ) if ! b { return } tools := c . Request . MultipartForm . Value [ " " ] materials := c . Request . MultipartForm . Value [ " " ] var warnings [ ] string var w string for i := 1 ; i <= 6 ; i ++ { w = c . PostForm ( " " + strconv . Itoa ( i ) ) if w != " " { warnings = append ( warnings , w ) } } var idTools [ ] bson . ObjectId for _ , tool := range tools { idTools = append ( idTools , bson . ObjectIdHex ( tool ) ) } var idMaterials [ ] bson . ObjectId for _ , mat := range materials { idMaterials = append ( idMaterials , bson . ObjectIdHex ( mat ) ) } if VS . isTranslation ( c , newStep , newStep . ID ) { return } VS . editElementInDatabaseWithRegisterFromCentral ( c , newStep , oldStep , newStep . ID , " " , " " , " " ) idservicetype , b := VS . getIDParamFromURL ( c , " " ) if ! b { return } VS . goodFeedback ( c , " " + idservicetype . Hex ( ) ) }
Saves the new information of the Step to the Database
Saves the new information of the Step to the Database
// Here for taking the different values of the checkboxes with the same name // Warnings // Now we transform into ID the Items // Now we transform into ID the materials