I never thought about how to quickly copy one of the most common projects and then change it to a new group buying project?
Or when editing an old project, you want to save it as a new project instead of a new project,
Check the red part
The specific development code (not detailed) is as follows:
Modify template, Add button
Include/template/manage_team_edit.html
<Input type = "submit" value = "Save as new project" name = "commit" id = "leader-submit" class = "formbutton" style = "margin: 10px 0 0 120px; "onclick =" cloneteam () "/>
Add js to process cloneteam Functions
Function cloneteam ()
{
Document. getElementById ('-user-form'). action = "/manage/team/edit. php? Clone = 1 ″;
Document. getElementById ('-user-form'). submit ();
}
Note clone = 1
In addition, the template is modified with several hidden den contents to copy the image image1 image2 field of the old project.
<! -{If $ team ['image']}-> <span class = "hint"> <input type = 'den den 'name = "hidden_team_image" value = "{$ team ['image']} "> </span> <! -{/If}->
<! -{If $ team ['image1 ']}-> <span class = "hint"> <input type = 'den den' name = "hidden_team_image1" value = "{$ team ['image1 ']} "> </span> <! -{/If}->
<! -{If $ team ['image2']}-> <span class = "hint"> <input type = 'den den 'name = "hidden_team_image2" value = "{$ team ['image2']} "> </span> <! -{/If}->
Modify manage/team/edit. php
The original code is like this.
Now the code is like this