diff --git a/.gitignore b/.gitignore index 238f10ebff..61fd6e62dd 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ vendor composer.lock node_modules npm-debug.log* +BuildConfig.json # Uploaded Images src/Images/Family/thumbnails diff --git a/.travis.yml b/.travis.yml index dfce56ba26..1446da984f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,7 @@ before_install: - sudo gem install sass - chmod +x ./travis-ci/*.sh - chmod +x ./scripts/*.sh + - cp BuildConfig.json.example BuildConfig.json # prepare travis ci for the build process install: @@ -51,4 +52,4 @@ deploy: script: npm run demosite on: all_branches: true - condition: "$TRAVIS_BRANCH == 'master' || $TRAVIS_BRANCH = 'develop'" \ No newline at end of file + condition: "$TRAVIS_BRANCH == 'master' || $TRAVIS_BRANCH = 'develop'" diff --git a/BuildConfig.json b/BuildConfig.json.example similarity index 100% rename from BuildConfig.json rename to BuildConfig.json.example diff --git a/Gruntfile.js b/Gruntfile.js index f48296c5dd..f64922ba7b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -92,6 +92,13 @@ module.exports = function (grunt) { flatten: true, src: ['node_modules/moment/min/*'], dest: 'src/skin/moment/' + }, + { + expand: true, + filter: 'isFile', + flatten: true, + src: ['node_modules/bootbox/bootbox.min.js'], + dest: 'src/skin/bootbox/' } ] } @@ -265,7 +272,7 @@ module.exports = function (grunt) { } ] }, - 'demo-data': { + 'demo': { options: { archive: 'target/Demo-ChurchCRM-<%= package.version %>.tar.gz', mode: "tar", diff --git a/demo/ChurchCRM-Database.sql b/demo/ChurchCRM-Database.sql index 4f743b36b8..55221064c5 100644 --- a/demo/ChurchCRM-Database.sql +++ b/demo/ChurchCRM-Database.sql @@ -137,7 +137,7 @@ CREATE TABLE `config_cfg` ( LOCK TABLES `config_cfg` WRITE; /*!40000 ALTER TABLE `config_cfg` DISABLE KEYS */; SET autocommit=0; -INSERT INTO `config_cfg` VALUES (2,'debug','1','boolean','1','Set debug mode\r\nThis may be helpful for when you\'re first setting up ChurchCRM, but you should\r\nprobably turn it off for maximum security otherwise. If you are having trouble,\r\nplease enable this so that you\'ll know what the errors are. This is especially\r\nimportant if you need to report a problem on the help forums.','General','Step5',0,NULL),(5,'sDirClassifications','1,2,4,5','text','1,2,4,5','Include only these classifications in the directory, comma seperated','General','Step4',0,NULL),(6,'sDirRoleHead','1','text','1,7','These are the family role numbers designated as head of house','General','Step4',1,NULL),(7,'sDirRoleSpouse','2','text','2','These are the family role numbers designated as spouse','General','Step4',2,NULL),(8,'sDirRoleChild','3','text','3','These are the family role numbers designated as child','General','Step4',3,NULL),(9,'sSessionTimeout','3600','number','3600','Session timeout length in seconds\rSet to zero to disable session timeouts.','General','Step2',5,NULL),(10,'aFinanceQueries','28,30,31,32','text','28','Queries for which user must have finance permissions to use:','General','Step8',10,NULL),(11,'bCSVAdminOnly','1','boolean','1','Should only administrators have access to the CSV export system and directory report?','General','Step5',11,NULL),(12,'sDefault_Pass','password','text','password','Default password for new users and those with reset passwords','General','Step2',0,NULL),(13,'sMinPasswordLength','6','number','6','Minimum length a user may set their password to','General','Step2',1,NULL),(14,'sMinPasswordChange','4','number','4','Minimum amount that a new password must differ from the old one (# of characters changed)\rSet to zero to disable this feature','General','Step2',3,NULL),(15,'sDisallowedPasswords','churchcrm,password,god,jesus,church,christian','text','churchcrm,password,god,jesus,church,christian','A comma-seperated list of disallowed (too obvious) passwords.','General','Step2',6,NULL),(16,'iMaxFailedLogins','5','number','5','Maximum number of failed logins to allow before a user account is locked.\rOnce the maximum has been reached, an administrator must re-enable the account.\rThis feature helps to protect against automated password guessing attacks.\rSet to zero to disable this feature.','General','Step2',4,NULL),(20,'iPDFOutputType','1','number','1','PDF handling mode.\r1 = Save File dialog\r2 = Open in current browser window','General','Step8',0,NULL),(21,'sDefaultCity','','text','','Default City','General','Step4',4,NULL),(22,'sDefaultState','','text','','Default State - Must be 2-letter abbreviation!','General','Step4',5,NULL),(23,'sDefaultCountry','United States','country','United States','Default Country','General','Step4',6,NULL),(24,'bEmailSend','','boolean','','If you wish to be able to send emails from within ChurchCRM. This requires\reither an SMTP server address to send from or sendmail installed in PHP.','General','Step3',0,NULL),(25,'sSendType','smtp','choice','smtp','The method for sending email. Either \"smtp\" or \"sendmail\"','General','Step3',1,'{\"Choices\":[\"smtp\",\"SendMail\"]}'),(26,'sToEmailAddress','','text','','Default account for receiving a copy of all emails','General','Step3',6,NULL),(27,'sSMTPHost','127.0.0.1:1025','text','','SMTP Server Address (mail.server.com:25)','General','Step3',2,NULL),(28,'sSMTPAuth','0','boolean','0','Does your SMTP server require auththentication (username/password)?','General','Step3',3,NULL),(29,'sSMTPUser','','text','','SMTP Username','General','Step3',4,NULL),(30,'sSMTPPass','','text','','SMTP Password','General','Step3',5,NULL),(33,'bShowFamilyData','1','boolean','1','Unavailable person info inherited from assigned family for display?\rThis option causes certain info from a person\'s assigned family record to be\rdisplayed IF the corresponding info has NOT been entered for that person. ','General','Step4',7,NULL),(36,'sGZIPname','gzip','text','gzip','','General','Step5',6,NULL),(37,'sZIPname','zip','text','zip','','General','Step5',7,NULL),(38,'sPGPname','gpg','text','gpg','','General','Step5',8,NULL),(39,'sLanguage','en_US','choice','en_US','Internationalization (I18n) support\rUS English (en_US), Italian (it_IT), French (fr_FR), and German (de_DE)','General','Step9',1,'{\"Choices\":[\"en_US\",\"de_DE\",\"en_AU\",\"en_GB\",\"es_ES\",\"fr_FR\",\"hu_HU\",\"it_IT\",\"nb_NO\",\"nl_NL\",\"pl_PL\",\"pt_BR\",\"ro_RO\",\"ru_RU\",\"se_SE\",\"sq_AL\",\"sv_SE\",\"vi_VN\",\"zh_CN\",\"zh_TW\"]}'),(40,'iFYMonth','1','number','1','First month of the fiscal year','General','Step8',1,NULL),(41,'sXML_RPC_PATH','XML/RPC.php','text','XML/RPC.php','Path to RPC.php, required for Lat/Lon address lookup','General','Step5',5,NULL),(42,'sGeocoderID','','text','','User ID for rpc.geocoder.us','General','Step6',5,NULL),(43,'sGeocoderPW','','text','','Password for rpc.geocoder.us','General','Step6',6,NULL),(44,'sGoogleMapKey','','text','','Google map API requires a unique key from https://developers.google.com/maps/documentation/javascript/get-api-key','General','Step6',0,NULL),(45,'nChurchLatitude','','number','','Latitude of the church, used to center the Google map','General','Step1',10,NULL),(46,'nChurchLongitude','','number','','Longitude of the church, used to center the Google map','General','Step1',11,NULL),(47,'bHidePersonAddress','1','boolean','1','Set true to disable entering addresses in Person Editor. Set false to enable entering addresses in Person Editor.','General','Step4',8,NULL),(48,'bHideFriendDate','','boolean','0','Set true to disable entering Friend Date in Person Editor. Set false to enable entering Friend Date in Person Editor.','General','Step4',9,NULL),(49,'bHideFamilyNewsletter','','boolean','0','Set true to disable management of newsletter subscriptions in the Family Editor.','General','Step4',10,NULL),(50,'bHideWeddingDate','','boolean','0','Set true to disable entering Wedding Date in Family Editor. Set false to enable entering Wedding Date in Family Editor.','General','Step4',11,NULL),(51,'bHideLatLon','','boolean','0','Set true to disable entering Latitude and Longitude in Family Editor. Set false to enable entering Latitude and Longitude in Family Editor. Lookups are still performed, just not displayed.','General','Step4',12,NULL),(52,'bUseDonationEnvelopes','','boolean','0','Set true to enable use of donation envelopes','General','Step8',2,NULL),(53,'sHeader','','textarea','','Enter in HTML code which will be displayed as a header at the top of each page. Be sure to close your tags! Note: You must REFRESH YOUR BROWSER A SECOND TIME to view the new header.','General','Step5',13,NULL),(54,'sISTusername','username','text','username','Intelligent Search Technolgy, Ltd. CorrectAddress Username for https://www.intelligentsearch.com/Hosted/User','General','Step6',3,NULL),(55,'sISTpassword','','text','','Intelligent Search Technolgy, Ltd. CorrectAddress Password for https://www.intelligentsearch.com/Hosted/User','General','Step6',4,NULL),(56,'bUseGoogleGeocode','1','boolean','1','Set true to use the Google geocoder. Set false to use rpc.geocoder.us.','General','Step6',1,NULL),(57,'iChecksPerDepositForm','14','number','14','Number of checks for Deposit Slip Report','General','Step8',3,NULL),(58,'bUseScannedChecks','','boolean','0','Set true to enable use of scanned checks','General','Step8',4,NULL),(64,'sDistanceUnit','miles','choice','miles','Unit used to measure distance, miles or km.','General','Step9',2,'{\"Choices\":[\"miles\",\"kilometers\"]}'),(65,'sTimeZone','America/Detroit','text','America/New_York','Time zone- see http://php.net/manual/en/timezones.php for valid choices.','General','Step1',9,NULL),(66,'sGMapIcons','red-dot,green-dot,purple,yellow-dot,blue-dot,orange,yellow,green,blue,red,pink,lightblue','text','red-dot,green-dot,purple,yellow-dot,blue-dot,orange,yellow,green,blue,red,pink,lightblue','Names of markers for Google Maps in order of classification','General','Step6',2,NULL),(67,'cfgForceUppercaseZip','','boolean','0','Make user-entered zip/postcodes UPPERCASE when saving to the database. Useful in the UK.','General','Step4',13,NULL),(72,'bEnableNonDeductible','','boolean','0','Enable non-deductible payments','General','Step8',9,NULL),(73,'sElectronicTransactionProcessor','Vanco','choice','Vanco','Electronic Transaction Processor','General','Step8',5,'{\"Choices\":[\"Vanco\",\"Authorize.NET\"]}'),(80,'sEnableSelfRegistration','','boolean','0','Set true to enable family self registration.','General','Step4',17,NULL),(100,'sPhoneFormat','(999) 999-9999','text','(999) 999-9999','','General','Step9',3,NULL),(101,'sPhoneFormatWithExt','(999) 999-9999 x99999','text','(999) 999-9999 x99999','','General','Step9',4,NULL),(102,'sDateFormatLong','yyyy-mm-dd','text','yyyy-mm-dd','','General','Step9',5,NULL),(103,'sDateFormatNoYear','DD/MM','text','DD/MM','','General','Step9',6,NULL),(104,'sDateFormatShort','yy-mm-dd','text','yy-mm-dd','','General','Step9',7,NULL),(999,'bRegistered','','boolean','0','ChurchCRM has been registered. The ChurchCRM team uses registration information to track usage. This information is kept confidential and never released or sold. If this field is true the registration option in the admin menu changes to update registration.','General','Step5',2,NULL),(1001,'leftX','20','number','20','Left Margin (1 = 1/100th inch)','ChurchInfoReport','Step7',0,NULL),(1002,'incrementY','4','number','4','Line Thickness (1 = 1/100th inch','ChurchInfoReport','Step7',1,NULL),(1003,'sChurchName','Demo Church','text','','Church Name','ChurchInfoReport','Step1',0,NULL),(1004,'sChurchAddress','123 Main St','text','','Church Address','ChurchInfoReport','Step1',1,NULL),(1005,'sChurchCity','Kansas City,','text','','Church City','ChurchInfoReport','Step1',2,NULL),(1006,'sChurchState','MO','text','','Church State','ChurchInfoReport','Step1',3,NULL),(1007,'sChurchZip','64105','text','','Church Zip','ChurchInfoReport','Step1',4,NULL),(1008,'sChurchPhone','555 123 4234','text','','Church Phone','ChurchInfoReport','Step1',6,NULL),(1009,'sChurchEmail','demo@churchcrm.io','text','','Church Email','ChurchInfoReport','Step1',7,NULL),(1010,'sHomeAreaCode','555','text','','Home area code of the church','ChurchInfoReport','Step1',8,NULL),(1011,'sTaxReport1','This letter shows our record of your payments for','textarea','This letter shows our record of your payments for','Verbage for top line of tax report. Dates will be appended to the end of this line.','ChurchInfoReport','Step7',2,NULL),(1012,'sTaxReport2','Thank you for your help in making a difference. We greatly appreciate your gift!','textarea','Thank you for your help in making a difference. We greatly appreciate your gift!','Verbage for bottom line of tax report.','ChurchInfoReport','Step7',3,NULL),(1013,'sTaxReport3','If you have any questions or corrections to make to this report, please contact the church at the above number during business hours, 9am to 4pm, M-F.','textarea','If you have any questions or corrections to make to this report, please contact the church at the above number during business hours, 9am to 4pm, M-F.','Verbage for bottom line of tax report.','ChurchInfoReport','Step7',4,NULL),(1014,'sTaxSigner','Elder Joe Smith','text','','Tax Report signer','ChurchInfoReport','Step7',5,NULL),(1015,'sReminder1','This letter shows our record of your pledge and payments for fiscal year','textarea','This letter shows our record of your pledge and payments for fiscal year','Verbage for the pledge reminder report','ChurchInfoReport','Step7',6,NULL),(1016,'sReminderSigner','Elder Joe Smith','text','','Pledge Reminder Signer','ChurchInfoReport','Step7',7,NULL),(1017,'sReminderNoPledge','Pledges: We do not have record of a pledge for from you for this fiscal year.','textarea','Pledges: We do not have record of a pledge for from you for this fiscal year.','Verbage for the pledge reminder report - No record of a pledge','ChurchInfoReport','Step7',8,NULL),(1018,'sReminderNoPayments','Payments: We do not have record of a pledge for from you for this fiscal year.','textarea','Payments: We do not have record of a pledge for from you for this fiscal year.','Verbage for the pledge reminder report - No record of payments','ChurchInfoReport','Step7',9,NULL),(1019,'sConfirm1','This letter shows the information we have in our database with respect to your family. Please review, mark-up as necessary, and return this form to the church office.','textarea','This letter shows the information we have in our database with respect to your family. Please review, mark-up as necessary, and return this form to the church office.','Verbage for the database information confirmation and correction report','ChurchInfoReport','Step7',10,NULL),(1020,'sConfirm2','Thank you very much for helping us to update this information. If you want on-line access to the church database please provide your email address and a desired password and we will send instructions.','textarea','Thank you very much for helping us to update this information. If you want on-line access to the church database please provide your email address and a desired password and we will send instructions.','Verbage for the database information confirmation and correction report','ChurchInfoReport','Step7',11,NULL),(1021,'sConfirm3','Email _____________________________________ Password ________________','textarea','Email _____________________________________ Password ________________','Verbage for the database information confirmation and correction report','ChurchInfoReport','Step7',12,NULL),(1022,'sConfirm4','[ ] I no longer want to be associated with the church (check here to be removed from our records).','textarea','[ ] I no longer want to be associated with the church (check here to be removed from our records).','Verbage for the database information confirmation and correction report','ChurchInfoReport','Step7',13,NULL),(1023,'sConfirm5','','textarea','','Verbage for the database information confirmation and correction report','ChurchInfoReport','Step7',14,NULL),(1024,'sConfirm6','','textarea','','Verbage for the database information confirmation and correction report','ChurchInfoReport','Step7',15,NULL),(1025,'sConfirmSigner','Elder Joe Smith','text','','Database information confirmation and correction report signer','ChurchInfoReport','Step7',17,NULL),(1026,'sPledgeSummary1','Summary of pledges and payments for the fiscal year','textarea','Summary of pledges and payments for the fiscal year','Verbage for the pledge summary report','ChurchInfoReport','Step7',18,NULL),(1027,'sPledgeSummary2','as of','textarea',' as of','Verbage for the pledge summary report','ChurchInfoReport','Step7',19,NULL),(1028,'sDirectoryDisclaimer1','Every effort was made to insure the accuracy of this directory. If there are any errors or omissions, please contact the church office.This directory is for the use of the people of','textarea','Every effort was made to insure the accuracy of this directory. If there are any errors or omissions, please contact the church office.\n\nThis directory is for the use of the people of','Verbage for the directory report','ChurchInfoReport','Step7',20,NULL),(1029,'sDirectoryDisclaimer2',', and the information contained in it may not be used for business or commercial purposes.','textarea',', and the information contained in it may not be used for business or commercial purposes.','Verbage for the directory report','ChurchInfoReport','Step7',21,NULL),(1030,'bDirLetterHead','../Images/church_letterhead.jpg','text','../Images/church_letterhead.jpg','Church Letterhead path and file','ChurchInfoReport','Step7',22,NULL),(1031,'sZeroGivers','This letter shows our record of your payments for','textarea','This letter shows our record of your payments for','Verbage for top line of tax report. Dates will be appended to the end of this line.','ChurchInfoReport','Step7',23,NULL),(1032,'sZeroGivers2','Thank you for your help in making a difference. We greatly appreciate your gift!','textarea','Thank you for your help in making a difference. We greatly appreciate your gift!','Verbage for bottom line of tax report.','ChurchInfoReport','Step7',24,NULL),(1033,'sZeroGivers3','If you have any questions or corrections to make to this report, please contact the church at the above number during business hours, 9am to 4pm, M-F.','textarea','If you have any questions or corrections to make to this report, please contact the church at the above number during business hours, 9am to 4pm, M-F.','Verbage for bottom line of tax report.','ChurchInfoReport','Step7',25,NULL),(1034,'sChurchChkAcctNum','111111111','text','','Church Checking Account Number','ChurchInfoReport','Step7',26,NULL),(1035,'sEnableGravatarPhotos','','boolean','0','lookup user images on Gravatar when no local image is present','General','Step4',16,NULL),(1036,'sEnableExternalBackupTarget','','boolean','0','Enable Remote Backups to Cloud Services','General','Step5',NULL,NULL),(1037,'sExternalBackupType','WebDAV','choice','','Cloud Service Type (Supported values: WebDAV, Local)','General','Step5',NULL,'{\"Choices\":[\"WebDAV\",\"Local\"]}'),(1038,'sExternalBackupEndpoint','','text','','Remote Backup Endpoint','General','Step5',NULL,NULL),(1039,'sExternalBackupUsername','','text','','Remote Backup Username','General','Step5',NULL,NULL),(1040,'sExternalBackupPassword','','text','','Remote Backup Password','General','Step5',NULL,NULL),(1041,'sExternalBackupAutoInterval','','text','','Interval in Hours for Automatic Remote Backups','General','Step5',NULL,NULL),(1042,'sLastBackupTimeStamp','','text','','Last Backup Timestamp','General','Step5',NULL,NULL),(1043,'sQBDTSettings','{\"date1\":{\"x\":\"12\",\"y\":\"42\"},\"date2X\":\"185\",\"leftX\":\"64\",\"topY\":\"7\",\"perforationY\":\"97\",\"amountOffsetX\":\"35\",\"lineItemInterval\":{\"x\":\"49\",\"y\":\"7\"},\"max\":{\"x\":\"200\",\"y\":\"140\"},\"numberOfItems\":{\"x\":\"136\",\"y\":\"68\"},\"subTotal\":{\"x\":\"197\",\"y\":\"42\"},\"topTotal\":{\"x\":\"197\",\"y\":\"68\"},\"titleX\":\"85\"}','json','{\"date1\":{\"x\":\"12\",\"y\":\"42\"},\"date2X\":\"185\",\"leftX\":\"64\",\"topY\":\"7\",\"perforationY\":\"97\",\"amountOffsetX\":\"35\",\"lineItemInterval\":{\"x\":\"49\",\"y\":\"7\"},\"max\":{\"x\":\"200\",\"y\":\"140\"},\"numberOfItems\":{\"x\":\"136\",\"y\":\"68\"},\"subTotal\":{\"x\":\"197\",\"y\":\"42\"},\"topTotal\":{\"x\":\"197\",\"y\":\"68\"},\"titleX\":\"85\"}','QuickBooks Deposit Ticket Settings','ChurchInfoReport','Step7',NULL,NULL),(1044,'sEnableIntegrityCheck','1','boolean','1','Enable Integrity Check','General','Step5',NULL,NULL),(1045,'sIntegrityCheckInterval','168','text','168','Interval in Hours for Integrity Check','General','Step5',14,NULL),(1046,'sLastIntegrityCheckTimeStamp','2017-01-15 19:40:43','text','','Last Integrity Check Timestamp','General','Step5',15,NULL),(1047,'sChurchCountry','United States','country','','Church Country','ChurchInfoReport','Step1',5,NULL),(2000,'mailChimpApiKey','','text','','see http://kb.mailchimp.com/accounts/management/about-api-keys','General','Step3',8,NULL); +INSERT INTO `config_cfg` VALUES (2,'debug','1','boolean','1','Set debug mode\r\nThis may be helpful for when you\'re first setting up ChurchCRM, but you should\r\nprobably turn it off for maximum security otherwise. If you are having trouble,\r\nplease enable this so that you\'ll know what the errors are. This is especially\r\nimportant if you need to report a problem on the help forums.','General','Step5',0,NULL),(5,'sDirClassifications','1,2,4,5','text','1,2,4,5','Include only these classifications in the directory, comma seperated','General','Step4',0,NULL),(6,'sDirRoleHead','1','text','1,7','These are the family role numbers designated as head of house','General','Step4',1,NULL),(7,'sDirRoleSpouse','2','text','2','These are the family role numbers designated as spouse','General','Step4',2,NULL),(8,'sDirRoleChild','3','text','3','These are the family role numbers designated as child','General','Step4',3,NULL),(9,'sSessionTimeout','3600','number','3600','Session timeout length in seconds\rSet to zero to disable session timeouts.','General','Step2',5,NULL),(10,'aFinanceQueries','28,30,31,32','text','28','Queries for which user must have finance permissions to use:','General','Step8',10,NULL),(11,'bCSVAdminOnly','1','boolean','1','Should only administrators have access to the CSV export system and directory report?','General','Step5',11,NULL),(12,'sDefault_Pass','password','text','password','Default password for new users and those with reset passwords','General','Step2',0,NULL),(13,'sMinPasswordLength','6','number','6','Minimum length a user may set their password to','General','Step2',1,NULL),(14,'sMinPasswordChange','4','number','4','Minimum amount that a new password must differ from the old one (# of characters changed)\rSet to zero to disable this feature','General','Step2',3,NULL),(15,'sDisallowedPasswords','churchcrm,password,god,jesus,church,christian','text','churchcrm,password,god,jesus,church,christian','A comma-seperated list of disallowed (too obvious) passwords.','General','Step2',6,NULL),(16,'iMaxFailedLogins','5','number','5','Maximum number of failed logins to allow before a user account is locked.\rOnce the maximum has been reached, an administrator must re-enable the account.\rThis feature helps to protect against automated password guessing attacks.\rSet to zero to disable this feature.','General','Step2',4,NULL),(20,'iPDFOutputType','1','number','1','PDF handling mode.\r1 = Save File dialog\r2 = Open in current browser window','General','Step8',0,NULL),(21,'sDefaultCity','','text','','Default City','General','Step4',4,NULL),(22,'sDefaultState','','text','','Default State - Must be 2-letter abbreviation!','General','Step4',5,NULL),(23,'sDefaultCountry','United States','country','United States','Default Country','General','Step4',6,NULL),(24,'bEmailSend','','boolean','','If you wish to be able to send emails from within ChurchCRM. This requires\reither an SMTP server address to send from or sendmail installed in PHP.','General','Step3',0,NULL),(25,'sSendType','smtp','choice','smtp','The method for sending email. Either \"smtp\" or \"sendmail\"','General','Step3',1,'{\"Choices\":[\"smtp\",\"SendMail\"]}'),(26,'sToEmailAddress','','text','','Default account for receiving a copy of all emails','General','Step3',6,NULL),(27,'sSMTPHost','127.0.0.1:1025','text','','SMTP Server Address (mail.server.com:25)','General','Step3',2,NULL),(28,'sSMTPAuth','0','boolean','0','Does your SMTP server require auththentication (username/password)?','General','Step3',3,NULL),(29,'sSMTPUser','','text','','SMTP Username','General','Step3',4,NULL),(30,'sSMTPPass','','text','','SMTP Password','General','Step3',5,NULL),(33,'bShowFamilyData','1','boolean','1','Unavailable person info inherited from assigned family for display?\rThis option causes certain info from a person\'s assigned family record to be\rdisplayed IF the corresponding info has NOT been entered for that person. ','General','Step4',7,NULL),(36,'sGZIPname','gzip','text','gzip','','General','Step5',6,NULL),(37,'sZIPname','zip','text','zip','','General','Step5',7,NULL),(38,'sPGPname','gpg','text','gpg','','General','Step5',8,NULL),(39,'sLanguage','en_US','choice','en_US','Internationalization (I18n) support\rUS English (en_US), Italian (it_IT), French (fr_FR), and German (de_DE)','General','Step9',1,'{\"Choices\":[\"en_US\",\"de_DE\",\"en_AU\",\"en_GB\",\"es_ES\",\"fr_FR\",\"hu_HU\",\"it_IT\",\"nb_NO\",\"nl_NL\",\"pl_PL\",\"pt_BR\",\"ro_RO\",\"ru_RU\",\"se_SE\",\"sq_AL\",\"sv_SE\",\"vi_VN\",\"zh_CN\",\"zh_TW\"]}'),(40,'iFYMonth','1','number','1','First month of the fiscal year','General','Step8',1,NULL),(41,'sXML_RPC_PATH','XML/RPC.php','text','XML/RPC.php','Path to RPC.php, required for Lat/Lon address lookup','General','Step5',5,NULL),(42,'sGeocoderID','','text','','User ID for rpc.geocoder.us','General','Step6',5,NULL),(43,'sGeocoderPW','','text','','Password for rpc.geocoder.us','General','Step6',6,NULL),(44,'sGoogleMapKey','','text','','Google map API requires a unique key from https://developers.google.com/maps/documentation/javascript/get-api-key','General','Step6',0,NULL),(45,'nChurchLatitude','','number','','Latitude of the church, used to center the Google map','General','Step1',10,NULL),(46,'nChurchLongitude','','number','','Longitude of the church, used to center the Google map','General','Step1',11,NULL),(47,'bHidePersonAddress','1','boolean','1','Set true to disable entering addresses in Person Editor. Set false to enable entering addresses in Person Editor.','General','Step4',8,NULL),(48,'bHideFriendDate','','boolean','0','Set true to disable entering Friend Date in Person Editor. Set false to enable entering Friend Date in Person Editor.','General','Step4',9,NULL),(49,'bHideFamilyNewsletter','','boolean','0','Set true to disable management of newsletter subscriptions in the Family Editor.','General','Step4',10,NULL),(50,'bHideWeddingDate','','boolean','0','Set true to disable entering Wedding Date in Family Editor. Set false to enable entering Wedding Date in Family Editor.','General','Step4',11,NULL),(51,'bHideLatLon','','boolean','0','Set true to disable entering Latitude and Longitude in Family Editor. Set false to enable entering Latitude and Longitude in Family Editor. Lookups are still performed, just not displayed.','General','Step4',12,NULL),(52,'bUseDonationEnvelopes','','boolean','0','Set true to enable use of donation envelopes','General','Step8',2,NULL),(53,'sHeader','','textarea','','Enter in HTML code which will be displayed as a header at the top of each page. Be sure to close your tags! Note: You must REFRESH YOUR BROWSER A SECOND TIME to view the new header.','General','Step5',13,NULL),(54,'sISTusername','username','text','username','Intelligent Search Technolgy, Ltd. CorrectAddress Username for https://www.intelligentsearch.com/Hosted/User','General','Step6',3,NULL),(55,'sISTpassword','','text','','Intelligent Search Technolgy, Ltd. CorrectAddress Password for https://www.intelligentsearch.com/Hosted/User','General','Step6',4,NULL),(56,'bUseGoogleGeocode','1','boolean','1','Set true to use the Google geocoder. Set false to use rpc.geocoder.us.','General','Step6',1,NULL),(57,'iChecksPerDepositForm','14','number','14','Number of checks for Deposit Slip Report','General','Step8',3,NULL),(58,'bUseScannedChecks','','boolean','0','Set true to enable use of scanned checks','General','Step8',4,NULL),(64,'sDistanceUnit','miles','choice','miles','Unit used to measure distance, miles or km.','General','Step9',2,'{\"Choices\":[\"miles\",\"kilometers\"]}'),(65,'sTimeZone','America/Detroit','text','America/New_York','Time zone- see http://php.net/manual/en/timezones.php for valid choices.','General','Step1',9,NULL),(66,'sGMapIcons','red-dot,green-dot,purple,yellow-dot,blue-dot,orange,yellow,green,blue,red,pink,lightblue','text','red-dot,green-dot,purple,yellow-dot,blue-dot,orange,yellow,green,blue,red,pink,lightblue','Names of markers for Google Maps in order of classification','General','Step6',2,NULL),(67,'cfgForceUppercaseZip','','boolean','0','Make user-entered zip/postcodes UPPERCASE when saving to the database. Useful in the UK.','General','Step4',13,NULL),(72,'bEnableNonDeductible','','boolean','0','Enable non-deductible payments','General','Step8',9,NULL),(73,'sElectronicTransactionProcessor','Vanco','choice','Vanco','Electronic Transaction Processor','General','Step8',5,'{\"Choices\":[\"Vanco\",\"Authorize.NET\"]}'),(80,'sEnableSelfRegistration','1','boolean','0','Set true to enable family self registration.','General','Step4',17,NULL),(100,'sPhoneFormat','(999) 999-9999','text','(999) 999-9999','','General','Step9',3,NULL),(101,'sPhoneFormatWithExt','(999) 999-9999 x99999','text','(999) 999-9999 x99999','','General','Step9',4,NULL),(102,'sDateFormatLong','yyyy-mm-dd','text','yyyy-mm-dd','','General','Step9',5,NULL),(103,'sDateFormatNoYear','DD/MM','text','DD/MM','','General','Step9',6,NULL),(104,'sDateFormatShort','yy-mm-dd','text','yy-mm-dd','','General','Step9',7,NULL),(999,'bRegistered','','boolean','0','ChurchCRM has been registered. The ChurchCRM team uses registration information to track usage. This information is kept confidential and never released or sold. If this field is true the registration option in the admin menu changes to update registration.','General','Step5',2,NULL),(1001,'leftX','20','number','20','Left Margin (1 = 1/100th inch)','ChurchInfoReport','Step7',0,NULL),(1002,'incrementY','4','number','4','Line Thickness (1 = 1/100th inch','ChurchInfoReport','Step7',1,NULL),(1003,'sChurchName','Demo Church','text','','Church Name','ChurchInfoReport','Step1',0,NULL),(1004,'sChurchAddress','123 Main St','text','','Church Address','ChurchInfoReport','Step1',1,NULL),(1005,'sChurchCity','Kansas City,','text','','Church City','ChurchInfoReport','Step1',2,NULL),(1006,'sChurchState','MO','text','','Church State','ChurchInfoReport','Step1',3,NULL),(1007,'sChurchZip','64105','text','','Church Zip','ChurchInfoReport','Step1',4,NULL),(1008,'sChurchPhone','555 123 4234','text','','Church Phone','ChurchInfoReport','Step1',6,NULL),(1009,'sChurchEmail','demo@churchcrm.io','text','','Church Email','ChurchInfoReport','Step1',7,NULL),(1010,'sHomeAreaCode','555','text','','Home area code of the church','ChurchInfoReport','Step1',8,NULL),(1011,'sTaxReport1','This letter shows our record of your payments for','textarea','This letter shows our record of your payments for','Verbage for top line of tax report. Dates will be appended to the end of this line.','ChurchInfoReport','Step7',2,NULL),(1012,'sTaxReport2','Thank you for your help in making a difference. We greatly appreciate your gift!','textarea','Thank you for your help in making a difference. We greatly appreciate your gift!','Verbage for bottom line of tax report.','ChurchInfoReport','Step7',3,NULL),(1013,'sTaxReport3','If you have any questions or corrections to make to this report, please contact the church at the above number during business hours, 9am to 4pm, M-F.','textarea','If you have any questions or corrections to make to this report, please contact the church at the above number during business hours, 9am to 4pm, M-F.','Verbage for bottom line of tax report.','ChurchInfoReport','Step7',4,NULL),(1014,'sTaxSigner','Elder Joe Smith','text','','Tax Report signer','ChurchInfoReport','Step7',5,NULL),(1015,'sReminder1','This letter shows our record of your pledge and payments for fiscal year','textarea','This letter shows our record of your pledge and payments for fiscal year','Verbage for the pledge reminder report','ChurchInfoReport','Step7',6,NULL),(1016,'sReminderSigner','Elder Joe Smith','text','','Pledge Reminder Signer','ChurchInfoReport','Step7',7,NULL),(1017,'sReminderNoPledge','Pledges: We do not have record of a pledge for from you for this fiscal year.','textarea','Pledges: We do not have record of a pledge for from you for this fiscal year.','Verbage for the pledge reminder report - No record of a pledge','ChurchInfoReport','Step7',8,NULL),(1018,'sReminderNoPayments','Payments: We do not have record of a pledge for from you for this fiscal year.','textarea','Payments: We do not have record of a pledge for from you for this fiscal year.','Verbage for the pledge reminder report - No record of payments','ChurchInfoReport','Step7',9,NULL),(1019,'sConfirm1','This letter shows the information we have in our database with respect to your family. Please review, mark-up as necessary, and return this form to the church office.','textarea','This letter shows the information we have in our database with respect to your family. Please review, mark-up as necessary, and return this form to the church office.','Verbage for the database information confirmation and correction report','ChurchInfoReport','Step7',10,NULL),(1020,'sConfirm2','Thank you very much for helping us to update this information. If you want on-line access to the church database please provide your email address and a desired password and we will send instructions.','textarea','Thank you very much for helping us to update this information. If you want on-line access to the church database please provide your email address and a desired password and we will send instructions.','Verbage for the database information confirmation and correction report','ChurchInfoReport','Step7',11,NULL),(1021,'sConfirm3','Email _____________________________________ Password ________________','textarea','Email _____________________________________ Password ________________','Verbage for the database information confirmation and correction report','ChurchInfoReport','Step7',12,NULL),(1022,'sConfirm4','[ ] I no longer want to be associated with the church (check here to be removed from our records).','textarea','[ ] I no longer want to be associated with the church (check here to be removed from our records).','Verbage for the database information confirmation and correction report','ChurchInfoReport','Step7',13,NULL),(1023,'sConfirm5','','textarea','','Verbage for the database information confirmation and correction report','ChurchInfoReport','Step7',14,NULL),(1024,'sConfirm6','','textarea','','Verbage for the database information confirmation and correction report','ChurchInfoReport','Step7',15,NULL),(1025,'sConfirmSigner','Elder Joe Smith','text','','Database information confirmation and correction report signer','ChurchInfoReport','Step7',17,NULL),(1026,'sPledgeSummary1','Summary of pledges and payments for the fiscal year','textarea','Summary of pledges and payments for the fiscal year','Verbage for the pledge summary report','ChurchInfoReport','Step7',18,NULL),(1027,'sPledgeSummary2','as of','textarea',' as of','Verbage for the pledge summary report','ChurchInfoReport','Step7',19,NULL),(1028,'sDirectoryDisclaimer1','Every effort was made to insure the accuracy of this directory. If there are any errors or omissions, please contact the church office.This directory is for the use of the people of','textarea','Every effort was made to insure the accuracy of this directory. If there are any errors or omissions, please contact the church office.\n\nThis directory is for the use of the people of','Verbage for the directory report','ChurchInfoReport','Step7',20,NULL),(1029,'sDirectoryDisclaimer2',', and the information contained in it may not be used for business or commercial purposes.','textarea',', and the information contained in it may not be used for business or commercial purposes.','Verbage for the directory report','ChurchInfoReport','Step7',21,NULL),(1030,'bDirLetterHead','../Images/church_letterhead.jpg','text','../Images/church_letterhead.jpg','Church Letterhead path and file','ChurchInfoReport','Step7',22,NULL),(1031,'sZeroGivers','This letter shows our record of your payments for','textarea','This letter shows our record of your payments for','Verbage for top line of tax report. Dates will be appended to the end of this line.','ChurchInfoReport','Step7',23,NULL),(1032,'sZeroGivers2','Thank you for your help in making a difference. We greatly appreciate your gift!','textarea','Thank you for your help in making a difference. We greatly appreciate your gift!','Verbage for bottom line of tax report.','ChurchInfoReport','Step7',24,NULL),(1033,'sZeroGivers3','If you have any questions or corrections to make to this report, please contact the church at the above number during business hours, 9am to 4pm, M-F.','textarea','If you have any questions or corrections to make to this report, please contact the church at the above number during business hours, 9am to 4pm, M-F.','Verbage for bottom line of tax report.','ChurchInfoReport','Step7',25,NULL),(1034,'sChurchChkAcctNum','111111111','text','','Church Checking Account Number','ChurchInfoReport','Step7',26,NULL),(1035,'sEnableGravatarPhotos','','boolean','0','lookup user images on Gravatar when no local image is present','General','Step4',16,NULL),(1036,'sEnableExternalBackupTarget','','boolean','0','Enable Remote Backups to Cloud Services','General','Step5',NULL,NULL),(1037,'sExternalBackupType','WebDAV','choice','','Cloud Service Type (Supported values: WebDAV, Local)','General','Step5',NULL,'{\"Choices\":[\"WebDAV\",\"Local\"]}'),(1038,'sExternalBackupEndpoint','','text','','Remote Backup Endpoint','General','Step5',NULL,NULL),(1039,'sExternalBackupUsername','','text','','Remote Backup Username','General','Step5',NULL,NULL),(1040,'sExternalBackupPassword','','text','','Remote Backup Password','General','Step5',NULL,NULL),(1041,'sExternalBackupAutoInterval','','text','','Interval in Hours for Automatic Remote Backups','General','Step5',NULL,NULL),(1042,'sLastBackupTimeStamp','','text','','Last Backup Timestamp','General','Step5',NULL,NULL),(1043,'sQBDTSettings','{\"date1\":{\"x\":\"12\",\"y\":\"42\"},\"date2X\":\"185\",\"leftX\":\"64\",\"topY\":\"7\",\"perforationY\":\"97\",\"amountOffsetX\":\"35\",\"lineItemInterval\":{\"x\":\"49\",\"y\":\"7\"},\"max\":{\"x\":\"200\",\"y\":\"140\"},\"numberOfItems\":{\"x\":\"136\",\"y\":\"68\"},\"subTotal\":{\"x\":\"197\",\"y\":\"42\"},\"topTotal\":{\"x\":\"197\",\"y\":\"68\"},\"titleX\":\"85\"}','json','{\"date1\":{\"x\":\"12\",\"y\":\"42\"},\"date2X\":\"185\",\"leftX\":\"64\",\"topY\":\"7\",\"perforationY\":\"97\",\"amountOffsetX\":\"35\",\"lineItemInterval\":{\"x\":\"49\",\"y\":\"7\"},\"max\":{\"x\":\"200\",\"y\":\"140\"},\"numberOfItems\":{\"x\":\"136\",\"y\":\"68\"},\"subTotal\":{\"x\":\"197\",\"y\":\"42\"},\"topTotal\":{\"x\":\"197\",\"y\":\"68\"},\"titleX\":\"85\"}','QuickBooks Deposit Ticket Settings','ChurchInfoReport','Step7',NULL,NULL),(1044,'sEnableIntegrityCheck','1','boolean','1','Enable Integrity Check','General','Step5',NULL,NULL),(1045,'sIntegrityCheckInterval','168','text','168','Interval in Hours for Integrity Check','General','Step5',14,NULL),(1046,'sLastIntegrityCheckTimeStamp','2017-01-15 19:40:43','text','','Last Integrity Check Timestamp','General','Step5',15,NULL),(1047,'sChurchCountry','United States','country','','Church Country','ChurchInfoReport','Step1',5,NULL),(2000,'mailChimpApiKey','','text','','see http://kb.mailchimp.com/accounts/management/about-api-keys','General','Step3',8,NULL); /*!40000 ALTER TABLE `config_cfg` ENABLE KEYS */; UNLOCK TABLES; COMMIT; diff --git a/locale/extract-db-locale-terms.php b/locale/extract-db-locale-terms.php index 55a2258777..5796c9807d 100644 --- a/locale/extract-db-locale-terms.php +++ b/locale/extract-db-locale-terms.php @@ -7,9 +7,7 @@ $stringFiles = []; $db = new PDO('mysql:host=localhost;dbname='.$db_name.';charset=utf8mb4', $db_username, $db_password); -$query = 'select DISTINCT cfg_tooltip as term, "" as translation, "config_cfg" as cntx from config_cfg -union all -select DISTINCT ucfg_tooltip as term, "" as translation, "userconfig_ucfg" as cntx from userconfig_ucfg +$query = 'select DISTINCT ucfg_tooltip as term, "" as translation, "userconfig_ucfg" as cntx from userconfig_ucfg union all select DISTINCT qry_Name as term, "" as translation, "query_qry" as cntx from query_qry union all @@ -40,17 +38,6 @@ file_put_contents($stringFile, "\r\n?>", FILE_APPEND); } -$stringFile = $stringsDir.'/settings-choices.php'; -file_put_contents($stringFile, "query($query) as $row) { - foreach (json_decode($row['choices'])->Choices as $choice) { - file_put_contents($stringFile, 'gettext("'.addslashes($choice)."\");\r\n", FILE_APPEND); - } -} -file_put_contents($stringFile, "\r\n?>", FILE_APPEND); - $stringFile = $stringsDir.'/settings-countries.php'; require '../src/ChurchCRM/data/Countries.php'; file_put_contents($stringFile, " - - - - - - - diff --git a/src/CartToFamily.php b/src/CartToFamily.php index 2851302759..02b3eac080 100644 --- a/src/CartToFamily.php +++ b/src/CartToFamily.php @@ -19,6 +19,8 @@ require 'Include/Config.php'; require 'Include/Functions.php'; +use ChurchCRM\dto\SystemURLs; + // Security: User must have add records permission if (!$_SESSION['bAddRecords']) { Redirect('Menu.php'); @@ -164,7 +166,7 @@ echo ''; echo ''.$count++.''; - echo "   '.FormatFullName($per_Title, $per_FirstName, $per_MiddleName, $per_LastName, $per_Suffix, 1).''; + echo "   '.FormatFullName($per_Title, $per_FirstName, $per_MiddleName, $per_LastName, $per_Suffix, 1).''; echo ''; if ($per_fam_ID == 0) { diff --git a/src/CartView.php b/src/CartView.php index 7bd422fb21..b6060fadf3 100644 --- a/src/CartView.php +++ b/src/CartView.php @@ -30,6 +30,8 @@ require 'Include/Functions.php'; require 'Include/LabelFunctions.php'; +use ChurchCRM\dto\SystemURLs; + use ChurchCRM\dto\SystemConfig; if (isset($_POST['rmEmail'])) { @@ -46,7 +48,8 @@ if (!array_key_exists('Message', $_GET)) { ?>

