/*
 * Author       : grigore
 * Generated on : 28-Feb-2022 17:05:38
 * Version      : 1.0
 */
 application "CATALOG"
 {
 	date format = "dd-MMM-yyyy"
 	time zone = "Europe/Bucharest"
 	time format = "24-hr"
	section Catalog
	{
		icon = "design-bullet-list-67"
		form fisa_inscriere
		{
			displayname = "Fisa inscriere"
			success message = "Introdus elev in catalog!"
			field alignment = left
			feature property = 32
			Section
			(
				type = section
	 			row = 1
	 			column = 0   
				width = medium
			)
			plain
			(
    			type = plaintext
				value = "<div style=\"text-align: center\"><span class=\"size\" style=\"font-size: 13px\"><br /></span></div><div style=\"text-align: center\"><span class=\"size\" style=\"font-size: 13px\"><span class=\"highlight\" style=\"background-color: rgb(255, 255, 0)\">&nbsp;FISA INSCRIERE<br /></span>&nbsp; &nbsp;<span class=\"colour\" style=\"color: rgb(0, 0, 255)\">&nbsp;CATALOG ELECTRONIC</span></span></div><div style=\"text-align: center\"><span class=\"size\" style=\"font-size: smaller\"><span class=\"highlight\" style=\"background-color: rgb(255, 255, 255)\">*datele introduse au caracter confidential&nbsp;<br /></span></span><span class=\"highlight\" style=\"background-color: rgb(255, 255, 255)\"><span class=\"size\" style=\"font-size: smaller\">si sunt folosite doar in cadrul institutiei</span></span></div><div style=\"text-align: left\">&nbsp;<br /></div><div style=\"text-align: left\">&nbsp;&nbsp;<br /></div>"
	 			row = 1
	 			column = 1   
				width = medium
			)
			Data
			(
    			type = date
				displayname = "Data absenta"
				alloweddays = 0,1,2,3,4,5,6
				private = true
	 			row = 1
	 			column = 1   
				width = 130px
			)
			NOTA
			(
    			type = text
	 			row = 1
	 			column = 1   
				width = 200px
			)
			Mesaj
			(
    			type = textarea
				displayname = "Mesaj parinte"
				height = 100px
	 			row = 1
	 			column = 1   
				width = medium
			)
			must have NUMELE_ELEVULUI
			(
    			type = text
				displayname = "NUMELE SI PRENUMELE  ELEVULUI"
	 			row = 1
	 			column = 1   
				width = 200px
			)
			CLASA
			(
				type = picklist
				maxchar = 100
				values = {"CLASA 1", "CLASA 2", "CLASA 3", "CLASA 4", "CLASA 5", "CLASA 6", "CLASA 8", "CLASA 9"}
	 			row = 1
	 			column = 1   
				width = medium
			)
			Numar_telefon
			(
    			type = phonenumber
				displayname = "Numar telefon pt. corespondenta"
    			defaultcountry="ro"
	 			row = 1
	 			column = 1   
				width = medium
				personal data = true
			)
			must have email_parinte
			(
    			type = email
				displayname = "Email parinte pt corespondenta"
	 			row = 1
	 			column = 1   
				width = 200px
			)
			Foto_elev
			(
    			type = image
				displayname = "Foto elev"
				source  = file
				aspect ratio = original
				camera = primary
				preview duration = 0
				show gallery = true
				switch camera = true
	 			row = 1
	 			column = 1   
				width = 200px
			)
			absenta
			(
    			type = textarea
				displayname = "absente"
				height = 100px
				private = true
	 			row = 1
	 			column = 1   
				width = 200px
			)
			NOTE
			(
    			type = text
	 			row = 1
	 			column = 1   
				width = medium
			)
			plain1
			(
    			type = plaintext
				value = "<div class=\"align-center\" style=\"text-align: center\">\n  ©prof. Luisian Grigore- Palatul Copiilor Botoșani \n <br> \n</div> \n<div style=\"text-align: center\" class=\"align-center\"> \n <a href=\"mailto:zizibtt@gmail.com\" target=\"_blank\" rel=\"noopener noreferrer\">zizibtt@gmail.com</a> \n <br> \n</div>"
	 			row = 1
	 			column = 1   
				width = medium
			)
	
			customize
			(
				icon = "ui-1-bold-add"
			)
			actions
			{
				on add
				{
					TRIMITE_DATELE
					(
   						type = submit
   						displayname = "TRIMITE"
					)
					reset
					(
   						type = reset
   						displayname = "Reset"
					)
				}
				on edit
				{
					modifica
					(
   						type = submit
   						displayname = "modifica"
					)
					cancel
					(
   						type = cancel
   						displayname = "Cancel"
					)
				}
			}
		}
		list view
		{
			displayName = "ELEVI"
			show all rows from fisa_inscriere    
			(
				NUMELE_ELEVULUI as "NUMELE SI PRENUMELE  ELEVULUI"
				NOTA
				absenta as "absente"
				Data as "Data absenta"
				email_parinte as "Email parinte pt corespondenta"
				Foto_elev as "Foto elev"
				NOTE
				CLASA
			)
			filters
			(
				CLASA
			)
			group by
			(
				CLASA ascending
			)
			sort by
			(
				NUMELE_ELEVULUI ascending
			)
			options
			(
				icon = "design-bullet-list-67"
	 		)
			quickview
			(
				layout
				(
		 			customlayouts
	     			(
		 				template
		 				(
		 	  				displayname="Custom Layout 1"
		 	  				content="<panel \n >\n	<pr \n			width='fill'\n		height='fill'\n>\n	<pc \n		padding = '17px'\n	bgColor = '#FFFFFF'\n\n		width = '100%'\n		hAlign = 'center'\n		vAlign = 'middle'\n>\n	<pr \n			width='auto'\n		height='auto'\n>\n	<pc \n	\n>\n	\n</pc>\n</pr>\n</pc>\n</pr>\n</panel>"
		    			)
	     			)
		 			type = -1
					datablock1
					(
			 			layout type = -1
		     			title = "Overview"
						fields
						(
							NUMELE_ELEVULUI as "NUMELE SI PRENUMELE  ELEVULUI"
							absenta as "absente"
							NOTE
							email_parinte as "Email parinte pt corespondenta"
							Foto_elev as "Foto elev"
						)
					)
				)

				menu
    			(
    	 			header
    	 			(
    		 			Edit 
    		 			Duplicate 
    		 			Delete 
    		 			Add 
    		 			Print 
    		 			Import 
    		 			Export 
    	 			)
							record
							(
								Edit   	   
								Duplicate   	   
								Print   	   
								Delete   	   
    						)
    			)
    			action
    			(
							on click
							(
								View Record   	   
    						)
							on right click
							(
								Edit   	   
								Delete   	   
								Duplicate   	   
								Print   	   
								View Record   	   
    						)
     			)
			)
			detailview
			(
				layout
				(
		 			type = 1
					datablock1
					(
			 			layout type = -2
		     			title = "Overview"
						fields
						(
							NUMELE_ELEVULUI as "NUMELE SI PRENUMELE  ELEVULUI"
							NOTA
							Data as "Data absenta"
							NOTE
							absenta as "absente"
							email_parinte as "Email parinte pt corespondenta"
							Foto_elev as "Foto elev"
						)
					)
				)

				menu
    			(
    	 			header
    	 			(
    		 			Edit 
    		 			Duplicate 
    		 			Print 
    		 			Delete 
    	 			)
    			)
			)
		}
	}




		workflow
		{
		form
		{
			Send_Email_Form_Propertie as "Send Email - Form Properties"
			{
				type =  presuccess
				form = fisa_inscriere
				on start
				{
					actions 
					{
						sendmail
						(
							from : "zoho.adminuserid"
							to : email_parinte
							subject : "Elevul ${NUMELE_ELEVULUI} a fost inscris in catalogul electronic"
							message : "<div><i>&nbsp;Elevul <b>${NUMELE_ELEVULUI} </b>a fost inscris in catalogul electronic.</i><br></div><div><br></div><div><i>Datele introduse :</i><i><br></i></div><div><i>Numele si prenumele: ${NUMELE_ELEVULUI} ;</i><i><br></i></div><div><i>Clasa :${CLASA} ;</i><i><br></i></div><div><i>Adresa email:&nbsp;</i><i>${email_parinte} ;</i><br></div><div><i>Telefon :&nbsp;</i><br></div><div><br></div><div><span style=\"font-size:smaller\" class=\"size\"><span style=\"background-color:rgb(255, 255, 255)\" class=\"highlight\">*datele introduse au caracter confidential&nbsp;<br></span></span><span style=\"background-color:rgb(255, 255, 255)\" class=\"highlight\"><span style=\"font-size:smaller\" class=\"size\">si sunt folosite doar in cadrul institutiei</span></span><br></div>"
						)
					}
				}
			}
			Create_record_scripts1 as "Create record scripts"
			{
				type =  form
				form = fisa_inscriere
				record event = on add

				on load
				{
					actions 
					{
						custom deluge script
						(
											hide Data;
										hide absenta;
										hide NOTA;
										hide NOTE;
										hide Mesaj;
						)
					}
				}

			}
			Edit_record_scripts1 as "adauga absenta"
			{
				type =  form
				form = fisa_inscriere
				record event = on edit

				on update of Data
				{
					actions 
					{
						custom deluge script
						(
											input.absenta = input.absenta + input.Data + ",     ";
						)
					}
				}

			}
			trimite_bulk as "trimite bulk"
			{
				type =  form
				form = fisa_inscriere
				record event = on edit

				on update of Data
				{
					actions 
					{
						custom deluge script
						(
											sendmail
										[
											from :zoho.adminuserid
											to :input.email_parinte
											subject :"Elevul " + input.NUMELE_ELEVULUI + " a absentat de la ora "
											message :"<div>&nbsp; &nbsp;Elevul&nbsp; " + input.NUMELE_ELEVULUI + "a lipsit în ziua " + input.Data + " de la ora. Mai are absențe în zilele&nbsp" + input.absenta + ".<br></div><div>&nbsp; &nbsp;Vă rugăm să luati legătura prin reply la acest email pentru clarificarea situației.<br></div><div>&nbsp; "
										]
						)
					}
				}

			}
			adauga_nota as "adauga nota"
			{
				type =  form
				form = fisa_inscriere
				record event = on edit

				on update of NOTA
				{
					actions 
					{
						custom deluge script
						(
											input.NOTE = input.NOTE + input.NOTA + " /" + zoho.currentdate + ",   ";
						)
					}
					actions 
					{
						custom deluge script
						(
											sendmail
										[
											from :zoho.adminuserid
											to :input.email_parinte
											subject :"Elevul " + input.NUMELE_ELEVULUI + " a luat notă"
											message :"<div>&nbsp; &nbsp;Elevul&nbsp; " + input.NUMELE_ELEVULUI + " a luat nota " + input.NOTA + " la ora. Mai are următoarele note :&nbsp" + input.NOTE + ".<br></div><div>&nbsp; &nbsp;Dacă aveti nelămuriri, vă rugăm să luati legătura prin reply la acest email.<br></div><div>&nbsp;"
										]
						)
					}
				}

			}
			mesaj_parinte as "mesaj parinte"
			{
				type =  form
				form = fisa_inscriere
				record event = on edit

				on update of Mesaj
				{
					actions 
					{
						custom deluge script
						(
											sendmail
										[
											from :zoho.adminuserid
											to :input.email_parinte
											subject :"Elevul " + input.NUMELE_ELEVULUI + ". Notificare "
											message :input.Mesaj + ".<br></div><div>&nbsp; &nbsp;Dacă este necesar, luati legătura prin reply la acest email.<br></div><div>&nbsp; "
										]
						)
					}
				}

			}
		}





	}
	share_settings
	{
			"Administrator"
			{
				name = "Administrator"
				type = Users_Permissions
				permissions = {Chat:true, Predefined:true, ApiAccess:true, PIIAccess:true, ePHIAccess:true}
				description = "This profile will have all the permissions.\n"
			}
			"User"
			{
				name = "User"
				type = Users_Permissions
				permissions = {Chat:false, Predefined:true, ApiAccess:true, PIIAccess:true, ePHIAccess:true}
				description = "This profile only have add and view permission.\n"
			}
			"Member"
			{
				name = "Member"
				type = Users_Permissions
				permissions = {Chat:false, Predefined:true, ApiAccess:true, PIIAccess:true, ePHIAccess:true}
				description = "This profile will not have administrative permissions.\n"
			}
			roles
			{
				"CEO"
				{
					description = "User belonging to this role can access data of all other users."
					"Manager"
					{
						description = "Users belonging to this role cannot see admin role users data."
						"Employee"
						{
							description = "Reports to Manager"
						}
					}
				}
			}
			role Hierarchy = {fisa_inscriere}
	}

	customize
	{
		
		layout = "pane left"
		color = "green"
		base theme = "headerimage"
		new theme = 1
		new theme color = 1
		icons = true
		icons style = outline
	}


	phone
	{
		section  Catalog
		{
			form  fisa_inscriere
			{
				layout = auto
			}
			list view
			{
				quickview
				(
					layout
					(
		 				type = 9
						datablock1
						(
			 				layout type = 31
		     				title = "Overview"
							fields
							(
								NUMELE_ELEVULUI as "NUMELE SI PRENUMELE  ELEVULUI"
								NOTE
								absenta as "absente"
							)
						)
					)

					menu
    				(
    	 				header
    	 				(
    		 				Edit 
    		 				Duplicate 
    		 				Delete 
    		 				Add 
    		 				Print 
    		 				Import 
    		 				Export 
    	 				)
									record
									(
										Edit   	   
										Duplicate   	   
										Print   	   
										Delete   	   
    								)
    				)
    				action
    				(
									on tap
									(
										View Record   	   
    								)
									on long press
									(
										Edit   	   
										Delete   	   
										Duplicate   	   
										Print   	   
										View Record   	   
    								)
     				)
				)
				detailview
				(
					layout
					(
		 				type = 1
						datablock1
						(
			 				layout type = -2
		     				title = "Overview"
							fields
							(
								NUMELE_ELEVULUI as "NUMELE SI PRENUMELE  ELEVULUI"
								NOTA
								Data as "Data absenta"
								NOTE
								absenta as "absente"
								email_parinte as "Email parinte pt corespondenta"
								Foto_elev as "Foto elev"
							)
						)
					)

					menu
    				(
    	 				header
    	 				(
    		 				Edit 
    		 				Duplicate 
    		 				Print 
    		 				Delete 
    	 				)
    				)
				)
			}
		}
		customize
		{
			colour = blue
        	layout = slidingpane
		 	icons style = outline
		}
	}
	
}