func (VS *Server) newSyncExport(c *gin.Context) {
	VS.loadingContent(c)
	villageID, b := VS.getIDParamFromURL(c, "id")
	if !b {
		return
	}
	village := VS.getVillageByID(c, villageID, "h_settings", "newSync", "village := VS.getVillageByID(c, villageID")
	sync := Synchronization{
		ID:                bson.NewObjectId(),
		Date:              getTime(),
		IDVillageReceiver: villageID,
		IDVillageEmitter:  VS.getLocalVillage(c, "h_settings", "newSync", "IDVillageEmitter: VS.getLocalVillage").ID,
		IDAdmin:           VS.getUserFomCookie(c, "h_settings", "newSync", "AdminID:   VS.getUserFomCookie").ID,
		IsDone:            false,
	}
	if len(VS.getAllAuditsFromLastSynchronization(c, village.ID, sync.ID, "h_settings", "newSync", "audits := VS.getAllAuditsFromLastSynchronization")) == 0 {
		VS.wrongFeedback(c, "There is no new information to sync")
		return
	}

	VS.addElementToDatabaseWithRegister(c, sync, sync.ID, VS.getLocalVillage(c, "h_settings", "newSync", "VS.getLocalVillage").ID, "h_settings", "newSync", "addElementToDatabaseWithRegister)")
	_, _, b = VS.createDataBaseForSync(c, village, sync.ID)
	if !b {
		return
	}
	VS.goodFeedback(c, "settings/exports")
}
// This handler exports a new DataBase to be Sync with the village chosen
This handler exports a new DataBase to be Sync with the village chosen
// This handler exports a new DataBase to be Sync with the village chosen
func (VS *Server) newSyncExport(c *gin.Context) {
	VS.loadingContent(c)
	villageID, b := VS.getIDParamFromURL(c, "id")
	if !b {
		return
	}
	village := VS.getVillageByID(c, villageID, "h_settings", "newSync", "village := VS.getVillageByID(c, villageID")
	sync := Synchronization{
		ID:                bson.NewObjectId(),
		Date:              getTime(),
		IDVillageReceiver: villageID,
		IDVillageEmitter:  VS.getLocalVillage(c, "h_settings", "newSync", "IDVillageEmitter: VS.getLocalVillage").ID,
		IDAdmin:           VS.getUserFomCookie(c, "h_settings", "newSync", "AdminID:   VS.getUserFomCookie").ID,
		IsDone:            false,
	}
	if len(VS.getAllAuditsFromLastSynchronization(c, village.ID, sync.ID, "h_settings", "newSync", "audits := VS.getAllAuditsFromLastSynchronization")) == 0 {
		VS.wrongFeedback(c, "There is no new information to sync")
		return
	}
	VS.addElementToDatabaseWithRegister(c, sync, sync.ID, VS.getLocalVillage(c, "h_settings", "newSync", "VS.getLocalVillage").ID, "h_settings", "newSync", "addElementToDatabaseWithRegister)")
	_, _, b = VS.createDataBaseForSync(c, village, sync.ID)
	if !b {
		return
	}
	VS.goodFeedback(c, "settings/exports")
}
func ( VS * Server ) newSyncExport ( c * gin . Context ) { VS . loadingContent ( c ) villageID , b := VS . getIDParamFromURL ( c , " " ) if ! b { return } village := VS . getVillageByID ( c , villageID , " " , " " , " " ) sync := Synchronization { ID : bson . NewObjectId ( ) , Date : getTime ( ) , IDVillageReceiver : villageID , IDVillageEmitter : VS . getLocalVillage ( c , " " , " " , " " ) . ID , IDAdmin : VS . getUserFomCookie ( c , " " , " " , " " ) . ID , IsDone : false , } if len ( VS . getAllAuditsFromLastSynchronization ( c , village . ID , sync . ID , " " , " " , " " ) ) == 0 { VS . wrongFeedback ( c , " " ) return } VS . addElementToDatabaseWithRegister ( c , sync , sync . ID , VS . getLocalVillage ( c , " " , " " , " " ) . ID , " " , " " , " " ) _ , _ , b = VS . createDataBaseForSync ( c , village , sync . ID ) if ! b { return } VS . goodFeedback ( c , " " ) }
This handler exports a new DataBase to be Sync with the village chosen
This handler exports a new DataBase to be Sync with the village chosen