- @@ -91,15 +94,16 @@ - - 0) { - ?> + ?>

Cart Functions

@@ -107,22 +111,25 @@
+ ?> - + + ?> - + + ?> - +
-
@@ -224,36 +232,36 @@ function codename() '.gettext('Bulk Mail Presort').''; - echo ' '; - echo '
'; - - echo ' '.gettext('Quiet Presort').''; - echo ' '; - echo ' '.gettext('Bulk Mail Presort').''; + echo ' '; + echo '
'; + + echo ' '.gettext('Quiet Presort').''; + echo ' '; + echo '
'; + echo ' id="QuietBulkMail" value="1" '; + if (array_key_exists('bulkmailquiet', $_COOKIE) && $_COOKIE['bulkmailquiet'] && array_key_exists('buildmailpresort', $_COOKIE) && $_COOKIE['bulkmailpresort']) { + echo 'checked'; + } + echo ' >
'; - ToParentsOfCheckBox('toparents'); - LabelSelect('labeltype'); - FontSelect('labelfont'); - FontSizeSelect('labelfontsize'); - StartRowStartColumn(); - IgnoreIncompleteAddresses(); - LabelFileType(); ?> + ToParentsOfCheckBox('toparents'); + LabelSelect('labeltype'); + FontSelect('labelfont'); + FontSizeSelect('labelfontsize'); + StartRowStartColumn(); + IgnoreIncompleteAddresses(); + LabelFileType(); ?> @@ -267,14 +275,14 @@ function codename() + } ?>
-

+

.

@@ -329,7 +337,7 @@ function codename() } echo ''; - echo ''; + echo ''; echo ''; echo ''; diff --git a/src/ChurchCRM/Reports/PDF_Directory.php b/src/ChurchCRM/Reports/PDF_Directory.php index 458db51f7e..5f51a34b1f 100644 --- a/src/ChurchCRM/Reports/PDF_Directory.php +++ b/src/ChurchCRM/Reports/PDF_Directory.php @@ -53,7 +53,7 @@ public function Footer() if ($bDirUseTitlePage) { $iPageNumber--; } - $this->Cell(0, 10, gettext('Page').' '.$iPageNumber.' '.date(SystemConfig::getValue("sDateFormatShort").' g:i a', time()), 0, 0, 'C'); // in 2.6.0, create a new config for time formatting also + $this->Cell(0, 10, gettext('Page').' '.$iPageNumber.' '.date(SystemConfig::getValue("sDateTimeFormat"), time()), 0, 0, 'C'); // in 2.6.0, create a new config for time formatting also } } diff --git a/src/ChurchCRM/Service/SystemService.php b/src/ChurchCRM/Service/SystemService.php index 43592258cb..b433f541dc 100644 --- a/src/ChurchCRM/Service/SystemService.php +++ b/src/ChurchCRM/Service/SystemService.php @@ -89,7 +89,6 @@ public function restoreDatabaseFromBackup($file) FileSystemUtils::recursiveRemoveDirectory($restoreResult->backupRoot); $restoreResult->UpgradeStatus = $this->upgradeDatabaseVersion(); SQLUtils::sqlImport(SystemURLs::getDocumentRoot() . '/mysql/upgrade/rebuild_nav_menus.sql', $connection); - SQLUtils::sqlImport(SystemURLs::getDocumentRoot() . '/mysql/upgrade/update_config.sql', $connection); //When restoring a database, do NOT let the database continue to create remote backups. //This can be very troublesome for users in a testing environment. SystemConfig::setValue('sEnableExternalBackupTarget', '0'); @@ -320,7 +319,6 @@ public function upgradeDatabaseVersion() } // always rebuild the menu SQLUtils::sqlImport(SystemURLs::getDocumentRoot() . '/mysql/upgrade/rebuild_nav_menus.sql', $connection); - SQLUtils::sqlImport(SystemURLs::getDocumentRoot() . '/mysql/upgrade/update_config.sql', $connection); return 'success'; } diff --git a/src/ChurchCRM/dto/ConfigItem.php b/src/ChurchCRM/dto/ConfigItem.php new file mode 100644 index 0000000000..34503a763f --- /dev/null +++ b/src/ChurchCRM/dto/ConfigItem.php @@ -0,0 +1,115 @@ +id = $id; + $this->name = $name; + $this->type = $type; + $this->default = $default; + $this->tooltip = $tooltip; + $this->data = $data; + } + + public function getId() + { + return $this->id; + } + + public function getName() + { + return $this->name; + } + + public function setDBConfigObject($dbConfigItem) + { + $this->dbConfigItem = $dbConfigItem; + $this->value = $dbConfigItem->getValue(); + } + + public function getDBConfigObject() + { + return $this->dbConfigItem ; + } + + public function getValue() + { + if ( isset( $this->value ) ) + { + return $this->value; + } + else + { + return $this->default; + } + } + + public function getBooleanValue() + { + return boolval($this->getValue()); + } + + public function setValue($value) + { + if ( $value == $this->getDefault() ) + { + //if the value is being set to the default value + if ( isset ($this->dbConfigItem) ) //and the item exists + { + //delete the item + $this->dbConfigItem->delete(); + } + } + else + { + //if the value is being set to a non-default value + if ( ! isset ($this->dbConfigItem) ) + { + //create the item if it doesnt exist + $this->dbConfigItem = new Config(); + $this->dbConfigItem->setId($this->getId()); + $this->dbConfigItem->setName($this->getName()); + } + //set the values, and seve it + $this->dbConfigItem->setValue($value); + $this->dbConfigItem->save(); + $this->value=$value; + } + } + + public function getDefault() + { + return $this->default; + } + + + public function getType() + { + return $this->type; + } + + public function getTooltip() + { + return $this->tooltip; + } + + public function getSection() + { + return $this->section; + } + + public function getCategory() + { + return $this->category; + } + + public function getData() + { + return $this->data; + } + +} \ No newline at end of file diff --git a/src/ChurchCRM/dto/SystemConfig.php b/src/ChurchCRM/dto/SystemConfig.php index 2a9b5bbe76..f9ecd1068c 100644 --- a/src/ChurchCRM/dto/SystemConfig.php +++ b/src/ChurchCRM/dto/SystemConfig.php @@ -3,6 +3,8 @@ namespace ChurchCRM\dto; use ChurchCRM\Config; +use ChurchCRM\dto\ConfigItem; +use ChurchCRM\data\Countries; class SystemConfig { @@ -10,88 +12,267 @@ class SystemConfig * @var Config[] */ private static $configs; + private static $categories; + + private static function getSupportedLocales() + { + $languages = [ + "Choices" => [ + gettext("English - United States:en_US"), + gettext("English - Canada:en_CA"), + gettext("English - Australia:en_AU"), + gettext("English - Great Britain:en_GB"), + gettext("German - Germany:de_DE"), + gettext("Spanish - Spain:es_ES"), + gettext("French - France:fr_FR"), + gettext("Hungarian:hu_HU"), + gettext("Italian - Italy:it_IT"), + gettext("Norwegian:nb_NO"), + gettext("Dutch - Netherlands:nl_NL"), + gettext("Polish:pl_PL"), + gettext("Portuguese - Brazil:pt_BR"), + gettext("Romanian - Romania:ro_RO"), + gettext("Russian:ru_RU"), + gettext("Sami (Northern) (Sweden):se_SE"), + gettext("Albanian:sq_AL"), + gettext("Swedish - Sweden:sv_SE"), + gettext("Vietnamese:vi_VN"), + gettext("Chinese - China:zh_CN"), + gettext("Chinese - Taiwan:zh_TW") + ] + ]; + + return $languages; + + } + + private static function buildConfigs() + { + return array( + "debug" => new ConfigItem(2, "debug", "boolean", "1", gettext("Set debug mode\r\nThis may be helpful for when you're first setting up ChurchCRM, but you should\r\nprobably turn it off for maximum security otherwise. If you are having trouble,\r\nplease enable this so that you'll know what the errors are. This is especially\r\nimportant if you need to report a problem on the help forums.")), + "sDirClassifications" => new ConfigItem(5, "sDirClassifications", "text", "1,2,4,5", gettext("Include only these classifications in the directory, comma seperated")), + "sDirRoleHead" => new ConfigItem(6, "sDirRoleHead", "text", "1", gettext("These are the family role numbers designated as head of house")), + "sDirRoleSpouse" => new ConfigItem(7, "sDirRoleSpouse", "text", "2", gettext("These are the family role numbers designated as spouse")), + "sDirRoleChild" => new ConfigItem(8, "sDirRoleChild", "text", "3", gettext("These are the family role numbers designated as child")), + "sSessionTimeout" => new ConfigItem(9, "sSessionTimeout", "number", "3600", gettext("Session timeout length in seconds\rSet to zero to disable session timeouts.")), + "aFinanceQueries" => new ConfigItem(10, "aFinanceQueries", "text", "30,31,32", gettext("Queries for which user must have finance permissions to use:")), + "bCSVAdminOnly" => new ConfigItem(11, "bCSVAdminOnly", "boolean", "1", gettext("Should only administrators have access to the CSV export system and directory report?")), + "sDefault_Pass" => new ConfigItem(12, "sDefault_Pass", "text", "password", gettext("Default password for new users and those with reset passwords")), + "sMinPasswordLength" => new ConfigItem(13, "sMinPasswordLength", "number", "6", gettext("Minimum length a user may set their password to")), + "sMinPasswordChange" => new ConfigItem(14, "sMinPasswordChange", "number", "4", gettext("Minimum amount that a new password must differ from the old one (# of characters changed)\rSet to zero to disable this feature")), + "sDisallowedPasswords" => new ConfigItem(15, "sDisallowedPasswords","text", "password,god,jesus,church,christian", "text", "churchcrm,password,god,jesus,church,christian", gettext("A comma-seperated list of disallowed (too obvious) passwords.")), + "iMaxFailedLogins" => new ConfigItem(16, "iMaxFailedLogins", "number", "5", gettext("Maximum number of failed logins to allow before a user account is locked.\rOnce the maximum has been reached, an administrator must re-enable the account.\rThis feature helps to protect against automated password guessing attacks.\rSet to zero to disable this feature.")), + "iPDFOutputType" => new ConfigItem(20, "iPDFOutputType", "number", "1", gettext("PDF handling mode.\r1 = Save File dialog\r2 = Open in current browser window")), + "sDefaultCity" => new ConfigItem(21, "sDefaultCity", "text", "", gettext("Default City")), + "sDefaultState" => new ConfigItem(22, "sDefaultState", "text", "", gettext("Default State - Must be 2-letter abbreviation!")), + "sDefaultCountry" => new ConfigItem(23, "sDefaultCountry", "choice", "", "", json_encode(["Choices" => Countries::getNames()])), + "bEmailSend" => new ConfigItem(24, "bEmailSend", "boolean", "", gettext("If you wish to be able to send emails from within ChurchCRM. This requires\reither an SMTP server address to send from or sendmail installed in PHP.")), + "sSendType" => new ConfigItem(25, "sSendType", "choice", "smtp", gettext("The method for sending email. Either 'smtp' or 'sendmail'"), '{"Choices":["'.gettext("smtp").'","'.gettext("SendMail").'"]}'), + "sToEmailAddress" => new ConfigItem(26, "sToEmailAddress", "text", "", gettext("Default account for receiving a copy of all emails")), + "sSMTPHost" => new ConfigItem(27, "sSMTPHost", "text", "", gettext("SMTP Server Address (mail.server.com:25)")), + "sSMTPAuth" => new ConfigItem(28, "sSMTPAuth", "boolean", "0", gettext("Does your SMTP server require auththentication (username/password)?")), + "sSMTPUser" => new ConfigItem(29, "sSMTPUser", "text", "", gettext("SMTP Username")), + "sSMTPPass" => new ConfigItem(30, "sSMTPPass", "text", "", gettext("SMTP Password")), + "bShowFamilyData" => new ConfigItem(33, "bShowFamilyData", "boolean", "1", gettext("Unavailable person info inherited from assigned family for display?\rThis option causes certain info from a person's assigned family record to be\rdisplayed IF the corresponding info has NOT been entered for that person. ")), + "sGZIPname" => new ConfigItem(36, "sGZIPname", "text", "gzip", ""), + "sZIPname" => new ConfigItem(37, "sZIPname", "text", "zip", ""), + "sPGPname" => new ConfigItem(38, "sPGPname", "text", "gpg", ""), + "sLanguage" => new ConfigItem(39, "sLanguage", "choice", "en_US", gettext("Internationalization (I18n) support"), json_encode(SystemConfig::getSupportedLocales())), + "iFYMonth" => new ConfigItem(40, "iFYMonth", "number", "1", gettext("First month of the fiscal year")), + "sXML_RPC_PATH" => new ConfigItem(41, "sXML_RPC_PATH", "text", "XML/RPC.php", gettext("Path to RPC.php, required for Lat/Lon address lookup")), + "sGeocoderID" => new ConfigItem(42, "sGeocoderID", "text", "", gettext("User ID for rpc.geocoder.us")), + "sGeocoderPW" => new ConfigItem(43, "sGeocoderPW", "text", "", gettext("Password for rpc.geocoder.us")), + "sGoogleMapKey" => new ConfigItem(44, "sGoogleMapKey", "text", "", gettext("Google map API requires a unique key from https://developers.google.com/maps/documentation/javascript/get-api-key")), + "nChurchLatitude" => new ConfigItem(45, "nChurchLatitude", "number", "", gettext("Latitude of the church, used to center the Google map")), + "nChurchLongitude" => new ConfigItem(46, "nChurchLongitude", "number", "", gettext("Longitude of the church, used to center the Google map")), + "bHidePersonAddress" => new ConfigItem(47, "bHidePersonAddress", "boolean", "1", gettext("Set true to disable entering addresses in Person Editor. Set false to enable entering addresses in Person Editor.")), + "bHideFriendDate" => new ConfigItem(48, "bHideFriendDate", "boolean", "0", gettext("Set true to disable entering Friend Date in Person Editor. Set false to enable entering Friend Date in Person Editor.")), + "bHideFamilyNewsletter" => new ConfigItem(49, "bHideFamilyNewsletter", "boolean", "0", gettext("Set true to disable management of newsletter subscriptions in the Family Editor.")), + "bHideWeddingDate" => new ConfigItem(50, "bHideWeddingDate", "boolean", "0", gettext("Set true to disable entering Wedding Date in Family Editor. Set false to enable entering Wedding Date in Family Editor.")), + "bHideLatLon" => new ConfigItem(51, "bHideLatLon", "boolean", "0", gettext("Set true to disable entering Latitude and Longitude in Family Editor. Set false to enable entering Latitude and Longitude in Family Editor. Lookups are still performed, just not displayed.")), + "bUseDonationEnvelopes" => new ConfigItem(52, "bUseDonationEnvelopes", "boolean", "0", gettext("Set true to enable use of donation envelopes")), + "sHeader" => new ConfigItem(53, "sHeader", "textarea", "", gettext("Enter in HTML code which will be displayed as a header at the top of each page. Be sure to close your tags! Note: You must REFRESH YOUR BROWSER A SECOND TIME to view the new header.")), + "sISTusername" => new ConfigItem(54, "sISTusername", "text", "username", gettext("Intelligent Search Technolgy, Ltd. CorrectAddress Username for https://www.intelligentsearch.com/Hosted/User")), + "sISTpassword" => new ConfigItem(55, "sISTpassword", "text", "", gettext("Intelligent Search Technolgy, Ltd. CorrectAddress Password for https://www.intelligentsearch.com/Hosted/User")), + "bUseGoogleGeocode" => new ConfigItem(56, "bUseGoogleGeocode", "boolean", "1", gettext("Set true to use the Google geocoder. Set false to use rpc.geocoder.us.")), + "iChecksPerDepositForm" => new ConfigItem(57, "iChecksPerDepositForm", "number", "14", gettext("Number of checks for Deposit Slip Report")), + "bUseScannedChecks" => new ConfigItem(58, "bUseScannedChecks", "boolean", "0", gettext("Set true to enable use of scanned checks")), + "sDistanceUnit" => new ConfigItem(64, "sDistanceUnit", "choice", "miles", gettext("Unit used to measure distance, miles or km."), '{"Choices":["'.gettext("miles").'","'.gettext("kilometers").'"]}'), + "sTimeZone" => new ConfigItem(65, "sTimeZone", "choice", "America/New_York", gettext("Time zone- see http://php.net/manual/en/timezones.php for valid choices."), json_encode(["Choices"=>timezone_identifiers_list()])), + "sGMapIcons" => new ConfigItem(66, "sGMapIcons","text", "green-dot,purple,yellow-dot,blue-dot,orange,yellow,green,blue,red,pink,lightblue", "text", "red-dot,green-dot,purple,yellow-dot,blue-dot,orange,yellow,green,blue,red,pink,lightblue", gettext("Names of markers for Google Maps in order of classification")), + "cfgForceUppercaseZip" => new ConfigItem(67, "cfgForceUppercaseZip", "boolean", "0", gettext("Make user-entered zip/postcodes UPPERCASE when saving to the database.")), + "bEnableNonDeductible" => new ConfigItem(72, "bEnableNonDeductible", "boolean", "0", gettext("Enable non-deductible payments")), + "sElectronicTransactionProcessor" => new ConfigItem(73, "sElectronicTransactionProcessor", "choice", "Vanco", gettext("Electronic Transaction Processor"), '{"Choices":["'.gettext("Vanco").'","'.gettext("Authorize.NET").'"]}'), + "sEnableSelfRegistration" => new ConfigItem(80, "sEnableSelfRegistration", "boolean", "0", gettext("Set true to enable family self registration.")), + "sPhoneFormat" => new ConfigItem(100, "sPhoneFormat", "text", "(999) 999-9999", ""), + "sPhoneFormatWithExt" => new ConfigItem(101, "sPhoneFormatWithExt", "text", "(999) 999-9999 x99999", ""), + "sDateFormatLong" => new ConfigItem(102, "sDateFormatLong", "text", "m/d/Y", ""), + "sDateFormatNoYear" => new ConfigItem(103, "sDateFormatNoYear", "text", "m/d", ""), + "sDateFormatShort" => new ConfigItem(104, "sDateFormatShort", "text", "j/m/y", ""), + "sDateTimeFormat" => new ConfigItem(105, "sDateTimeFormat", "text", "j/m/y g:i a", ""), + "bRegistered" => new ConfigItem(999, "bRegistered", "boolean", "0", gettext("ChurchCRM has been registered. The ChurchCRM team uses registration information to track usage. This information is kept confidential and never released or sold. If this field is true the registration option in the admin menu changes to update registration.")), + "leftX" => new ConfigItem(1001, "leftX", "number", "20", gettext("Left Margin (1 = 1/100th inch)")), + "incrementY" => new ConfigItem(1002, "incrementY", "number", "4", gettext("Line Thickness (1 = 1/100th inch")), + "sChurchName" => new ConfigItem(1003, "sChurchName", "text", "", gettext("Church Name")), + "sChurchAddress" => new ConfigItem(1004, "sChurchAddress", "text", "", gettext("Church Address")), + "sChurchCity" => new ConfigItem(1005, "sChurchCity", "text", "", gettext("Church City")), + "sChurchState" => new ConfigItem(1006, "sChurchState", "text", "", gettext("Church State")), + "sChurchZip" => new ConfigItem(1007, "sChurchZip", "text", "", gettext("Church Zip")), + "sChurchPhone" => new ConfigItem(1008, "sChurchPhone", "text", "", gettext("Church Phone")), + "sChurchEmail" => new ConfigItem(1009, "sChurchEmail", "text", "", gettext("Church Email")), + "sHomeAreaCode" => new ConfigItem(1010, "sHomeAreaCode", "text", "", gettext("Home area code of the church")), + "sTaxReport1" => new ConfigItem(1011, "sTaxReport1", "text", "This letter shows our record of your payments for", gettext("Verbage for top line of tax report. Dates will be appended to the end of this line.")), + "sTaxReport2" => new ConfigItem(1012, "sTaxReport2", "text", "Thank you for your help in making a difference. We greatly appreciate your gift!", gettext("Verbage for bottom line of tax report.")), + "sTaxReport3" => new ConfigItem(1013, "sTaxReport3", "text", "If you have any questions or corrections to make to this report, please contact the church at the above number during business hours, 9am to 4pm, M-F.", gettext("Verbage for bottom line of tax report.")), + "sTaxSigner" => new ConfigItem(1014, "sTaxSigner", "text", "", gettext("Tax Report signer")), + "sReminder1" => new ConfigItem(1015, "sReminder1", "text", "This letter shows our record of your pledge and payments for fiscal year", gettext("Verbage for the pledge reminder report")), + "sReminderSigner" => new ConfigItem(1016, "sReminderSigner", "text", "", gettext("Pledge Reminder Signer")), + "sReminderNoPledge" => new ConfigItem(1017, "sReminderNoPledge", "text", "Pledges: We do not have record of a pledge for from you for this fiscal year.", gettext("Verbage for the pledge reminder report - No record of a pledge")), + "sReminderNoPayments" => new ConfigItem(1018, "sReminderNoPayments", "text", "Payments: We do not have record of a pledge for from you for this fiscal year.", gettext("Verbage for the pledge reminder report - No record of payments")), + "sConfirm1" => new ConfigItem(1019, "sConfirm1", "text", "This letter shows the information we have in our database with respect to your family. Please review, mark-up as necessary, and return this form to the church office.", gettext("Verbage for the database information confirmation and correction report")), + "sConfirm2" => new ConfigItem(1020, "sConfirm2", "text", "Thank you very much for helping us to update this information. If you want on-line access to the church database please provide your email address and a desired password and we will send instructions.", gettext("Verbage for the database information confirmation and correction report")), + "sConfirm3" => new ConfigItem(1021, "sConfirm3", "text", "Email _____________________________________ Password ________________", gettext("Verbage for the database information confirmation and correction report")), + "sConfirm4" => new ConfigItem(1022, "sConfirm4", "text", "[ ] I no longer want to be associated with the church (check here to be removed from our records).", gettext("Verbage for the database information confirmation and correction report")), + "sConfirm5" => new ConfigItem(1023, "sConfirm5", "text", "", gettext("Verbage for the database information confirmation and correction report")), + "sConfirm6" => new ConfigItem(1024, "sConfirm6", "text", "", gettext("Verbage for the database information confirmation and correction report")), + "sConfirmSigner" => new ConfigItem(1025, "sConfirmSigner", "text", "", gettext("Database information confirmation and correction report signer")), + "sPledgeSummary1" => new ConfigItem(1026, "sPledgeSummary1", "text", "Summary of pledges and payments for the fiscal year", gettext("Verbage for the pledge summary report")), + "sPledgeSummary2" => new ConfigItem(1027, "sPledgeSummary2", "text", " as of", gettext("Verbage for the pledge summary report")), + "sDirectoryDisclaimer1" => new ConfigItem(1028, "sDirectoryDisclaimer1", "text", "Every effort was made to insure the accuracy of this directory. If there are any errors or omissions, please contact the church office.\n\nThis directory is for the use of the people of", gettext("Verbage for the directory report")), + "sDirectoryDisclaimer2" => new ConfigItem(1029, "sDirectoryDisclaimer2", "text", ", and the information contained in it may not be used for business or commercial purposes.", gettext("Verbage for the directory report")), + "bDirLetterHead" => new ConfigItem(1030, "bDirLetterHead", "text", "../Images/church_letterhead.jpg", gettext("Church Letterhead path and file")), + "sZeroGivers" => new ConfigItem(1031, "sZeroGivers", "text", "This letter shows our record of your payments for", gettext("Verbage for top line of tax report. Dates will be appended to the end of this line.")), + "sZeroGivers2" => new ConfigItem(1032, "sZeroGivers2", "text", "Thank you for your help in making a difference. We greatly appreciate your gift!", gettext("Verbage for bottom line of tax report.")), + "sZeroGivers3" => new ConfigItem(1033, "sZeroGivers3", "text", "If you have any questions or corrections to make to this report, please contact the church at the above number during business hours, 9am to 4pm, M-F.", gettext("Verbage for bottom line of tax report.")), + "sChurchChkAcctNum" => new ConfigItem(1034, "sChurchChkAcctNum", "text", "", gettext("Church Checking Account Number")), + "sEnableGravatarPhotos" => new ConfigItem(1035, "sEnableGravatarPhotos", "boolean", "0", gettext("lookup user images on Gravatar when no local image is present")), + "sEnableExternalBackupTarget" => new ConfigItem(1036, "sEnableExternalBackupTarget", "boolean", "0", gettext("Enable Remote Backups to Cloud Services")), + "sExternalBackupType" => new ConfigItem(1037, "sExternalBackupType", "choice", "", gettext("Cloud Service Type (Supported values: WebDAV, Local)"), '{"Choices":["'.gettext("WebDAV").'","'.gettext("Local").'"]}'), + "sExternalBackupEndpoint" => new ConfigItem(1038, "sExternalBackupEndpoint", "text", "", gettext("Remote Backup Endpoint")), + "sExternalBackupUsername" => new ConfigItem(1039, "sExternalBackupUsername", "text", "", gettext("Remote Backup Username")), + "sExternalBackupPassword" => new ConfigItem(1040, "sExternalBackupPassword", "text", "", gettext("Remote Backup Password")), + "sExternalBackupAutoInterval" => new ConfigItem(1041, "sExternalBackupAutoInterval", "text", "", gettext("Interval in Hours for Automatic Remote Backups")), + "sLastBackupTimeStamp" => new ConfigItem(1042, "sLastBackupTimeStamp", "text", "", gettext("Last Backup Timestamp")), + "sQBDTSettings" => new ConfigItem(1043, "sQBDTSettings", "json", '{"date1":{"x":"12","y":"42"},"date2X":"185","leftX":"64","topY":"7","perforationY":"97","amountOffsetX":"35","lineItemInterval":{"x":"49","y":"7"},"max":{"x":"200","y":"140"},"numberOfItems":{"x":"136","y":"68"},"subTotal":{"x":"197","y":"42"},"topTotal":{"x":"197","y":"68"},"titleX":"85"}' , gettext("QuickBooks Deposit Ticket Settings")), + "sEnableIntegrityCheck" => new ConfigItem(1044, "sEnableIntegrityCheck", "boolean", "1", gettext("Enable Integrity Check")), + "sIntegrityCheckInterval" => new ConfigItem(1045, "sIntegrityCheckInterval", "text", "168", gettext("Interval in Hours for Integrity Check")), + "sLastIntegrityCheckTimeStamp" => new ConfigItem(1046, "sLastIntegrityCheckTimeStamp", "text", "", gettext("Last Integrity Check Timestamp")), + "sChurchCountry" => new ConfigItem(1047, "sChurchCountry", "choice", "", "", json_encode(["Choices" => Countries::getNames()])), + "sConfirmSincerely" => new ConfigItem(1048, "sConfirmSincerely", "text", "Sincerely", gettext("Used to end a letter before Signer")), + "googleTrackingID" => new ConfigItem(1050, "googleTrackingID", "text", "", gettext("Google Analytics Tracking Code")), + "mailChimpApiKey" => new ConfigItem(2000, "mailChimpApiKey", "text", "", gettext("see http://kb.mailchimp.com/accounts/management/about-api-keys")), + "sDepositSlipType" => new ConfigItem(2001, "sDepositSlipType", "choice", "QBDT", gettext("Deposit ticket type. QBDT - Quickbooks"), '{"Choices":["QBDT"]}') + ); + } + private static function buildCategories() + { + return array ( + gettext('Church Information') =>["sChurchName","sChurchAddress","sChurchCity","sChurchState","sChurchZip","sChurchCountry","sChurchPhone","sChurchEmail","sHomeAreaCode","sTimeZone","nChurchLatitude","nChurchLongitude"], + gettext('User setup') => ["sDefault_Pass","sMinPasswordLength","sMinPasswordChange","iMaxFailedLogins","sSessionTimeout","sDisallowedPasswords"], + gettext('Email Setup') => ["bEmailSend","sSendType","sSMTPHost","sSMTPAuth","sSMTPUser","sSMTPPass","sToEmailAddress","mailChimpApiKey"], + gettext('Member Setup') => ["sDirClassifications","sDirRoleHead","sDirRoleSpouse","sDirRoleChild","sDefaultCity","sDefaultState","sDefaultCountry","bShowFamilyData","bHidePersonAddress","bHideFriendDate","bHideFamilyNewsletter","bHideWeddingDate","bHideLatLon","cfgForceUppercaseZip","sEnableGravatarPhotos","sEnableSelfRegistration"], + gettext('System Settings') => ["sLastBackupTimeStamp","sExternalBackupAutoInterval","sExternalBackupPassword","sEnableExternalBackupTarget","sExternalBackupType","sExternalBackupEndpoint","sExternalBackupUsername","debug","bRegistered","sXML_RPC_PATH","sGZIPname","sZIPname","sPGPname","bCSVAdminOnly","sHeader","sEnableIntegrityCheck","sIntegrityCheckInterval","sLastIntegrityCheckTimeStamp"], + gettext('Map Settings') => ["sGoogleMapKey","bUseGoogleGeocode","sGMapIcons","sISTusername","sISTpassword","sGeocoderID","sGeocoderPW"], + gettext('Report Settings') => ["sQBDTSettings","leftX","incrementY","sTaxReport1","sTaxReport2","sTaxReport3","sTaxSigner","sReminder1","sReminderSigner","sReminderNoPledge","sReminderNoPayments","sConfirm1","sConfirm2","sConfirm3","sConfirm4","sConfirm5","sConfirm6","sConfirmSincerely","sConfirmSigner","sPledgeSummary1","sPledgeSummary2","sDirectoryDisclaimer1","sDirectoryDisclaimer2","bDirLetterHead","sZeroGivers","sZeroGivers2","sZeroGivers3"], + gettext('Localization') => ["sLanguage","sDistanceUnit","sPhoneFormat","sPhoneFormatWithExt","sDateFormatLong","sDateFormatNoYear","sDateFormatShort","sDateTimeFormat"], + gettext('Financial Settings') => ["sDepositSlipType","iChecksPerDepositForm","bUseScannedChecks","sElectronicTransactionProcessor","bEnableNonDeductible","iFYMonth","bUseDonationEnvelopes","aFinanceQueries"], + gettext('Other Settings') => ["iPDFOutputType","googleTrackingID"] + ); + } + /** * @param Config[] $configs */ public static function init($configs) { - self::$configs = $configs; + self::$configs = self::buildConfigs(); + self::$categories = self::buildCategories(); + self::scrapeDBConfigs($configs); } + + public static function getCategories() + { + return self::$categories; + } + + private static function scrapeDBConfigs($configs) + { + foreach ($configs as $config) + { + if ( isset( self::$configs[$config->getName()])) + { + //if the current config set defined by code contains the current config retreived from the db, then cache it + self::$configs[$config->getName()]->setDBConfigObject($config); + } + else + { + //there's a config item in the DB that doesn't exist in the current code. + //delete it + $config->delete(); + } + } + } + + public static function getConfigItem($name) + { + return self::$configs[$name]; + } public static function getValue($name) { - $config = self::getRawConfig($name); - if (!is_null($config)) { - return $config->getValue(); - } + if ( isset(self::$configs[$name]) ) + { + return self::$configs[$name]->getValue(); + } + else + { + throw new \Exception (gettext("An invalid configuration name has been requested").": ".$name); + } } public static function getBooleanValue($name) { - $config = self::getRawConfig($name); - if (!is_null($config)) { - return $config->getBooleanValue(); - } - - return false; + if ( isset(self::$configs[$name]) ) + { + return self::$configs[$name]->getBooleanValue(); + } + else + { + throw new \Exception (gettext("An invalid configuration name has been requested").": ".$name); + } + } public static function setValue($name, $value) { - $config = self::getRawConfig($name); - if (!is_null($config)) { - $config->setValue($value); - $config->save(); - } + if ( isset(self::$configs[$name]) ) + { + self::$configs[$name]->setValue($value); + } + else + { + throw new \Exception (gettext("An invalid configuration name has been requested").": ".$name); + } + } public static function setValueById($Id, $value) { - $config = self::getRawConfigById($Id); - if (!is_null($config)) { - $config->setValue($value); - $config->save(); + $success = false; + foreach (self::$configs as $configItem) + { + if ($configItem->getId() == $Id) + { + $configItem->setValue($value); + $success = true; } - } - - /** - * @param $name - * - * @return Config - */ - public static function getRawConfig($name) - { - foreach (self::$configs as $config) { - if ($config->getName() == $name) { - return $config; - } } - } - - public static function getRawConfigById($Id) - { - foreach (self::$configs as $config) { - if ($config->getId() == $Id) { - return $config; - } - } + if (! $success ) + { + throw new \Exception (gettext("An invalid configuration id has been requested").": ".$Id); + } } - public static function getConfigSteps() - { - $steps = [ - 'Step1' => gettext('Church Information'), - 'Step2' => gettext('User setup'), - 'Step3' => gettext('Email Setup'), - 'Step4' => gettext('Member Setup'), - 'Step5' => gettext('System Settings'), - 'Step6' => gettext('Map Settings'), - 'Step7' => gettext('Report Settings'), - 'Step9' => gettext('Localization'), - 'Step8' => gettext('Other Settings'), - ]; - - return $steps; - } + } diff --git a/src/ChurchCRM/model/ChurchCRM/Config.php b/src/ChurchCRM/model/ChurchCRM/Config.php index 6de0618d7e..d3a6166403 100644 --- a/src/ChurchCRM/model/ChurchCRM/Config.php +++ b/src/ChurchCRM/model/ChurchCRM/Config.php @@ -12,20 +12,9 @@ * You should add additional methods to this class to meet the * application requirements. This class will only be generated as * long as it does not already exist in the output directory. + * */ class Config extends BaseConfig { - public function getBooleanValue() - { - return boolval($this->getValue()); - } - - public function getValue() - { - if (is_null($this->cfg_value)) { - return $this->cfg_default; - } - return $this->cfg_value; - } } diff --git a/src/ChurchCRM/model/ChurchCRM/Deposit.php b/src/ChurchCRM/model/ChurchCRM/Deposit.php index 45d90904bd..226244fe38 100644 --- a/src/ChurchCRM/model/ChurchCRM/Deposit.php +++ b/src/ChurchCRM/model/ChurchCRM/Deposit.php @@ -379,22 +379,15 @@ public function getPDF() $Report->pdf = new \ChurchCRM\Reports\PDF_DepositReport(); $Report->funds = DonationFundQuery::create()->find(); - // Read in report settings from database - $settings = ConfigQuery::create()->filterBySection('ChurchInfoReport')->find(); - foreach ($settings as $setting) { - $name = $setting->getName(); - $Report->ReportSettings->$name = $setting->getValue(); - } - //in 2.2.0, this setting will be part of the database, but to avoid 2.1.7 schema changes, I'm defining it in code. - $Report->ReportSettings->sDepositSlipType = 'QBDT'; + $sDepositSlipType = SystemConfig::getValue('sDepositSlipType'); - if ($Report->ReportSettings->sDepositSlipType == 'QBDT') { + if ($sDepositSlipType == 'QBDT') { //Generate a QuickBooks Deposit Ticket. - $this->generateQBDepositSlip($Report); - } elseif ($Report->ReportSettings->sDepositSlipType == 'PTDT') { + $this->generateQBDepositSlip($Report); + } elseif ($sDepositSlipType == 'PTDT') { //placeholder for Peachtree Deposit Tickets. - } elseif ($Report->ReportSettings->sDepositSlipType == 'GDT') { + } elseif ($sDepositSlipType == 'GDT') { //placeholder for generic deposit ticket. } //$this->generateBankDepositSlip($Report); diff --git a/src/DepositSlipEditor.php b/src/DepositSlipEditor.php index 19e3c91b29..941e301c76 100644 --- a/src/DepositSlipEditor.php +++ b/src/DepositSlipEditor.php @@ -18,6 +18,7 @@ require 'Include/Functions.php'; use ChurchCRM\DepositQuery; +use ChurchCRM\dto\SystemURLs; $iDepositSlipID = 0; $thisDeposit = 0; @@ -178,30 +179,8 @@ - - - - +getFundTotals() as $tmpfund) { @@ -238,6 +217,47 @@ initPaymentTable(); initCharts(pledgeData, fundData); initDepositSlipEditor(); + + $('#deleteSelectedRows').click(function() { + var deletedRows = dataT.rows('.selected').data(); + bootbox.confirm({ + title:'', + message: '

' + deletedRows.length + '

' + + '

'+ + '

") ?>', + buttons: { + cancel : { + label: '' + }, + confirm: { + label: '' + } + }, + callback: function ( result ) { + if ( result ) + { + window.CRM.deletesRemaining = deletedRows.length; + $.each(deletedRows, function(index, value) { + $.ajax({ + type: 'POST', // define the type of HTTP verb we want to use (POST for our form) + url: window.CRM.root+'/api/payments/' + value.Groupkey, // the url where we want to POST + dataType: 'json', // what type of data do we expect back from the server + data: {"_METHOD":"DELETE"}, + encode: true + }) + .done(function(data) { + dataT.rows('.selected').remove().draw(false); + window.CRM.deletesRemaining --; + if ( window.CRM.deletesRemaining == 0 ) + { + location.reload(); + } + }); + }); + } + } + }) + }); }); + - - diff --git a/src/FindDepositSlip.php b/src/FindDepositSlip.php index e46c8bbd98..38c4dce9a3 100644 --- a/src/FindDepositSlip.php +++ b/src/FindDepositSlip.php @@ -17,6 +17,8 @@ require 'Include/Config.php'; require 'Include/Functions.php'; +use ChurchCRM\dto\SystemURLs; + $iDepositSlipID = $_SESSION['iCurrentDeposit']; //Set the page title @@ -31,32 +33,6 @@ require 'Include/Header.php'; ?> - -

- -

@@ -113,6 +89,44 @@
- + + + - + diff --git a/src/GenerateSeedData.php b/src/GenerateSeedData.php index de20ffe34d..de9ebdbf19 100644 --- a/src/GenerateSeedData.php +++ b/src/GenerateSeedData.php @@ -15,6 +15,8 @@ require 'Include/Config.php'; require 'Include/Functions.php'; +use ChurchCRM\dto\SystemURLs; + // Security: User must have Manage Groups permission if (!$_SESSION['bAdmin']) { Redirect('Menu.php'); @@ -51,7 +53,7 @@ url: window.CRM.root + '/api/data/seed/families/' + $("#Num_Families").val(), // the url where we want to POST dataType : 'json', // what type of data do we expect back from the server encode : true, - beforeSend : function () { + beforeSend : function () { $('#results').empty(); $('#results').append('

'); } @@ -59,20 +61,18 @@ .done(function(data) { console.log(data); $('#results').empty(); - $('#results').append('
'+JSON.stringify(data,null,4) +'
'); + $('#results').append('
'+JSON.stringify(data,null,4) +'
'); }); - - - + + + }); - - diff --git a/src/GroupEditor.php b/src/GroupEditor.php index 2378b38541..4a903f76b7 100644 --- a/src/GroupEditor.php +++ b/src/GroupEditor.php @@ -17,7 +17,7 @@ //Include the function library require 'Include/Config.php'; require 'Include/Functions.php'; -use ChurchCRM\Group; +use ChurchCRM\dto\SystemURLs; use ChurchCRM\GroupQuery; use ChurchCRM\ListOptionQuery; use ChurchCRM\Service\GroupService; @@ -178,6 +178,6 @@ var roleCount = groupRoleData.length; var groupID =; - + diff --git a/src/GroupView.php b/src/GroupView.php index 26eb2baf3d..28a7c6828d 100644 --- a/src/GroupView.php +++ b/src/GroupView.php @@ -90,39 +90,9 @@ getId().'">'.gettext('Edit this Group').''; - echo ''.gettext('Delete this Group').''; ?> - - - + echo '' . gettext('Edit this Group') . ''; + echo ''; ?> + @@ -196,7 +197,7 @@ class="fa fa-map-pin">
- + @@ -220,7 +221,8 @@ class="fa fa-map-pin">


-
@@ -271,7 +273,8 @@ class="fa fa-map-pin"> -
  '.FormatFullName($per_Title, $per_FirstName, $per_MiddleName, $per_LastName, $per_Suffix, 1).'   '.FormatFullName($per_Title, $per_FirstName, $per_MiddleName, $per_LastName, $per_Suffix, 1).''.$sValidAddy.''.$sValidEmail.'
@@ -308,7 +311,8 @@ class="fa fa-map-pin"> - diff --git a/src/Menu.php b/src/Menu.php index 114b05bc6f..b4dbceac2e 100644 --- a/src/Menu.php +++ b/src/Menu.php @@ -29,6 +29,7 @@ use ChurchCRM\DepositQuery; use ChurchCRM\Service\DashboardService; use ChurchCRM\Service\FinancialService; +use ChurchCRM\dto\SystemURLs; $financialService = new FinancialService(); @@ -77,7 +78,7 @@
- +
@@ -96,7 +97,7 @@
- +
@@ -115,7 +116,7 @@
- +
@@ -134,7 +135,7 @@
- +
@@ -192,7 +193,8 @@ } ?> - @@ -224,7 +226,8 @@ - @@ -253,11 +256,12 @@ ?>
  • - User Image
    + User Image
  • - @@ -284,11 +288,12 @@ ?>
  • - User Image
    + User Image
  • - @@ -329,7 +334,7 @@ }; var lineChartCanvas = $("#deposit-lineGraph").get(0).getContext("2d"); var lineChart = new Chart(lineChartCanvas).Line(lineData,options); - + });
    - +

    isMale()) { @@ -978,7 +979,6 @@ function GroupAdd() { }); } - - diff --git a/src/QueryList.php b/src/QueryList.php index fd6b088f2c..236db9bf56 100644 --- a/src/QueryList.php +++ b/src/QueryList.php @@ -27,22 +27,39 @@ require 'Include/Header.php'; -if ($_SESSION['bAdmin']) { - echo '

    '.gettext('Run a Free-Text Query').'

    '; -} - -while ($aRow = mysqli_fetch_array($rsQueries)) { - extract($aRow); - - // Filter out finance-related queries if the user doesn't have finance permissions - if ($_SESSION['bFinance'] || !in_array($qry_ID, $aFinanceQueries)) { - // Display the query name and description - echo '

    '; - echo ''.gettext($qry_Name).''; - echo '
    '; - echo gettext($qry_Description); - echo '

    '; - } -} +?> +
    +
    +

    + '.gettext('Run a Free-Text Query').''; + } + ?> +

    + +
      + +
    • +

      + '.gettext($qry_Name).':'; + echo '
      '; + echo gettext($qry_Description); + } + ?> +

      +
    • + +
    +
    + +
    +'; - echo ''; - - //Loop through the fields and write the header row - for ($iCount = 0; $iCount < mysqli_num_fields($rsQueryResults); $iCount++) { - //If this field is called "AddToCart", don't display this field... - $fieldInfo = mysqli_fetch_field_direct($rsQueryResults, $iCount); - if ($fieldInfo->name != 'AddToCart') { - echo ''.$fieldInfo->name.''; - } - } - - //Close the header row - echo ''; - + $rsQueryResults = RunQuery($qry_SQL); ?> +
    + +
    +

    + +

    + + + + name != 'AddToCart') { + echo ''; + } + } ?> + + +'; //Loop through the fields and write each one @@ -236,145 +235,162 @@ function DoQuery() //...otherwise just render the field else { //Write the actual value of this row - echo ''; + echo ''; } } - //Close the row echo ''; - } - - //Close the table and allow a link to run the query again - echo '
    '.$fieldInfo->name.'
    '.$aRow[$iCount].' '.$aRow[$iCount].'
    '; - echo '

    '; - - if (count($aHiddenFormField) > 0) { - ?> -

    - -   -   - -

    - '.gettext('Run Query Again').'

    '; - echo '

    '.gettext('Return to Query Menu').'

    '; + } ?> + + +
    + + + +
    + +
    +
    +
    Query
    +
    +
    + ', htmlspecialchars($qry_SQL)); ?> +
    +
    +

    '.str_replace(chr(13), '
    ', htmlspecialchars($qry_SQL)).'

    '; } + //Displays the name and description of the query function DisplayQueryInfo() { - global $rsSQL; global $qry_Name; - global $qry_Description; + global $qry_Description; ?> +
    +
    +

    +

    +
    +
    +'; - echo ''.gettext($qry_Name).'
    '.gettext($qry_Description); - echo '

    '; } -//Displays a form to enter values for each parameter, creating INPUT boxes and SELECT drop-downs as necessary -function DisplayParameterForm() + +function getQueryFormInput($queryParameters) { - global $rsParameters; - global $iQueryID; global $aErrorText; - global $cnInfoCentral; - - //Start the form and the table - echo '
    '; - echo ''; - - //Loop through the parameters and display an entry box for each one - if (mysqli_num_rows($rsParameters)) { - mysqli_data_seek($rsParameters, 0); - } - while ($aRow = mysqli_fetch_array($rsParameters)) { - extract($aRow); + + extract($queryParameters); + + $input = ''; + $label = ''; + $helpMsg = '
    ' . $qrp_Description . '
    '; + + switch ($qrp_Type) { + //Standard INPUT box + case 0: + $input = ''; + break; + + //SELECT box with OPTION tags supplied in the queryparameteroptions_qpo table + case 1: + //Get the query parameter options for this parameter + $sSQL = 'SELECT * FROM queryparameteroptions_qpo WHERE qpo_qrp_ID = '.$qrp_ID; + $rsParameterOptions = RunQuery($sSQL); + + $input = ''; - echo ''; - - //Determine the type of parameter we're dealing with - switch ($qrp_Type) { - //Standard INPUT box - case 0: - //Begin the table cell, disoplay the INPUT tag, close the table cell - echo ''; - break; - - //SELECT box with OPTION tags supplied in the queryparameteroptions_qpo table - case 1: - //Get the query parameter options for this parameter - $sSQL = 'SELECT * FROM queryparameteroptions_qpo WHERE qpo_qrp_ID = '.$qrp_ID; - $rsParameterOptions = RunQuery($sSQL); - - //Begin the table cell and the SELECT tag - echo ''; - break; - - //SELECT box with OPTION tags provided via a SQL query - case 2: - //Run the SQL to get the options - $rsParameterOptions = RunQuery($qrp_OptionSQL); - - echo ''; - break; - } + $input .= ''; + break; - //Display the query description and close the row - echo ''; - echo ''; - - //If we are re-rendering this form due to a validation error, display the error - if (isset($aErrorText[$qrp_Alias])) { - echo ''; - } - } ?> + //SELECT box with OPTION tags provided via a SQL query + case 2: + //Run the SQL to get the options + $rsParameterOptions = RunQuery($qrp_OptionSQL); -
    '.gettext($qrp_Name).':'; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''.gettext($qrp_Description).'
    '.$aErrorText[$qrp_Alias].'
    -
    - -

    + $input .= '
    + while ($ThisRow = mysqli_fetch_array($rsParameterOptions)) { + extract($ThisRow); + $input .= ''; + } -
    + $input .= ''; + break; + } + + $helpBlock = '
    ' . $helpMsg . '
    '; + + if ($aErrorText[$qrp_Alias]) { + $errorMsg = '
    ' . $aErrorText[$qrp_Alias] . '
    '; + $helpBlock = '
    ' . $helpMsg . $errorMsg . '
    '; + return '
    ' . $label . $input . $helpBlock . '
    '; + } + + return '
    ' . $label . $input . $helpBlock . '
    '; +} - +
    +
    + +
    + +
    + +
    + + +
    + +
    +
    + +
    +
    + +
    + +
    +

    @@ -47,7 +48,7 @@ :
    :
    :
    - :
    + :
    :
    ChurchCRM :

    : diff --git a/src/RestoreDatabase.php b/src/RestoreDatabase.php index 87ad586577..8b63853a8a 100644 --- a/src/RestoreDatabase.php +++ b/src/RestoreDatabase.php @@ -15,6 +15,8 @@ require 'Include/Config.php'; require 'Include/Functions.php'; +use ChurchCRM\dto\SystemURLs; + // Security: User must have Manage Groups permission if (!$_SESSION['bAdmin']) { Redirect('Menu.php'); @@ -52,7 +54,7 @@ - - + diff --git a/src/SelectList.php b/src/SelectList.php index a1ce4284fc..2a7ee56d91 100644 --- a/src/SelectList.php +++ b/src/SelectList.php @@ -31,6 +31,7 @@ //Include the function library require 'Include/Config.php'; require 'Include/Functions.php'; +use ChurchCRM\dto\SystemURLs; $iTenThousand = 10000; // Constant used to offset negative choices in drop down lists @@ -1139,7 +1140,7 @@ //Display the row echo ''; ?> - + diff --git a/src/SystemSettings.php b/src/SystemSettings.php index 30d17f1eb3..061a93b2cd 100644 --- a/src/SystemSettings.php +++ b/src/SystemSettings.php @@ -29,7 +29,6 @@ require 'Include/Functions.php'; use ChurchCRM\ConfigQuery; -use ChurchCRM\data\Countries; use ChurchCRM\dto\LocaleInfo; use ChurchCRM\dto\SystemConfig; @@ -56,7 +55,7 @@ // Filter Input if ($id == $iHTMLHeaderRow) { // Special handling of header value so HTML doesn't get removed $value = FilterInput($new_value[$id], 'htmltext'); - } elseif ($current_type == 'text' || $current_type == 'textarea' || $current_type == 'country') { + } elseif ($current_type == 'text' || $current_type == 'textarea') { $value = FilterInput($new_value[$id]); } elseif ($current_type == 'number') { $value = FilterInput($new_value[$id], 'float'); @@ -88,6 +87,10 @@ SystemConfig::setValueById($id, $value); next($type); } + Redirect("SystemSettings.php?saved=true"); +} + +if (isset($_GET['saved'])) { $sGlobalMessage = gettext('Setting saved'); } @@ -120,157 +123,133 @@
    @@ -45,7 +47,7 @@   - + + /ListEvents.php -$shortName = str_replace($sRootPath.'/', '', $_SERVER['REQUEST_URI']); +$shortName = str_replace(SystemURLs::getRootPath().'/', '', $_SERVER['REQUEST_URI']); $fileName = dashesToCamelCase($shortName, true).'.php'; if (strtolower($shortName) == 'index.php' || strtolower($fileName) == 'index.php') { // Index.php -> Menu.php or Login.php - header('Location: '.$sRootPath.$redirectTo); + header('Location: '.SystemURLs::getRootPath().$redirectTo); exit; } elseif (!$hasSession) { // Must show login form if no session diff --git a/src/mysql/install/Install.sql b/src/mysql/install/Install.sql index aa62850d0f..b2c2c727a4 100644 --- a/src/mysql/install/Install.sql +++ b/src/mysql/install/Install.sql @@ -97,142 +97,17 @@ CREATE TABLE `canvassdata_can` ( -- Table structure for table `config_cfg` -- -SET @JSONV = '{"date1":{"x":"12","y":"42"},"date2X":"185","leftX":"64","topY":"7","perforationY":"97","amountOffsetX":"35","lineItemInterval":{"x":"49","y":"7"},"max":{"x":"200","y":"140"},"numberOfItems":{"x":"136","y":"68"},"subTotal":{"x":"197","y":"42"},"topTotal":{"x":"197","y":"68"},"titleX":"85"}'; + CREATE TABLE `config_cfg` ( `cfg_id` int(11) NOT NULL default '0', `cfg_name` varchar(50) NOT NULL default '', `cfg_value` text, - `cfg_type` ENUM('text','number','date','boolean','textarea','json','choice', 'country') NOT NULL default 'text', - `cfg_default` text NOT NULL, - `cfg_tooltip` text NOT NULL, - `cfg_section` varchar(50) NOT NULL default '', - `cfg_category` varchar(20) default NULL, - `cfg_order` INT NULL COMMENT '', - `cfg_data` text, PRIMARY KEY (`cfg_id`), UNIQUE KEY `cfg_name` (`cfg_name`), KEY `cfg_id` (`cfg_id`) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci; --- --- Dumping data for table `config_cfg` --- - -INSERT INTO `config_cfg` (`cfg_id`, `cfg_name`, `cfg_value`, `cfg_type`, `cfg_default`, `cfg_tooltip`, `cfg_section`, `cfg_category`, `cfg_data`) VALUES -(2, 'debug', '1', 'boolean', '1', 'Set debug mode\r\nThis may be helpful for when you''re first setting up ChurchCRM, but you should\r\nprobably turn it off for maximum security otherwise. If you are having trouble,\r\nplease enable this so that you''ll know what the errors are. This is especially\r\nimportant if you need to report a problem on the help forums.', 'General', NULL, NULL), -(5, 'sDirClassifications', '1,2,4,5', 'text', '1,2,4,5', 'Include only these classifications in the directory, comma seperated', 'General', NULL, NULL), -(6, 'sDirRoleHead', '1', 'text', '1', 'These are the family role numbers designated as head of house', 'General', NULL, NULL), -(7, 'sDirRoleSpouse', '2', 'text', '2', 'These are the family role numbers designated as spouse', 'General', NULL, NULL), -(8, 'sDirRoleChild', '3', 'text', '3', 'These are the family role numbers designated as child', 'General', NULL, NULL), -(9, 'sSessionTimeout', '3600', 'number', '3600', 'Session timeout length in seconds\rSet to zero to disable session timeouts.', 'General', NULL, NULL), -(10, 'aFinanceQueries', '28,30,31,32', 'text', '28', 'Queries for which user must have finance permissions to use:', 'General', NULL, NULL), -(11, 'bCSVAdminOnly', '1', 'boolean', '1', 'Should only administrators have access to the CSV export system and directory report?', 'General', NULL, NULL), -(12, 'sDefault_Pass', 'password', 'text', 'password', 'Default password for new users and those with reset passwords', 'General', NULL, NULL), -(13, 'sMinPasswordLength', '6', 'number', '6', 'Minimum length a user may set their password to', 'General', NULL, NULL), -(14, 'sMinPasswordChange', '4', 'number', '4', 'Minimum amount that a new password must differ from the old one (# of characters changed)\rSet to zero to disable this feature', 'General', NULL, NULL), -(15, 'sDisallowedPasswords', 'churchcrm,password,god,jesus,church,christian', 'text', 'churchcrm,password,god,jesus,church,christian', 'A comma-seperated list of disallowed (too obvious) passwords.', 'General', NULL, NULL), -(16, 'iMaxFailedLogins', '5', 'number', '5', 'Maximum number of failed logins to allow before a user account is locked.\rOnce the maximum has been reached, an administrator must re-enable the account.\rThis feature helps to protect against automated password guessing attacks.\rSet to zero to disable this feature.', 'General', NULL, NULL), -(20, 'iPDFOutputType', '1', 'number', '1', 'PDF handling mode.\r1 = Save File dialog\r2 = Open in current browser window', 'General', NULL, NULL), -(21, 'sDefaultCity', '', 'text', '', 'Default City', 'General', NULL, NULL), -(22, 'sDefaultState', '', 'text', '', 'Default State - Must be 2-letter abbreviation!', 'General', NULL, NULL), -(23, 'sDefaultCountry', 'United States', 'country', 'United States', 'Default Country', 'General', NULL, NULL), -(24, 'bEmailSend', '', 'boolean', '', 'If you wish to be able to send emails from within ChurchCRM. This requires\reither an SMTP server address to send from or sendmail installed in PHP.', 'General', NULL, NULL), -(25, 'sSendType', 'smtp', 'choice', 'smtp', 'The method for sending email. Either "smtp" or "sendmail"', 'General', NULL, '{"Choices":["smtp","SendMail"]}'), -(26, 'sToEmailAddress', '', 'text', '', 'Default account for receiving a copy of all emails', 'General', NULL, NULL), -(27, 'sSMTPHost', '', 'text', '', 'SMTP Server Address (mail.server.com:25)', 'General', NULL, NULL), -(28, 'sSMTPAuth', '0', 'boolean', '0', 'Does your SMTP server require auththentication (username/password)?', 'General', NULL, NULL), -(29, 'sSMTPUser', '', 'text', '', 'SMTP Username', 'General', NULL, NULL), -(30, 'sSMTPPass', '', 'text', '', 'SMTP Password', 'General', NULL, NULL), -(33, 'bShowFamilyData', '1', 'boolean', '1', 'Unavailable person info inherited from assigned family for display?\rThis option causes certain info from a person''s assigned family record to be\rdisplayed IF the corresponding info has NOT been entered for that person. ', 'General', NULL, NULL), -(36, 'sGZIPname', 'gzip', 'text', 'gzip', '', 'General', NULL, NULL), -(37, 'sZIPname', 'zip', 'text', 'zip', '', 'General', NULL, NULL), -(38, 'sPGPname', 'gpg', 'text', 'gpg', '', 'General', NULL, NULL), -(39, 'sLanguage', 'en_US', 'choice', 'en_US', 'Internationalization (I18n) support', 'General', NULL, '{"Choices":["English - United States:en_US","English - Canada:en_CA", "English - Australia:en_AU", "English - Great Britain:en_GB", "German - Germany:de_DE", "Spanish - Spain:es_ES", "French - France:fr_FR", "Hungarian:hu_HU", "Italian - Italy:it_IT", "Norwegian:nb_NO", "Dutch - Netherlands:nl_NL", "Polish:pl_PL", "Portuguese - Brazil:pt_BR", "Romanian - Romania:ro_RO", "Russian:ru_RU", "Sami (Northern) (Sweden):se_SE", "Albanian:sq_AL", "Swedish - Sweden:sv_SE", "Vietnamese:vi_VN", "Chinese - China:zh_CN", "Chinese - Taiwan:zh_TW"]}'), -(40, 'iFYMonth', '1', 'number', '1', 'First month of the fiscal year', 'General', NULL, NULL), -(41, 'sXML_RPC_PATH', 'XML/RPC.php', 'text', 'XML/RPC.php', 'Path to RPC.php, required for Lat/Lon address lookup', 'General', NULL, NULL), -(42, 'sGeocoderID', '', 'text', '', 'User ID for rpc.geocoder.us', 'General', NULL, NULL), -(43, 'sGeocoderPW', '', 'text', '', 'Password for rpc.geocoder.us', 'General', NULL, NULL), -(44, 'sGoogleMapKey', '', 'text', '', 'Google map API requires a unique key from https://developers.google.com/maps/documentation/javascript/get-api-key', 'General', NULL, NULL), -(45, 'nChurchLatitude', '', 'number', '', 'Latitude of the church, used to center the Google map', 'General', NULL, NULL), -(46, 'nChurchLongitude', '', 'number', '', 'Longitude of the church, used to center the Google map', 'General', NULL, NULL), -(47, 'bHidePersonAddress', '1', 'boolean', '1', 'Set true to disable entering addresses in Person Editor. Set false to enable entering addresses in Person Editor.', 'General', NULL, NULL), -(48, 'bHideFriendDate', '0', 'boolean', '0', 'Set true to disable entering Friend Date in Person Editor. Set false to enable entering Friend Date in Person Editor.', 'General', NULL, NULL), -(49, 'bHideFamilyNewsletter', '0', 'boolean', '0', 'Set true to disable management of newsletter subscriptions in the Family Editor.', 'General', NULL, NULL), -(50, 'bHideWeddingDate', '0', 'boolean', '0', 'Set true to disable entering Wedding Date in Family Editor. Set false to enable entering Wedding Date in Family Editor.', 'General', NULL, NULL), -(51, 'bHideLatLon', '0', 'boolean', '0', 'Set true to disable entering Latitude and Longitude in Family Editor. Set false to enable entering Latitude and Longitude in Family Editor. Lookups are still performed, just not displayed.', 'General', NULL, NULL), -(52, 'bUseDonationEnvelopes', '0', 'boolean', '0', 'Set true to enable use of donation envelopes', 'General', NULL, NULL), -(53, 'sHeader', '', 'textarea', '', 'Enter in HTML code which will be displayed as a header at the top of each page. Be sure to close your tags! Note: You must REFRESH YOUR BROWSER A SECOND TIME to view the new header.', 'General', NULL, NULL), -(54, 'sISTusername', 'username', 'text', 'username', 'Intelligent Search Technolgy, Ltd. CorrectAddress Username for https://www.intelligentsearch.com/Hosted/User', 'General', NULL, NULL), -(55, 'sISTpassword', '', 'text', '', 'Intelligent Search Technolgy, Ltd. CorrectAddress Password for https://www.intelligentsearch.com/Hosted/User', 'General', NULL, NULL), -(56, 'bUseGoogleGeocode', '1', 'boolean', '1', 'Set true to use the Google geocoder. Set false to use rpc.geocoder.us.', 'General', NULL, NULL), -(57, 'iChecksPerDepositForm', '14', 'number', '14', 'Number of checks for Deposit Slip Report', 'General', NULL, NULL), -(58, 'bUseScannedChecks', '0', 'boolean', '0', 'Set true to enable use of scanned checks', 'General', NULL, NULL), -(64, 'sDistanceUnit', 'miles', 'choice', 'miles', 'Unit used to measure distance, miles or km.', 'General', NULL, '{"Choices":["miles","kilometers"]}'), -(65, 'sTimeZone', 'America/New_York', 'text', 'America/New_York', 'Time zone- see http://php.net/manual/en/timezones.php for valid choices.', 'General', NULL, NULL), -(66, 'sGMapIcons', 'red-dot,green-dot,purple,yellow-dot,blue-dot,orange,yellow,green,blue,red,pink,lightblue', 'text', 'red-dot,green-dot,purple,yellow-dot,blue-dot,orange,yellow,green,blue,red,pink,lightblue', 'Names of markers for Google Maps in order of classification', 'General', NULL, NULL), -(67, 'cfgForceUppercaseZip', '0', 'boolean', '0', 'Make user-entered zip/postcodes UPPERCASE when saving to the database.', 'General', NULL, NULL), -(72, 'bEnableNonDeductible', '0', 'boolean', '0', 'Enable non-deductible payments', 'General', NULL, NULL), -(73, 'sElectronicTransactionProcessor', 'Vanco', 'choice', 'Vanco', 'Electronic Transaction Processor', 'General', NULL, '{"Choices":["Vanco","Authorize.NET"]}'), -(80, 'sEnableSelfRegistration', '0', 'boolean', '0', 'Set true to enable family self registration.', 'General', NULL, NULL), -(100, 'sPhoneFormat', '(999) 999-9999', 'text', '(999) 999-9999', '', 'General',NULL, NULL), -(101, 'sPhoneFormatWithExt', '(999) 999-9999 x99999', 'text', '(999) 999-9999 x99999', '', 'General', NULL, NULL), -(102, 'sDateFormatLong', 'yyyy-mm-dd', 'text', 'yyyy-mm-dd', '', 'General', NULL, NULL), -(103, 'sDateFormatNoYear', 'DD/MM', 'text', 'DD/MM', '', 'General', NULL, NULL), -(104, 'sDateFormatShort', 'yy-mm-dd', 'text', 'yy-mm-dd', '', 'General', NULL, NULL), -(999, 'bRegistered', '0', 'boolean', '0', 'ChurchCRM has been registered. The ChurchCRM team uses registration information to track usage. This information is kept confidential and never released or sold. If this field is true the registration option in the admin menu changes to update registration.', 'General', NULL, NULL), -(1001, 'leftX', '20', 'number', '20', 'Left Margin (1 = 1/100th inch)', 'ChurchInfoReport', NULL, NULL), -(1002, 'incrementY', '4', 'number', '4', 'Line Thickness (1 = 1/100th inch', 'ChurchInfoReport', NULL, NULL), -(1003, 'sChurchName', 'Some Church', 'text', '', 'Church Name', 'ChurchInfoReport', NULL, NULL), -(1004, 'sChurchAddress', '', 'text', '', 'Church Address', 'ChurchInfoReport', NULL, NULL), -(1005, 'sChurchCity', '', 'text', '', 'Church City', 'ChurchInfoReport', NULL, NULL), -(1006, 'sChurchState', '', 'text', '', 'Church State', 'ChurchInfoReport', NULL, NULL), -(1007, 'sChurchZip', '', 'text', '', 'Church Zip', 'ChurchInfoReport', NULL, NULL), -(1008, 'sChurchPhone', '', 'text', '', 'Church Phone', 'ChurchInfoReport', NULL, NULL), -(1009, 'sChurchEmail', '', 'text', '', 'Church Email', 'ChurchInfoReport', NULL, NULL), -(1010, 'sHomeAreaCode', '', 'text', '', 'Home area code of the church', 'ChurchInfoReport', NULL, NULL), -(1011, 'sTaxReport1', 'This letter shows our record of your payments for', 'text', 'This letter shows our record of your payments for', 'Verbage for top line of tax report. Dates will be appended to the end of this line.', 'ChurchInfoReport', NULL, NULL), -(1012, 'sTaxReport2', 'Thank you for your help in making a difference. We greatly appreciate your gift!', 'text', 'Thank you for your help in making a difference. We greatly appreciate your gift!', 'Verbage for bottom line of tax report.', 'ChurchInfoReport', NULL, NULL), -(1013, 'sTaxReport3', 'If you have any questions or corrections to make to this report, please contact the church at the above number during business hours, 9am to 4pm, M-F.', 'text', 'If you have any questions or corrections to make to this report, please contact the church at the above number during business hours, 9am to 4pm, M-F.', 'Verbage for bottom line of tax report.', 'ChurchInfoReport', NULL, NULL), -(1014, 'sTaxSigner', 'Elder Joe Smith', 'text', '', 'Tax Report signer', 'ChurchInfoReport', NULL, NULL), -(1015, 'sReminder1', 'This letter shows our record of your pledge and payments for fiscal year', 'text', 'This letter shows our record of your pledge and payments for fiscal year', 'Verbage for the pledge reminder report', 'ChurchInfoReport', NULL, NULL), -(1016, 'sReminderSigner', 'Elder Joe Smith', 'text', '', 'Pledge Reminder Signer', 'ChurchInfoReport', NULL, NULL), -(1017, 'sReminderNoPledge', 'Pledges: We do not have record of a pledge for from you for this fiscal year.', 'text', 'Pledges: We do not have record of a pledge for from you for this fiscal year.', 'Verbage for the pledge reminder report - No record of a pledge', 'ChurchInfoReport', NULL, NULL), -(1018, 'sReminderNoPayments', 'Payments: We do not have record of a pledge for from you for this fiscal year.', 'text', 'Payments: We do not have record of a pledge for from you for this fiscal year.', 'Verbage for the pledge reminder report - No record of payments', 'ChurchInfoReport', NULL, NULL), -(1019, 'sConfirm1', 'This letter shows the information we have in our database with respect to your family. Please review, mark-up as necessary, and return this form to the church office.', 'text', 'This letter shows the information we have in our database with respect to your family. Please review, mark-up as necessary, and return this form to the church office.', 'Verbage for the database information confirmation and correction report', 'ChurchInfoReport', NULL, NULL), -(1020, 'sConfirm2', 'Thank you very much for helping us to update this information. If you want on-line access to the church database please provide your email address and a desired password and we will send instructions.', 'text', 'Thank you very much for helping us to update this information. If you want on-line access to the church database please provide your email address and a desired password and we will send instructions.', 'Verbage for the database information confirmation and correction report', 'ChurchInfoReport', NULL, NULL), -(1021, 'sConfirm3', 'Email _____________________________________ Password ________________', 'text', 'Email _____________________________________ Password ________________', 'Verbage for the database information confirmation and correction report', 'ChurchInfoReport', NULL, NULL), -(1022, 'sConfirm4', '[ ] I no longer want to be associated with the church (check here to be removed from our records).', 'text', '[ ] I no longer want to be associated with the church (check here to be removed from our records).', 'Verbage for the database information confirmation and correction report', 'ChurchInfoReport', NULL, NULL), -(1023, 'sConfirm5', '', 'text', '', 'Verbage for the database information confirmation and correction report', 'ChurchInfoReport', NULL, NULL), -(1024, 'sConfirm6', '', 'text', '', 'Verbage for the database information confirmation and correction report', 'ChurchInfoReport', NULL, NULL), -(1025, 'sConfirmSigner', 'Elder Joe Smith', 'text', '', 'Database information confirmation and correction report signer', 'ChurchInfoReport', NULL, NULL), -(1026, 'sPledgeSummary1', 'Summary of pledges and payments for the fiscal year', 'text', 'Summary of pledges and payments for the fiscal year', 'Verbage for the pledge summary report', 'ChurchInfoReport', NULL, NULL), -(1027, 'sPledgeSummary2', 'as of', 'text', ' as of', 'Verbage for the pledge summary report', 'ChurchInfoReport', NULL, NULL), -(1028, 'sDirectoryDisclaimer1', 'Every effort was made to insure the accuracy of this directory. If there are any errors or omissions, please contact the church office.This directory is for the use of the people of', 'text', 'Every effort was made to insure the accuracy of this directory. If there are any errors or omissions, please contact the church office.\n\nThis directory is for the use of the people of', 'Verbage for the directory report', 'ChurchInfoReport', NULL, NULL), -(1029, 'sDirectoryDisclaimer2', ', and the information contained in it may not be used for business or commercial purposes.', 'text', ', and the information contained in it may not be used for business or commercial purposes.', 'Verbage for the directory report', 'ChurchInfoReport', NULL, NULL), -(1030, 'bDirLetterHead', '../Images/church_letterhead.jpg', 'text', '../Images/church_letterhead.jpg', 'Church Letterhead path and file', 'ChurchInfoReport', NULL, NULL), -(1031, 'sZeroGivers', 'This letter shows our record of your payments for', 'text', 'This letter shows our record of your payments for', 'Verbage for top line of tax report. Dates will be appended to the end of this line.', 'ChurchInfoReport', NULL, NULL), -(1032, 'sZeroGivers2', 'Thank you for your help in making a difference. We greatly appreciate your gift!', 'text', 'Thank you for your help in making a difference. We greatly appreciate your gift!', 'Verbage for bottom line of tax report.', 'ChurchInfoReport', NULL, NULL), -(1033, 'sZeroGivers3', 'If you have any questions or corrections to make to this report, please contact the church at the above number during business hours, 9am to 4pm, M-F.', 'text', 'If you have any questions or corrections to make to this report, please contact the church at the above number during business hours, 9am to 4pm, M-F.', 'Verbage for bottom line of tax report.', 'ChurchInfoReport', NULL, NULL), -(1034, 'sChurchChkAcctNum', '111111111', 'text', '', 'Church Checking Account Number', 'ChurchInfoReport', NULL, NULL), -(1035, 'sEnableGravatarPhotos', '0', 'boolean', '0', 'lookup user images on Gravatar when no local image is present', 'General', NULL, NULL), -(1036, 'sEnableExternalBackupTarget', '0', 'boolean', '0', 'Enable Remote Backups to Cloud Services', 'General', "Step5", NULL), -(1037, 'sExternalBackupType', 'WebDAV', 'choice', '', 'Cloud Service Type (Supported values: WebDAV, Local)', 'General', "Step5", '{"Choices":["WebDAV","Local"]}'), -(1038, 'sExternalBackupEndpoint', '', 'Text', '', 'Remote Backup Endpoint', 'General', "Step5", NULL), -(1039, 'sExternalBackupUsername', '', 'Text', '', 'Remote Backup Username', 'General', "Step5", NULL), -(1040, 'sExternalBackupPassword', '', 'Text', '', 'Remote Backup Password', 'General', "Step5", NULL), -(1041, 'sExternalBackupAutoInterval', '', 'Text', '', 'Interval in Hours for Automatic Remote Backups', 'General', "Step5", NULL), -(1042, 'sLastBackupTimeStamp', '', 'Text', '', 'Last Backup Timestamp', 'General', "Step5", NULL), -(1043, 'sQBDTSettings', @JSONV , 'json', @JSONV , 'QuickBooks Deposit Ticket Settings', 'ChurchInfoReport', 'Step7', NULL), -(1044, 'sEnableIntegrityCheck', '1', 'boolean', '1', 'Enable Integrity Check', 'General', "Step5", NULL), -(1045, 'sIntegrityCheckInterval', '168', 'Text', '168', 'Interval in Hours for Integrity Check', 'General', "Step5", NULL), -(1046, 'sLastIntegrityCheckTimeStamp', '', 'Text', '', 'Last Integrity Check Timestamp', 'General', "Step5", NULL), -(1047, 'sChurchCountry', '', 'country', '', 'Church Country', 'ChurchInfoReport', NULL, NULL), -(1048, 'sConfirmSincerely', 'Sincerely', 'Text', 'Sincerely', 'Used to end a letter before Signer', 'ChurchInfoReport', NULL, NULL), -(1050, 'googleTrackingID', '', 'Text', '', 'Google Analytics Tracking Code', 'General', NULL, NULL), -(2000, 'mailChimpApiKey', '', 'text', '', 'see http://kb.mailchimp.com/accounts/management/about-api-keys', 'General', NULL, NULL); --- -------------------------------------------------------- - -- -- Table structure for table `deposit_dep` -- diff --git a/src/mysql/upgrade.json b/src/mysql/upgrade.json index b650d4ebb4..ff2eb915cb 100644 --- a/src/mysql/upgrade.json +++ b/src/mysql/upgrade.json @@ -98,9 +98,12 @@ "current": { "versions": [ "2.5.0", - "2.5.1" + "2.5.1", + "2.5.2" ], - "scripts":[], - "dbVersion": "2.5.2" + "scripts":[ + "/mysql/upgrade/2.6.0-configs.sql" + ], + "dbVersion": "2.6.0" } -} \ No newline at end of file +} diff --git a/src/mysql/upgrade/2.6.0-configs.sql b/src/mysql/upgrade/2.6.0-configs.sql new file mode 100644 index 0000000000..51113767f6 --- /dev/null +++ b/src/mysql/upgrade/2.6.0-configs.sql @@ -0,0 +1,9 @@ +DELETE FROM config_cfg WHERE cfg_value = cfg_default; + +ALTER TABLE config_cfg DROP COLUMN cfg_type; +ALTER TABLE config_cfg DROP COLUMN cfg_default; +ALTER TABLE config_cfg DROP COLUMN cfg_tooltip; +ALTER TABLE config_cfg DROP COLUMN cfg_section; +ALTER TABLE config_cfg DROP COLUMN cfg_category; +ALTER TABLE config_cfg DROP COLUMN cfg_order; +ALTER TABLE config_cfg DROP COLUMN cfg_data; \ No newline at end of file diff --git a/src/mysql/upgrade/update_config.sql b/src/mysql/upgrade/update_config.sql deleted file mode 100644 index b7d505a383..0000000000 --- a/src/mysql/upgrade/update_config.sql +++ /dev/null @@ -1,130 +0,0 @@ -SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; -SET time_zone = "+00:00"; - - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; - -UPDATE `config_cfg` SET `cfg_category`='Step1', `cfg_order`='0' WHERE `cfg_id`='1003'; -UPDATE `config_cfg` SET `cfg_category`='Step1', `cfg_order`='1' WHERE `cfg_id`='1004'; -UPDATE `config_cfg` SET `cfg_category`='Step1', `cfg_order`='2' WHERE `cfg_id`='1005'; -UPDATE `config_cfg` SET `cfg_category`='Step1', `cfg_order`='3' WHERE `cfg_id`='1006'; -UPDATE `config_cfg` SET `cfg_category`='Step1', `cfg_order`='4' WHERE `cfg_id`='1007'; -UPDATE `config_cfg` SET `cfg_category`='Step1', `cfg_order`='5' WHERE `cfg_id`='1047'; -UPDATE `config_cfg` SET `cfg_category`='Step1', `cfg_order`='6' WHERE `cfg_id`='1008'; -UPDATE `config_cfg` SET `cfg_category`='Step1', `cfg_order`='7' WHERE `cfg_id`='1009'; -UPDATE `config_cfg` SET `cfg_category`='Step1', `cfg_order`='8' WHERE `cfg_id`='1010'; -UPDATE `config_cfg` SET `cfg_category`='Step1', `cfg_order`='9' WHERE `cfg_id`='65'; -UPDATE `config_cfg` SET `cfg_category`='Step1', `cfg_order`='10' WHERE `cfg_id`='45'; -UPDATE `config_cfg` SET `cfg_category`='Step1', `cfg_order`='11' WHERE `cfg_id`='46'; - -UPDATE `config_cfg` SET `cfg_category`='Step2', `cfg_order`='0' WHERE `cfg_id`='12'; -UPDATE `config_cfg` SET `cfg_category`='Step2', `cfg_order`='1' WHERE `cfg_id`='13'; -UPDATE `config_cfg` SET `cfg_category`='Step2', `cfg_order`='3' WHERE `cfg_id`='14'; -UPDATE `config_cfg` SET `cfg_category`='Step2', `cfg_order`='4' WHERE `cfg_id`='16'; -UPDATE `config_cfg` SET `cfg_category`='Step2', `cfg_order`='5' WHERE `cfg_id`='9'; -UPDATE `config_cfg` SET `cfg_category`='Step2', `cfg_order`='6' WHERE `cfg_id`='15'; - -UPDATE `config_cfg` SET `cfg_category`='Step3', `cfg_order`='1' WHERE `cfg_id`='25'; -UPDATE `config_cfg` SET `cfg_category`='Step3', `cfg_order`='2' WHERE `cfg_id`='27'; -UPDATE `config_cfg` SET `cfg_category`='Step3', `cfg_order`='3' WHERE `cfg_id`='28'; -UPDATE `config_cfg` SET `cfg_category`='Step3', `cfg_order`='4' WHERE `cfg_id`='29'; -UPDATE `config_cfg` SET `cfg_category`='Step3', `cfg_order`='5' WHERE `cfg_id`='30'; -UPDATE `config_cfg` SET `cfg_category`='Step3', `cfg_order`='7' WHERE `cfg_id`='31'; -UPDATE `config_cfg` SET `cfg_category`='Step3', `cfg_order`='0' WHERE `cfg_id`='24'; -UPDATE `config_cfg` SET `cfg_category`='Step3', `cfg_order`='6' WHERE `cfg_id`='26'; -UPDATE `config_cfg` SET `cfg_category`='Step3', `cfg_order`='8' WHERE `cfg_id`='2000'; - -UPDATE `config_cfg` SET `cfg_category`='Step4', `cfg_order`='0' WHERE `cfg_id`='5'; -UPDATE `config_cfg` SET `cfg_category`='Step4', `cfg_order`='1' WHERE `cfg_id`='6'; -UPDATE `config_cfg` SET `cfg_category`='Step4', `cfg_order`='2' WHERE `cfg_id`='7'; -UPDATE `config_cfg` SET `cfg_category`='Step4', `cfg_order`='3' WHERE `cfg_id`='8'; -UPDATE `config_cfg` SET `cfg_category`='Step4', `cfg_order`='4' WHERE `cfg_id`='21'; -UPDATE `config_cfg` SET `cfg_category`='Step4', `cfg_order`='5' WHERE `cfg_id`='22'; -UPDATE `config_cfg` SET `cfg_category`='Step4', `cfg_order`='6' WHERE `cfg_id`='23'; -UPDATE `config_cfg` SET `cfg_category`='Step4', `cfg_order`='7' WHERE `cfg_id`='33'; -UPDATE `config_cfg` SET `cfg_category`='Step4', `cfg_order`='8' WHERE `cfg_id`='47'; -UPDATE `config_cfg` SET `cfg_category`='Step4', `cfg_order`='9' WHERE `cfg_id`='48'; -UPDATE `config_cfg` SET `cfg_category`='Step4', `cfg_order`='10' WHERE `cfg_id`='49'; -UPDATE `config_cfg` SET `cfg_category`='Step4', `cfg_order`='11' WHERE `cfg_id`='50'; -UPDATE `config_cfg` SET `cfg_category`='Step4', `cfg_order`='12' WHERE `cfg_id`='51'; -UPDATE `config_cfg` SET `cfg_category`='Step4', `cfg_order`='13' WHERE `cfg_id`='67'; -UPDATE `config_cfg` SET `cfg_category`='Step4', `cfg_order`='15' WHERE `cfg_id`='19'; -UPDATE `config_cfg` SET `cfg_category`='Step4', `cfg_order`='16' WHERE `cfg_id`='1035'; -UPDATE `config_cfg` SET `cfg_category`='Step4', `cfg_order`='17' WHERE `cfg_id`='80'; - -UPDATE `config_cfg` SET `cfg_category`='Step5', `cfg_order`='0' WHERE `cfg_id`='2'; -UPDATE `config_cfg` SET `cfg_category`='Step5', `cfg_order`='1' WHERE `cfg_id`='35'; -UPDATE `config_cfg` SET `cfg_category`='Step5', `cfg_order`='2' WHERE `cfg_id`='999'; -UPDATE `config_cfg` SET `cfg_category`='Step5', `cfg_order`='4' WHERE `cfg_id`='4'; -UPDATE `config_cfg` SET `cfg_category`='Step5', `cfg_order`='5' WHERE `cfg_id`='41'; -UPDATE `config_cfg` SET `cfg_category`='Step5', `cfg_order`='6' WHERE `cfg_id`='36'; -UPDATE `config_cfg` SET `cfg_category`='Step5', `cfg_order`='7' WHERE `cfg_id`='37'; -UPDATE `config_cfg` SET `cfg_category`='Step5', `cfg_order`='8' WHERE `cfg_id`='38'; -UPDATE `config_cfg` SET `cfg_category`='Step5', `cfg_order`='9' WHERE `cfg_id`='34'; -UPDATE `config_cfg` SET `cfg_category`='Step5', `cfg_order`='11' WHERE `cfg_id`='11'; -UPDATE `config_cfg` SET `cfg_category`='Step5', `cfg_order`='12' WHERE `cfg_id`='1'; -UPDATE `config_cfg` SET `cfg_category`='Step5', `cfg_order`='13' WHERE `cfg_id`='53'; -UPDATE `config_cfg` SET `cfg_category`='Step5', `cfg_order`='14' WHERE `cfg_id`='1045'; -UPDATE `config_cfg` SET `cfg_category`='Step5', `cfg_order`='15' WHERE `cfg_id`='1046'; - -UPDATE `config_cfg` SET `cfg_category`='Step6', `cfg_order`='0' WHERE `cfg_id`='44'; -UPDATE `config_cfg` SET `cfg_category`='Step6', `cfg_order`='1' WHERE `cfg_id`='56'; -UPDATE `config_cfg` SET `cfg_category`='Step6', `cfg_order`='2' WHERE `cfg_id`='66'; -UPDATE `config_cfg` SET `cfg_category`='Step6', `cfg_order`='3' WHERE `cfg_id`='54'; -UPDATE `config_cfg` SET `cfg_category`='Step6', `cfg_order`='4' WHERE `cfg_id`='55'; -UPDATE `config_cfg` SET `cfg_category`='Step6', `cfg_order`='5' WHERE `cfg_id`='42'; -UPDATE `config_cfg` SET `cfg_category`='Step6', `cfg_order`='6' WHERE `cfg_id`='43'; - -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='0' WHERE `cfg_id`='1001'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='1' WHERE `cfg_id`='1002'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='2' WHERE `cfg_id`='1011'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='3' WHERE `cfg_id`='1012'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='4' WHERE `cfg_id`='1013'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='5' WHERE `cfg_id`='1014'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='6' WHERE `cfg_id`='1015'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='7' WHERE `cfg_id`='1016'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='8' WHERE `cfg_id`='1017'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='9' WHERE `cfg_id`='1018'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='10' WHERE `cfg_id`='1019'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='11' WHERE `cfg_id`='1020'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='12' WHERE `cfg_id`='1021'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='13' WHERE `cfg_id`='1022'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='14' WHERE `cfg_id`='1023'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='15' WHERE `cfg_id`='1024'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='16' WHERE `cfg_id`='1048'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='17' WHERE `cfg_id`='1025'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='18' WHERE `cfg_id`='1026'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='19' WHERE `cfg_id`='1027'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='20' WHERE `cfg_id`='1028'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='21' WHERE `cfg_id`='1029'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='22' WHERE `cfg_id`='1030'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='23' WHERE `cfg_id`='1031'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='24' WHERE `cfg_id`='1032'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='25' WHERE `cfg_id`='1033'; -UPDATE `config_cfg` SET `cfg_category`='Step7', `cfg_order`='26' WHERE `cfg_id`='1034'; - -UPDATE `config_cfg` SET `cfg_category`='Step8', `cfg_order`='0' WHERE `cfg_id`='20'; -UPDATE `config_cfg` SET `cfg_category`='Step8', `cfg_order`='1' WHERE `cfg_id`='40'; -UPDATE `config_cfg` SET `cfg_category`='Step8', `cfg_order`='2' WHERE `cfg_id`='52'; -UPDATE `config_cfg` SET `cfg_category`='Step8', `cfg_order`='3' WHERE `cfg_id`='57'; -UPDATE `config_cfg` SET `cfg_category`='Step8', `cfg_order`='4' WHERE `cfg_id`='58'; -UPDATE `config_cfg` SET `cfg_category`='Step8', `cfg_order`='5' WHERE `cfg_id`='73'; -UPDATE `config_cfg` SET `cfg_category`='Step8', `cfg_order`='6' WHERE `cfg_id`='61'; -UPDATE `config_cfg` SET `cfg_category`='Step8', `cfg_order`='7' WHERE `cfg_id`='62'; -UPDATE `config_cfg` SET `cfg_category`='Step8', `cfg_order`='8' WHERE `cfg_id`='63'; -UPDATE `config_cfg` SET `cfg_category`='Step8', `cfg_order`='9' WHERE `cfg_id`='72'; -UPDATE `config_cfg` SET `cfg_category`='Step8', `cfg_order`='10' WHERE `cfg_id`='10'; - -UPDATE `config_cfg` SET `cfg_category`='Step8', `cfg_order`='90' WHERE `cfg_category`=''; -UPDATE `config_cfg` SET `cfg_category`='Step8', `cfg_order`='95' WHERE `cfg_category` is null; - -UPDATE `config_cfg` SET `cfg_category`='Step9', `cfg_order`='1' WHERE `cfg_id`='39'; -UPDATE `config_cfg` SET `cfg_category`='Step9', `cfg_order`='2' WHERE `cfg_id`='64'; -UPDATE `config_cfg` SET `cfg_category`='Step9', `cfg_order`='3' WHERE `cfg_id`='100'; -UPDATE `config_cfg` SET `cfg_category`='Step9', `cfg_order`='4' WHERE `cfg_id`='101'; -UPDATE `config_cfg` SET `cfg_category`='Step9', `cfg_order`='5' WHERE `cfg_id`='102'; -UPDATE `config_cfg` SET `cfg_category`='Step9', `cfg_order`='6' WHERE `cfg_id`='103'; -UPDATE `config_cfg` SET `cfg_category`='Step9', `cfg_order`='7' WHERE `cfg_id`='104'; diff --git a/src/skin/churchcrm.scss b/src/skin/churchcrm.scss index 625a8c5741..7ddaefa41d 100644 --- a/src/skin/churchcrm.scss +++ b/src/skin/churchcrm.scss @@ -14,8 +14,6 @@ // ( http://spaceninja.com/2015/03/31/ie-css-limits/ ) @import 'adminlte/plugins/select2/select2.min.css'; -@import 'adminlte/dist/css/AdminLTE.min.css'; -@import 'adminlte/dist/css/skins/_all-skins.min.css'; @import 'adminlte/plugins/datepicker/datepicker3.css'; @import 'adminlte/plugins/daterangepicker/daterangepicker.css'; @import 'adminlte/plugins/timepicker/bootstrap-timepicker.min.css'; @@ -33,6 +31,8 @@ @import 'ionicons/css/ionicons.min.css'; +@import 'adminlte/dist/css/AdminLTE.min.css'; +@import 'adminlte/dist/css/skins/_all-skins.min.css'; // Import ChurchCRM custom styles diff --git a/src/skin/js/DepositSlipEditor.js b/src/skin/js/DepositSlipEditor.js index d500a570a1..51cf1cbb0c 100644 --- a/src/skin/js/DepositSlipEditor.js +++ b/src/skin/js/DepositSlipEditor.js @@ -148,35 +148,6 @@ function initDepositSlipEditor() }); - $('#deleteSelectedRows').click(function() { - var deletedRows = dataT.rows('.selected').data() - $("#deleteNumber").text(deletedRows.length); - $("#confirmDelete").modal('show'); - }); - - $("#deleteConfirmed").click(function() { - var deletedRows = dataT.rows('.selected').data(); - window.CRM.deletesRemaining = deletedRows.length; - $.each(deletedRows, function(index, value) { - $.ajax({ - type: 'POST', // define the type of HTTP verb we want to use (POST for our form) - url: window.CRM.root+'/api/payments/' + value.Groupkey, // the url where we want to POST - dataType: 'json', // what type of data do we expect back from the server - data: {"_METHOD":"DELETE"}, - encode: true - }) - .done(function(data) { - $('#confirmDelete').modal('hide'); - dataT.rows('.selected').remove().draw(false); - window.CRM.deletesRemaining --; - if ( window.CRM.deletesRemaining == 0 ) - { - location.reload(); - } - }); - }); - }); - } function initCharts(fundChartData, pledgeChartData) diff --git a/src/skin/js/FindDepositSlip.js b/src/skin/js/FindDepositSlip.js index 79680c62f4..8cd1ca9223 100644 --- a/src/skin/js/FindDepositSlip.js +++ b/src/skin/js/FindDepositSlip.js @@ -98,13 +98,6 @@ $(document).ready(function () { $("#generateDepositSlip").html(" Generate Deposit Split for Selected (" + selectedRows + ") Rows (PDF)"); }); - $('#deleteSelectedRows').click(function () { - var deletedRows = dataT.rows('.selected').data() - $("#deleteNumber").text(deletedRows.length); - $("#confirmDelete").modal('show'); - }); - - $('.exportButton').click(function (sender) { var selectedRows = dataT.rows('.selected').data() var type = this.getAttribute("data-exportType"); @@ -113,20 +106,4 @@ $(document).ready(function () { }); }); - $("#deleteConfirmed").click(function () { - var deletedRows = dataT.rows('.selected').data() - $.each(deletedRows, function (index, value) { - $.ajax({ - type: 'POST', // define the type of HTTP verb we want to use (POST for our form) - url: window.CRM.root + '/api/deposits/' + value.Id, // the url where we want to POST - dataType: 'json', // what type of data do we expect back from the server - encode: true, - data: {"_METHOD": "DELETE"} - }) - .done(function (data) { - $('#confirmDelete').modal('hide'); - dataT.rows('.selected').remove().draw(false); - }); - }); - }); }); diff --git a/src/skin/js/GroupView.js b/src/skin/js/GroupView.js index da973e02d7..bd9e544895 100644 --- a/src/skin/js/GroupView.js +++ b/src/skin/js/GroupView.js @@ -83,61 +83,70 @@ $(document).ready(function () { }); }); - $("#chkClear").change(function () { - if ($(this).is(":checked")) { - $("#deleteGroupButton").removeAttr("disabled"); - } - else { - $("#deleteGroupButton").attr("disabled", "disabled"); - } - }); - - $("#deleteGroupButton").on("click", function (e) { - $.ajax({ - method: "POST", - url: window.CRM.root + "/api/groups/" + window.CRM.currentGroup, - dataType: "json", - encode: true, - data: {"_METHOD": "DELETE"} - }).done(function (data) { - if (data.status == "success") - window.location.href = window.CRM.root + "/GroupList.php"; - }); - }); - $("#deleteSelectedRows").click(function () { var deletedRows = dataT.rows('.selected').data() - $.each(deletedRows, function (index, value) { - $.ajax({ - type: 'POST', // define the type of HTTP verb we want to use (POST for our form) - url: window.CRM.root + '/api/groups/' + window.CRM.currentGroup + '/removeuser/' + value.PersonId, // the url where we want to POST - dataType: 'json', // what type of data do we expect back from the server - data: {"_METHOD": "DELETE"}, - encode: true - }).done(function (data) { - dataT.row(function (idx, data, node) { - if (data.PersonId == value.PersonId) { - return true; - } - }).remove(); - dataT.rows().invalidate().draw(true); - }); + bootbox.confirm({ + message: "Are you sure you want to remove the " + deletedRows.length + " selected group members?", + buttons: { + confirm: { + label: 'Yes', + className: 'btn-success' + }, + cancel: { + label: 'No', + className: 'btn-danger' + } + }, + callback: function (result) + { + if (result) + { + $.each(deletedRows, function (index, value) { + $.ajax({ + type: 'POST', // define the type of HTTP verb we want to use (POST for our form) + url: window.CRM.root + '/api/groups/' + window.CRM.currentGroup + '/removeuser/' + value.PersonId, // the url where we want to POST + dataType: 'json', // what type of data do we expect back from the server + data: {"_METHOD": "DELETE"}, + encode: true + }).done(function (data) { + dataT.row(function (idx, data, node) { + if (data.PersonId == value.PersonId) { + return true; + } + }).remove(); + dataT.rows().invalidate().draw(true); + }); + }); + } + } }); + }); $("#addSelectedToCart").click(function () { - var selectedRows = dataT.rows('.selected').data() - $.each(selectedRows, function (index, value) { + if (dataT.rows('.selected').length > 0) + { + var selectedPersons = { + "Persons" : $.map(dataT.rows('.selected').data(), function(val,i){ + return val.PersonId; + }) + }; $.ajax({ - type: 'POST', // define the type of HTTP verb we want to use (POST for our form) - url: window.CRM.root + '/api/persons/' + value.PersonId + "/addToCart", // the url where we want to POST - dataType: 'json', // what type of data do we expect back from the server - encode: true + type: 'POST', + url: window.CRM.root + '/api/cart/', + dataType: 'json', + contentType: "application/json", + data: JSON.stringify(selectedPersons) + }).done(function(data) { + if ( data.status == "success" ) + { + location.reload(); + } }); - }); - location.reload(); - }); + } + }); + //copy membership $("#addSelectedToGroup").click(function () { $("#selectTargetGroupModal").modal("show"); diff --git a/src/sundayschool/SundaySchoolClassView.php b/src/sundayschool/SundaySchoolClassView.php index a2d8152903..278f8505f1 100644 --- a/src/sundayschool/SundaySchoolClassView.php +++ b/src/sundayschool/SundaySchoolClassView.php @@ -5,6 +5,7 @@ use ChurchCRM\dto\SystemConfig; use ChurchCRM\Service\SundaySchoolService; +use ChurchCRM\dto\SystemURLs; $sundaySchoolService = new SundaySchoolService(); @@ -127,7 +128,7 @@ class="fa fa-eye-slash"> - @@ -217,7 +219,7 @@ class="btn btn-primary btn-info btn-block">'; - echo " ".$child['firstName'].', '.$child['LastName'].''; + echo " ".$child['firstName'].', '.$child['LastName'].''; echo ''.$birthDate.''; echo "format('Y-m-d'))."'>"; echo ''.$child['kidEmail'].''; @@ -313,13 +315,13 @@ class="fa fa-envelope"> - + - + - + - - diff --git a/src/sundayschool/SundaySchoolDashboard.php b/src/sundayschool/SundaySchoolDashboard.php index d4b081c0a9..72ba74b7f7 100644 --- a/src/sundayschool/SundaySchoolDashboard.php +++ b/src/sundayschool/SundaySchoolDashboard.php @@ -4,6 +4,7 @@ use ChurchCRM\Service\DashboardService; use ChurchCRM\Service\SundaySchoolService; +use ChurchCRM\dto\SystemURLs; $dashboardService = new DashboardService(); $sundaySchoolService = new SundaySchoolService(); @@ -47,7 +48,8 @@ ?> -
    - @@ -273,8 +276,8 @@ class="fa fa-file-excel-o">
    }); - - diff --git a/vagrant/bootstrap.sh b/vagrant/bootstrap.sh index e28beeb9f6..528e5a98b2 100644 --- a/vagrant/bootstrap.sh +++ b/vagrant/bootstrap.sh @@ -56,6 +56,7 @@ sudo mysql -u"$DB_USER" -p"$DB_PASS" -e "INSERT INTO churchcrm.version_ver (ver_ echo "Database: development seed data deployed" cp /vagrant/vagrant/Config.php /vagrant/src/Include/ +cp /vagrant/BuildConfig.json.example /vagrant/BuildConfig.json echo "copied Config.php " cd /vagrant