ipp_quickbase_devkit 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +87 -0
- data/README.rdoc +112 -0
- data/doc/QuickBaseClient.rb.htm +1896 -0
- data/doc/ReleaseNotes.txt +43 -0
- data/doc/qbc.makeCSVFile.qbc +4 -0
- data/doc/qbc.makeCSVFile.rb +4 -0
- data/doc/quickbase_adapter.rb.htm +399 -0
- data/examples/cookbookfiles/QuickBaseAPICookbook.html +2590 -0
- data/examples/cookbookfiles/addChangeRemoveUserRole.rb +21 -0
- data/examples/cookbookfiles/addOrEditRecord.rb +10 -0
- data/examples/cookbookfiles/application_object.rb +55 -0
- data/examples/cookbookfiles/applyRubyFormulas.rb +10 -0
- data/examples/cookbookfiles/average.rb +27 -0
- data/examples/cookbookfiles/backupApplication.rb +8 -0
- data/examples/cookbookfiles/cacheSchemas.rb +53 -0
- data/examples/cookbookfiles/calculateRunningTotals.rb +11 -0
- data/examples/cookbookfiles/copyrecords.rb +73 -0
- data/examples/cookbookfiles/count.rb +26 -0
- data/examples/cookbookfiles/createRecordNavigatorHTML.rb +42 -0
- data/examples/cookbookfiles/createReportDashboard.rb +35 -0
- data/examples/cookbookfiles/createTable.rb +12 -0
- data/examples/cookbookfiles/deviation.rb +25 -0
- data/examples/cookbookfiles/downloadCookbook.rb +97 -0
- data/examples/cookbookfiles/downloadFile.rb +10 -0
- data/examples/cookbookfiles/downloadFilesToFolder.rb +81 -0
- data/examples/cookbookfiles/downloadToTextFile.rb +64 -0
- data/examples/cookbookfiles/dumpSchema.rb +11 -0
- data/examples/cookbookfiles/duplicateRecord.rb +8 -0
- data/examples/cookbookfiles/dynamicMethods.rb +33 -0
- data/examples/cookbookfiles/editRecords.rb +15 -0
- data/examples/cookbookfiles/findJohnsLast10Records.rb +17 -0
- data/examples/cookbookfiles/findRubyRecords.rb +17 -0
- data/examples/cookbookfiles/formatCurrency.rb +24 -0
- data/examples/cookbookfiles/formatDate.rb +10 -0
- data/examples/cookbookfiles/formatDuration.rb +27 -0
- data/examples/cookbookfiles/formatPercent.rb +24 -0
- data/examples/cookbookfiles/getAllValuesForFields.rb +18 -0
- data/examples/cookbookfiles/getAppDTMInfo.rb +29 -0
- data/examples/cookbookfiles/getApplicationVariable.rb +5 -0
- data/examples/cookbookfiles/getChildTableDBID.rb +11 -0
- data/examples/cookbookfiles/getColumnListForReport.rb +6 -0
- data/examples/cookbookfiles/getFieldChoices.rb +13 -0
- data/examples/cookbookfiles/getFieldIDs.rb +6 -0
- data/examples/cookbookfiles/getFieldNames.rb +6 -0
- data/examples/cookbookfiles/getLastModTime.rb +8 -0
- data/examples/cookbookfiles/getLastRecModTime.rb +8 -0
- data/examples/cookbookfiles/getNumRecords.rb +8 -0
- data/examples/cookbookfiles/getNumTables.rb +4 -0
- data/examples/cookbookfiles/getRecord.rb +5 -0
- data/examples/cookbookfiles/getRecordDisplayURL.rb +13 -0
- data/examples/cookbookfiles/getRecordsAddedToday.rb +20 -0
- data/examples/cookbookfiles/getRecordsAsJSON.rb +6 -0
- data/examples/cookbookfiles/getReportNames.rb +25 -0
- data/examples/cookbookfiles/getRoleInfo.rb +48 -0
- data/examples/cookbookfiles/getServerStatus.rb +11 -0
- data/examples/cookbookfiles/getSortListForReport.rb +6 -0
- data/examples/cookbookfiles/getTableIDs.rb +6 -0
- data/examples/cookbookfiles/getTableName.rb +8 -0
- data/examples/cookbookfiles/getTableNames.rb +25 -0
- data/examples/cookbookfiles/getTimeCreated.rb +8 -0
- data/examples/cookbookfiles/getTimeInMilliseconds.rb +5 -0
- data/examples/cookbookfiles/getUserInfo.rb +26 -0
- data/examples/cookbookfiles/getUserRole.rb +15 -0
- data/examples/cookbookfiles/intranet.rb +101 -0
- data/examples/cookbookfiles/isAverageField.rb +17 -0
- data/examples/cookbookfiles/isDbidString.rb +8 -0
- data/examples/cookbookfiles/isTotalField.rb +16 -0
- data/examples/cookbookfiles/iterateDBPages.rb +8 -0
- data/examples/cookbookfiles/iterateFilteredRecords.rb +12 -0
- data/examples/cookbookfiles/iterateJoinRecords.rb +68 -0
- data/examples/cookbookfiles/iterateRecordInfos.rb +8 -0
- data/examples/cookbookfiles/iterateRecords.rb +23 -0
- data/examples/cookbookfiles/iterateSummaryRecords.rb +13 -0
- data/examples/cookbookfiles/iterateUnionRecords.rb +38 -0
- data/examples/cookbookfiles/listAccessibleApplications.rb +6 -0
- data/examples/cookbookfiles/logRequestAndResponseXML.rb +8 -0
- data/examples/cookbookfiles/lookupFieldPropertyByName.rb +62 -0
- data/examples/cookbookfiles/lookupFieldTypeByName.rb +10 -0
- data/examples/cookbookfiles/makeCSVFile.rb +4 -0
- data/examples/cookbookfiles/makeSlideShow.rb +42 -0
- data/examples/cookbookfiles/makerecs.rb +64 -0
- data/examples/cookbookfiles/max.rb +26 -0
- data/examples/cookbookfiles/min.rb +26 -0
- data/examples/cookbookfiles/percent.rb +29 -0
- data/examples/cookbookfiles/printChildElements.rb +54 -0
- data/examples/cookbookfiles/printNewRecords.rb +12 -0
- data/examples/cookbookfiles/processRESTRequest.rb +21 -0
- data/examples/cookbookfiles/provisionAndInviteNewUser.rb +13 -0
- data/examples/cookbookfiles/purgeRecords.rb +15 -0
- data/examples/cookbookfiles/quickbase_adapter.rb.htm +397 -0
- data/examples/cookbookfiles/quickbase_record_finder.zip +0 -0
- data/examples/cookbookfiles/recordAndFieldIterator.rb +24 -0
- data/examples/cookbookfiles/runImport.rb +9 -0
- data/examples/cookbookfiles/runQuickBaseTwitterConnector.rb +41 -0
- data/examples/cookbookfiles/sendToQuickBase.rb +33 -0
- data/examples/cookbookfiles/setDBvar.rb +6 -0
- data/examples/cookbookfiles/showRequestAndResponseXML.rb +8 -0
- data/examples/cookbookfiles/sqlQuery.rb +11 -0
- data/examples/cookbookfiles/stopOnError.rb +10 -0
- data/examples/cookbookfiles/sum.rb +26 -0
- data/examples/cookbookfiles/twitterFromQuickBase.rb +42 -0
- data/examples/cookbookfiles/twitterWithQuickBase.rb +36 -0
- data/examples/cookbookfiles/uploadCSVData.rb +20 -0
- data/examples/cookbookfiles/uploadExcelData.rb +22 -0
- data/examples/cookbookfiles/uploadFileEveryHour.rb +18 -0
- data/examples/cookbookfiles/uploadFileIntoNewRecord.rb +8 -0
- data/examples/cookbookfiles/uploadFilesFromFolder.exe +0 -0
- data/examples/cookbookfiles/uploadFilesFromFolder.rb +69 -0
- data/examples/cookbookfiles/useCompanyURL.rb +12 -0
- data/examples/cookbookfiles/userRoles.rb +49 -0
- data/examples/cookbookfiles/watchCommunityForum.rb +5 -0
- data/examples/cookbookfiles/wikifyTable.rb +29 -0
- data/examples/cookbookfiles/xmlShortcuts.rb +33 -0
- data/examples/pmp/app/controllers/application.rb +7 -0
- data/examples/pmp/app/controllers/contacts_controller.rb +8 -0
- data/examples/pmp/app/controllers/document_library_controller.rb +2 -0
- data/examples/pmp/app/controllers/issues_controller.rb +5 -0
- data/examples/pmp/app/controllers/projects_controller.rb +22 -0
- data/examples/pmp/app/controllers/resources_controller.rb +2 -0
- data/examples/pmp/app/controllers/tasks_controller.rb +13 -0
- data/examples/pmp/app/controllers/time_cards_controller.rb +5 -0
- data/examples/pmp/app/helpers/application_helper.rb +3 -0
- data/examples/pmp/app/helpers/contacts_helper.rb +2 -0
- data/examples/pmp/app/helpers/document_library_helper.rb +2 -0
- data/examples/pmp/app/helpers/issues_helper.rb +2 -0
- data/examples/pmp/app/helpers/projects_helper.rb +2 -0
- data/examples/pmp/app/helpers/resources_helper.rb +2 -0
- data/examples/pmp/app/helpers/tasks_helper.rb +2 -0
- data/examples/pmp/app/helpers/time_cards_helper.rb +2 -0
- data/examples/pmp/app/models/contacts.rb +26 -0
- data/examples/pmp/app/models/document_library.rb +2 -0
- data/examples/pmp/app/models/issues.rb +6 -0
- data/examples/pmp/app/models/projects.rb +26 -0
- data/examples/pmp/app/models/resources.rb +2 -0
- data/examples/pmp/app/models/tasks.rb +12 -0
- data/examples/pmp/app/models/time_cards.rb +7 -0
- data/examples/pmp/app/schemas/contacts.xml +1 -0
- data/examples/pmp/app/schemas/document_library.xml +1 -0
- data/examples/pmp/app/schemas/issues.xml +1 -0
- data/examples/pmp/app/schemas/pmp.xml +1 -0
- data/examples/pmp/app/schemas/projects.xml +1 -0
- data/examples/pmp/app/schemas/readme.txt +8 -0
- data/examples/pmp/app/schemas/resources.xml +1 -0
- data/examples/pmp/app/schemas/tasks.xml +1 -0
- data/examples/pmp/app/schemas/time_cards.xml +1 -0
- data/examples/pmp/app/views/contacts/companies.rhtml +31 -0
- data/examples/pmp/app/views/contacts/project_contacts.rhtml +31 -0
- data/examples/pmp/app/views/issues/filter_issues.rhtml +26 -0
- data/examples/pmp/app/views/layouts/application.rhtml +56 -0
- data/examples/pmp/app/views/projects/all_projects.rhtml +33 -0
- data/examples/pmp/app/views/projects/home.rhtml +11 -0
- data/examples/pmp/app/views/projects/my_open_projects.rhtml +27 -0
- data/examples/pmp/app/views/projects/open_projects.rhtml +44 -0
- data/examples/pmp/app/views/projects/project_sorted_by_company.rhtml +40 -0
- data/examples/pmp/app/views/projects/projects_sorted_by_priority.rhtml +30 -0
- data/examples/pmp/app/views/projects/updated_projects.rhtml +0 -0
- data/examples/pmp/app/views/tasks/all_tasks.rhtml +27 -0
- data/examples/pmp/app/views/tasks/search.rhtml +23 -0
- data/examples/pmp/app/views/tasks/search2.rhtml +23 -0
- data/examples/pmp/app/views/tasks/search3.rhtml +23 -0
- data/examples/pmp/app/views/time_cards/summary.rhtml +38 -0
- data/examples/pmp/config/boot.rb +45 -0
- data/examples/pmp/config/database.yml +30 -0
- data/examples/pmp/config/environment.rb +60 -0
- data/examples/pmp/config/environments/development.rb +21 -0
- data/examples/pmp/config/environments/production.rb +18 -0
- data/examples/pmp/config/environments/test.rb +19 -0
- data/examples/pmp/config/routes.rb +23 -0
- data/examples/pmp/db/migrate/001_create_projects.rb +10 -0
- data/examples/pmp/db/migrate/002_create_tasks.rb +10 -0
- data/examples/pmp/db/migrate/003_create_issues.rb +10 -0
- data/examples/pmp/db/migrate/004_create_document_libraries.rb +10 -0
- data/examples/pmp/db/migrate/005_create_resources.rb +10 -0
- data/examples/pmp/db/migrate/006_create_time_cards.rb +10 -0
- data/examples/pmp/db/migrate/007_create_contacts.rb +10 -0
- data/examples/pmp/public/404.html +30 -0
- data/examples/pmp/public/500.html +30 -0
- data/examples/pmp/public/app.index.html +277 -0
- data/examples/pmp/public/dispatch.cgi +10 -0
- data/examples/pmp/public/dispatch.fcgi +24 -0
- data/examples/pmp/public/dispatch.rb +10 -0
- data/examples/pmp/public/favicon.ico +0 -0
- data/examples/pmp/public/images/rails.png +0 -0
- data/examples/pmp/public/javascripts/application.js +2 -0
- data/examples/pmp/public/javascripts/controls.js +833 -0
- data/examples/pmp/public/javascripts/dragdrop.js +942 -0
- data/examples/pmp/public/javascripts/effects.js +1088 -0
- data/examples/pmp/public/javascripts/prototype.js +2515 -0
- data/examples/pmp/public/robots.txt +1 -0
- data/examples/pmp/test/fixtures/contacts.yml +5 -0
- data/examples/pmp/test/fixtures/document_libraries.yml +5 -0
- data/examples/pmp/test/fixtures/issues.yml +5 -0
- data/examples/pmp/test/fixtures/projects.yml +5 -0
- data/examples/pmp/test/fixtures/resources.yml +5 -0
- data/examples/pmp/test/fixtures/tasks.yml +5 -0
- data/examples/pmp/test/fixtures/time_cards.yml +5 -0
- data/examples/pmp/test/functional/contacts_controller_test.rb +18 -0
- data/examples/pmp/test/functional/document_library_controller_test.rb +18 -0
- data/examples/pmp/test/functional/issues_controller_test.rb +18 -0
- data/examples/pmp/test/functional/projects_controller_test.rb +18 -0
- data/examples/pmp/test/functional/resources_controller_test.rb +18 -0
- data/examples/pmp/test/functional/tasks_controller_test.rb +18 -0
- data/examples/pmp/test/functional/time_cards_controller_test.rb +18 -0
- data/examples/pmp/test/test_helper.rb +28 -0
- data/examples/pmp/test/unit/contacts_test.rb +10 -0
- data/examples/pmp/test/unit/document_library_test.rb +10 -0
- data/examples/pmp/test/unit/issues_test.rb +10 -0
- data/examples/pmp/test/unit/projects_test.rb +10 -0
- data/examples/pmp/test/unit/resources_test.rb +10 -0
- data/examples/pmp/test/unit/tasks_test.rb +10 -0
- data/examples/pmp/test/unit/time_cards_test.rb +10 -0
- data/lib/QuickBaseClient.rb +5054 -0
- data/lib/QuickBaseCommandLineClient.rb +401 -0
- data/lib/QuickBaseContactsAppBuilder.rb +419 -0
- data/lib/QuickBaseEmailer.rb +334 -0
- data/lib/QuickBaseEventNotifier.rb +592 -0
- data/lib/QuickBaseMisc.rb +96 -0
- data/lib/QuickBaseObjects.rb +566 -0
- data/lib/QuickBaseRSSGenerator.rb +286 -0
- data/lib/QuickBaseTextData.rb +545 -0
- data/lib/QuickBaseTwitterConnector.rb +300 -0
- data/lib/QuickBaseWebClient.rb +126 -0
- data/lib/WorkPlaceClient.rb +45 -0
- data/lib/qbc.makeCSVFile.qbc +4 -0
- data/lib/qbc.makeCSVFile.rb +17 -0
- data/lib/quickbase_adapter.rb +320 -0
- data/lib/runFieldEntryDialog.rb +151 -0
- data/lib/runOfflineFieldEntryDialog.rb +203 -0
- data/rakefile +100 -0
- data/test/run_tests.bat +7 -0
- data/test/spec_all_tests.rb +13 -0
- data/test/spec_smoke_tests.rb +58 -0
- data/test/spec_workplace_addrecord_test.rb +46 -0
- data/test/spec_workplace_base_test.rb +57 -0
- data/test/spec_workplace_editrecord_test.rb +38 -0
- data/test/spec_workplace_json_test.rb +38 -0
- data/test/spec_workplace_objects_test.rb +39 -0
- data/test/spec_workplace_smoke_tests.rb +45 -0
- metadata +353 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<h1>All Projects</h1>
|
|
2
|
+
|
|
3
|
+
This View shows how to display records using the names of QuickBase queries and fields.
|
|
4
|
+
<p>
|
|
5
|
+
Queries defined in the QuickBase UI (i.e. 'Table' Reports) include filtering and sorting criteria and the list of columns to display.
|
|
6
|
+
The list of @projects is retrieved from QuickBase using <i>find_by_sql("All Projects")</i> in the <i>projects.rb</i> model class.
|
|
7
|
+
The list of fields in the QuickBase 'All Projects' report is retrieved using <i>reportFields = connection.raw_connection.clist.split('.')</i>
|
|
8
|
+
in the <i>projects.rb</i> model class, and controls the list of columns displayed below using <i>column.quickBaseFieldAttributes["quickBaseFieldId"]</i>.
|
|
9
|
+
<p>
|
|
10
|
+
See the <i>QuickBaseColumn</i> class in quickbase_adapter.rb to understand how this works.
|
|
11
|
+
<hr>
|
|
12
|
+
|
|
13
|
+
<table border="1">
|
|
14
|
+
|
|
15
|
+
<tr>
|
|
16
|
+
<% Projects.columns.each { |column| %>
|
|
17
|
+
<% if @reportColumns.include?(column.quickBaseFieldAttributes["quickBaseFieldId"]) %>
|
|
18
|
+
<td><b><%= column.human_name %></b></td>
|
|
19
|
+
<% end %>
|
|
20
|
+
<% } %>
|
|
21
|
+
</tr>
|
|
22
|
+
|
|
23
|
+
<% for project in @projects do %>
|
|
24
|
+
<tr>
|
|
25
|
+
<% Projects.columns.each { |column| %>
|
|
26
|
+
<% if @reportColumns.include?(column.quickBaseFieldAttributes["quickBaseFieldId"]) %>
|
|
27
|
+
<td><%= project[column.human_name] %></td>
|
|
28
|
+
<% end %>
|
|
29
|
+
<% } %>
|
|
30
|
+
</tr>
|
|
31
|
+
<% end %>
|
|
32
|
+
|
|
33
|
+
</table>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
<b>
|
|
3
|
+
Click on the links on the left to see different ways to retrieve records from QuickBase.
|
|
4
|
+
<p>
|
|
5
|
+
You can retrieve records using ActiveRecord 'find' calls, hard-coded SQL SELECT statements,
|
|
6
|
+
QuickBase Reports, and queries written in the QuickBase query language.
|
|
7
|
+
<p>
|
|
8
|
+
You can also retrieve data from any QuickBase table you have access to, even if it's not in
|
|
9
|
+
the QuickBase application associated with your Rails application.
|
|
10
|
+
|
|
11
|
+
</b>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<h1>My Open Projects</h1>
|
|
2
|
+
|
|
3
|
+
This View shows how to display records using a QuickBase query and Rails methods to retrieve column
|
|
4
|
+
data. Note that column names that contain spaces must be accessed using a string. If you don't see any
|
|
5
|
+
records listed below, add a Projects record in QuickBase and make yourself the Project Lead.
|
|
6
|
+
|
|
7
|
+
<hr>
|
|
8
|
+
|
|
9
|
+
<table border="1">
|
|
10
|
+
|
|
11
|
+
<tr>
|
|
12
|
+
<td><b>Name</b></td>
|
|
13
|
+
<td><b>Priority</b></td>
|
|
14
|
+
<td><b>Status</b></td>
|
|
15
|
+
<td><b>Percent Complete</b></td>
|
|
16
|
+
</tr>
|
|
17
|
+
|
|
18
|
+
<% for project in @projects do %>
|
|
19
|
+
<tr>
|
|
20
|
+
<td><%= project.attributes["Project Name"] %></td>
|
|
21
|
+
<td><%= project.Priority %></td>
|
|
22
|
+
<td><%= project.Status %></td>
|
|
23
|
+
<td><%= project["Percent Complete"] %></td>
|
|
24
|
+
</tr>
|
|
25
|
+
<% end %>
|
|
26
|
+
|
|
27
|
+
</table>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<h1>Open Projects</h1>
|
|
2
|
+
|
|
3
|
+
This View shows how to display records using a QuickBase query and Rails methods to retrieve column
|
|
4
|
+
data. Note that column names that contain spaces must be accessed using a string.
|
|
5
|
+
<p>
|
|
6
|
+
This view also shows the counts of Projects by status in the form of sentences.
|
|
7
|
+
This is a basic example of something that is impossible to do within the regular QuickBase UI.
|
|
8
|
+
|
|
9
|
+
<hr>
|
|
10
|
+
|
|
11
|
+
<% statusCount = {} %>
|
|
12
|
+
|
|
13
|
+
<table border="1">
|
|
14
|
+
|
|
15
|
+
<tr>
|
|
16
|
+
<td><b>Name</b></td>
|
|
17
|
+
<td><b>Priority</b></td>
|
|
18
|
+
<td><b>Status</b></td>
|
|
19
|
+
<td><b>Estimated Project Start Date</b></td>
|
|
20
|
+
<td><b>Planned Finish Date</b></td>
|
|
21
|
+
</tr>
|
|
22
|
+
|
|
23
|
+
<% for project in @projects do %>
|
|
24
|
+
<tr>
|
|
25
|
+
<td><%= project.attributes["Project Name"] %></td>
|
|
26
|
+
<td><%= project.Priority %></td>
|
|
27
|
+
<td><%= project.Status %></td>
|
|
28
|
+
<% statusCount[project.Status] ||= 0 %>
|
|
29
|
+
<% statusCount[project.Status] += 1 %>
|
|
30
|
+
<td><%= project["Estimated Project Start Date"] %></td>
|
|
31
|
+
<td><%= project["Planned Finish Date"] %></td>
|
|
32
|
+
</tr>
|
|
33
|
+
<% end %>
|
|
34
|
+
|
|
35
|
+
</table>
|
|
36
|
+
|
|
37
|
+
<hr>
|
|
38
|
+
|
|
39
|
+
<b>
|
|
40
|
+
<% statusCount.each{|key,value| %>
|
|
41
|
+
<p>The number of <%= key %> projects is <%= value %>.
|
|
42
|
+
<% } %>
|
|
43
|
+
</b>
|
|
44
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<h1>Project sorted by Company</h1>
|
|
2
|
+
|
|
3
|
+
This View shows how to switch the rows and columns from a QuickBase Report.
|
|
4
|
+
|
|
5
|
+
<hr>
|
|
6
|
+
|
|
7
|
+
<table border="1">
|
|
8
|
+
|
|
9
|
+
<tr>
|
|
10
|
+
<td></td>
|
|
11
|
+
<% for project in @projects do %>
|
|
12
|
+
<td><b><%= project.Company %></b></td>
|
|
13
|
+
<% end %>
|
|
14
|
+
</tr>
|
|
15
|
+
|
|
16
|
+
<tr>
|
|
17
|
+
<td><b>Project Name</b></td>
|
|
18
|
+
<% for project in @projects do %>
|
|
19
|
+
<td><%= project["Project Name"] %></td>
|
|
20
|
+
<% end %>
|
|
21
|
+
</tr>
|
|
22
|
+
|
|
23
|
+
<tr>
|
|
24
|
+
<td><b>Project Priority</b></td>
|
|
25
|
+
<% for project in @projects do %>
|
|
26
|
+
<td><%= project.Priority %></td>
|
|
27
|
+
<% end %>
|
|
28
|
+
</tr>
|
|
29
|
+
|
|
30
|
+
<tr>
|
|
31
|
+
<td><b>Project Status</b></td>
|
|
32
|
+
<% for project in @projects do %>
|
|
33
|
+
<td><%= project.Status %></td>
|
|
34
|
+
<% end %>
|
|
35
|
+
</tr>
|
|
36
|
+
|
|
37
|
+
</table>
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<h1>Projects sorted by Priority, displayed from left to right</h1>
|
|
2
|
+
|
|
3
|
+
The model method <i>Projects.projects_sorted_by_priority</i>, in projects.rb, shows how to
|
|
4
|
+
get records using the low-level <i>execute</i> method from the QuickBase adapter. Note that using
|
|
5
|
+
<i>execute</i> effectively bypasses ActiveRecord, but you can access column values using Ruby's
|
|
6
|
+
Hash syntax, e.g. <i>project["Project Name"]</i>
|
|
7
|
+
|
|
8
|
+
<hr>
|
|
9
|
+
|
|
10
|
+
<table border="1">
|
|
11
|
+
|
|
12
|
+
<tr>
|
|
13
|
+
<td><b>Project Name</b></td>
|
|
14
|
+
<% for project in @projects do %>
|
|
15
|
+
<td><%= project["Project Name"] %></td>
|
|
16
|
+
<% end %>
|
|
17
|
+
</tr>
|
|
18
|
+
|
|
19
|
+
<tr>
|
|
20
|
+
<td><b>Project Summary</b></td>
|
|
21
|
+
<% for project in @projects do %>
|
|
22
|
+
<td><%= project["Project Summary"] %></td>
|
|
23
|
+
<% end %>
|
|
24
|
+
</tr>
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
</table>
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
File without changes
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<h1>All Tasks</h1>
|
|
2
|
+
|
|
3
|
+
This View shows how to display records from QuickBase without any model code and without
|
|
4
|
+
ActiveRecord, by using the underlying QuickBase API directly.
|
|
5
|
+
<p>
|
|
6
|
+
It breaks the MVC paradigm, but it's not the end of the world!
|
|
7
|
+
<hr>
|
|
8
|
+
<% fieldNames = Array["Project Phase","Task Name","Duration", "Milestone","Start","Calculated Finish Date","Days Overdue","Status","Priority","% Complete"] %>
|
|
9
|
+
|
|
10
|
+
<table border="1">
|
|
11
|
+
<tr>
|
|
12
|
+
<% fieldNames.each{|fieldName| %>
|
|
13
|
+
<td><b><%= fieldName %></b></td>
|
|
14
|
+
<% } %>
|
|
15
|
+
</tr>
|
|
16
|
+
|
|
17
|
+
<% dbid = ActiveRecord::Base.connection.setActiveTable("Tasks") %>
|
|
18
|
+
<% qbClient = ActiveRecord::Base.connection.raw_connection %>
|
|
19
|
+
<% qbClient.iterateRecords(dbid, fieldNames, nil,nil, "All Tasks") { |task| %>
|
|
20
|
+
<tr>
|
|
21
|
+
<% fieldNames.each{ |fieldName| %>
|
|
22
|
+
<td><%= qbClient.formatFieldValue(task[fieldName],qbClient.lookupFieldTypeByName(fieldName)) %></td>
|
|
23
|
+
<% } %>
|
|
24
|
+
</tr>
|
|
25
|
+
<% } %>
|
|
26
|
+
|
|
27
|
+
</table>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<h1>Tasks: find all records for which any field contains '<%= params[:s] %>'</h1>
|
|
2
|
+
|
|
3
|
+
This View shows how to search QuickBase records using the query language in the QuickBase HTTP API.
|
|
4
|
+
<hr>
|
|
5
|
+
|
|
6
|
+
<% fieldNames = Array["Project Name","Project Phase","Task Name","Milestone","Duration", "Start","Calculated Finish Date","Actual Finish Date","Days Overdue","% Complete","Status","Priority"] %>
|
|
7
|
+
|
|
8
|
+
<table border="1">
|
|
9
|
+
<tr>
|
|
10
|
+
<% fieldNames.each{|fieldName| %>
|
|
11
|
+
<td><b><%= fieldName %></b></td>
|
|
12
|
+
<% } %>
|
|
13
|
+
</tr>
|
|
14
|
+
|
|
15
|
+
<% for task in @tasks do %>
|
|
16
|
+
<tr>
|
|
17
|
+
<% fieldNames.each{ |fieldName| %>
|
|
18
|
+
<td><%= task[fieldName] %></td>
|
|
19
|
+
<% } %>
|
|
20
|
+
</tr>
|
|
21
|
+
<% end %>
|
|
22
|
+
|
|
23
|
+
</table>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<h1>Tasks with Status = '<%= params[:status] %>'</h1>
|
|
2
|
+
|
|
3
|
+
This View shows how to search QuickBase records using a simple SQL statement.
|
|
4
|
+
<hr>
|
|
5
|
+
|
|
6
|
+
<% fieldNames = Array["Project Name","Project Phase","Task Name","Milestone","Duration", "Start","Calculated Finish Date","Actual Finish Date","Days Overdue","% Complete","Status","Priority"] %>
|
|
7
|
+
|
|
8
|
+
<table border="1">
|
|
9
|
+
<tr>
|
|
10
|
+
<% fieldNames.each{|fieldName| %>
|
|
11
|
+
<td><b><%= fieldName %></b></td>
|
|
12
|
+
<% } %>
|
|
13
|
+
</tr>
|
|
14
|
+
|
|
15
|
+
<% for task in @tasks do %>
|
|
16
|
+
<tr>
|
|
17
|
+
<% fieldNames.each{ |fieldName| %>
|
|
18
|
+
<td><%= task[fieldName] %></td>
|
|
19
|
+
<% } %>
|
|
20
|
+
</tr>
|
|
21
|
+
<% end %>
|
|
22
|
+
|
|
23
|
+
</table>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<h1>Tasks with Status = '<%= params[:status] %>'</h1>
|
|
2
|
+
|
|
3
|
+
This View shows how to search QuickBase records using a Rails 'find_all_by_??' method call.
|
|
4
|
+
<hr>
|
|
5
|
+
|
|
6
|
+
<% fieldNames = Array["Project Name","Project Phase","Task Name","Milestone","Duration", "Start","Calculated Finish Date","Actual Finish Date","Days Overdue","% Complete","Status","Priority"] %>
|
|
7
|
+
|
|
8
|
+
<table border="1">
|
|
9
|
+
<tr>
|
|
10
|
+
<% fieldNames.each{|fieldName| %>
|
|
11
|
+
<td><b><%= fieldName %></b></td>
|
|
12
|
+
<% } %>
|
|
13
|
+
</tr>
|
|
14
|
+
|
|
15
|
+
<% for task in @tasks do %>
|
|
16
|
+
<tr>
|
|
17
|
+
<% fieldNames.each{ |fieldName| %>
|
|
18
|
+
<td><%= task[fieldName] %></td>
|
|
19
|
+
<% } %>
|
|
20
|
+
</tr>
|
|
21
|
+
<% end %>
|
|
22
|
+
|
|
23
|
+
</table>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<h1>Time Cards</h1>
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
<hr>
|
|
5
|
+
|
|
6
|
+
<% fieldList = Array["Project Name","Week Starting On","Sun","Mon","Tue","Wed","Thu","Fri","Sat","Weekly Total"] %>
|
|
7
|
+
<% totalFieldList = Array["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Weekly Total"] %>
|
|
8
|
+
<% totals = {} %>
|
|
9
|
+
<% totalFieldList.each {|fieldName| totals[fieldName] = 0} %>
|
|
10
|
+
|
|
11
|
+
<table border="1">
|
|
12
|
+
|
|
13
|
+
<tr>
|
|
14
|
+
<% fieldList.each {|fieldName| %>
|
|
15
|
+
<td><b><%= fieldName %></b></td>
|
|
16
|
+
<% } %>
|
|
17
|
+
</tr>
|
|
18
|
+
|
|
19
|
+
<% for rec in @time_cards do %>
|
|
20
|
+
<tr>
|
|
21
|
+
<% fieldList.each {|fieldName| %>
|
|
22
|
+
<td><%= rec[fieldName] %></td>
|
|
23
|
+
<% } %>
|
|
24
|
+
</tr>
|
|
25
|
+
<% totalFieldList.each {|fieldName| totals[fieldName] += rec[fieldName].to_i } %>
|
|
26
|
+
<% end %>
|
|
27
|
+
|
|
28
|
+
<tr>
|
|
29
|
+
<% fieldList.each {|fieldName| %>
|
|
30
|
+
<% if totalFieldList.include?(fieldName) %>
|
|
31
|
+
<td><b><%= totals[fieldName] %></b></td>
|
|
32
|
+
<% else %>
|
|
33
|
+
<td></td>
|
|
34
|
+
<% end %>
|
|
35
|
+
<% } %>
|
|
36
|
+
</tr>
|
|
37
|
+
|
|
38
|
+
</table>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb
|
|
2
|
+
|
|
3
|
+
unless defined?(RAILS_ROOT)
|
|
4
|
+
root_path = File.join(File.dirname(__FILE__), '..')
|
|
5
|
+
|
|
6
|
+
unless RUBY_PLATFORM =~ /(:?mswin|mingw)/
|
|
7
|
+
require 'pathname'
|
|
8
|
+
root_path = Pathname.new(root_path).cleanpath(true).to_s
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
RAILS_ROOT = root_path
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
unless defined?(Rails::Initializer)
|
|
15
|
+
if File.directory?("#{RAILS_ROOT}/vendor/rails")
|
|
16
|
+
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
|
17
|
+
else
|
|
18
|
+
require 'rubygems'
|
|
19
|
+
|
|
20
|
+
environment_without_comments = IO.readlines(File.dirname(__FILE__) + '/environment.rb').reject { |l| l =~ /^#/ }.join
|
|
21
|
+
environment_without_comments =~ /[^#]RAILS_GEM_VERSION = '([\d.]+)'/
|
|
22
|
+
rails_gem_version = $1
|
|
23
|
+
|
|
24
|
+
if version = defined?(RAILS_GEM_VERSION) ? RAILS_GEM_VERSION : rails_gem_version
|
|
25
|
+
# Asking for 1.1.6 will give you 1.1.6.5206, if available -- makes it easier to use beta gems
|
|
26
|
+
rails_gem = Gem.cache.search('rails', "~>#{version}.0").sort_by { |g| g.version.version }.last
|
|
27
|
+
|
|
28
|
+
if rails_gem
|
|
29
|
+
gem "rails", "=#{rails_gem.version.version}"
|
|
30
|
+
require rails_gem.full_gem_path + '/lib/initializer'
|
|
31
|
+
else
|
|
32
|
+
STDERR.puts %(Cannot find gem for Rails ~>#{version}.0:
|
|
33
|
+
Install the missing gem with 'gem install -v=#{version} rails', or
|
|
34
|
+
change environment.rb to define RAILS_GEM_VERSION with your desired version.
|
|
35
|
+
)
|
|
36
|
+
exit 1
|
|
37
|
+
end
|
|
38
|
+
else
|
|
39
|
+
gem "rails"
|
|
40
|
+
require 'initializer'
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
Rails::Initializer.run(:set_load_path)
|
|
45
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
development:
|
|
2
|
+
adapter: quickbase
|
|
3
|
+
database: Project Manager Plus
|
|
4
|
+
username:
|
|
5
|
+
password:
|
|
6
|
+
printRequestsAndResponses: false
|
|
7
|
+
cacheSchemas: true
|
|
8
|
+
decimalPrecision: 38
|
|
9
|
+
host: localhost
|
|
10
|
+
|
|
11
|
+
# Warning: The database defined as 'test' will be erased and
|
|
12
|
+
# re-generated from your development database when you run 'rake'.
|
|
13
|
+
# Do not set this db to the same as development or production.
|
|
14
|
+
test:
|
|
15
|
+
adapter: quickbase
|
|
16
|
+
database: Project Manager Plus
|
|
17
|
+
username:
|
|
18
|
+
password:
|
|
19
|
+
cacheSchemas: true
|
|
20
|
+
decimalPrecision: 38
|
|
21
|
+
host: localhost
|
|
22
|
+
|
|
23
|
+
production:
|
|
24
|
+
adapter: quickbase
|
|
25
|
+
database: Project Manager Plus
|
|
26
|
+
username:
|
|
27
|
+
password:
|
|
28
|
+
cacheSchemas: true
|
|
29
|
+
decimalPrecision: 38
|
|
30
|
+
host: localhost
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Be sure to restart your web server when you modify this file.
|
|
2
|
+
|
|
3
|
+
# Uncomment below to force Rails into production mode when
|
|
4
|
+
# you don't control web/app server and can't set it the proper way
|
|
5
|
+
# ENV['RAILS_ENV'] ||= 'production'
|
|
6
|
+
|
|
7
|
+
# Specifies gem version of Rails to use when vendor/rails is not present
|
|
8
|
+
RAILS_GEM_VERSION = '1.2.3' unless defined? RAILS_GEM_VERSION
|
|
9
|
+
|
|
10
|
+
# Bootstrap the Rails environment, frameworks, and default configuration
|
|
11
|
+
require File.join(File.dirname(__FILE__), 'boot')
|
|
12
|
+
|
|
13
|
+
Rails::Initializer.run do |config|
|
|
14
|
+
# Settings in config/environments/* take precedence over those specified here
|
|
15
|
+
|
|
16
|
+
# Skip frameworks you're not going to use (only works if using vendor/rails)
|
|
17
|
+
# config.frameworks -= [ :action_web_service, :action_mailer ]
|
|
18
|
+
|
|
19
|
+
# Only load the plugins named here, by default all plugins in vendor/plugins are loaded
|
|
20
|
+
# config.plugins = %W( exception_notification ssl_requirement )
|
|
21
|
+
|
|
22
|
+
# Add additional load paths for your own custom dirs
|
|
23
|
+
# config.load_paths += %W( #{RAILS_ROOT}/extras )
|
|
24
|
+
|
|
25
|
+
# Force all environments to use the same logger level
|
|
26
|
+
# (by default production uses :info, the others :debug)
|
|
27
|
+
# config.log_level = :debug
|
|
28
|
+
|
|
29
|
+
# Use the database for sessions instead of the file system
|
|
30
|
+
# (create the session table with 'rake db:sessions:create')
|
|
31
|
+
# config.action_controller.session_store = :active_record_store
|
|
32
|
+
|
|
33
|
+
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
|
34
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
|
35
|
+
# like if you have constraints or database-specific column types
|
|
36
|
+
# config.active_record.schema_format = :sql
|
|
37
|
+
|
|
38
|
+
# Activate observers that should always be running
|
|
39
|
+
# config.active_record.observers = :cacher, :garbage_collector
|
|
40
|
+
|
|
41
|
+
# Make Active Record use UTC-base instead of local time
|
|
42
|
+
# config.active_record.default_timezone = :utc
|
|
43
|
+
|
|
44
|
+
# See Rails::Configuration for more options
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Add new inflection rules using the following format
|
|
48
|
+
# (all these examples are active by default):
|
|
49
|
+
# Inflector.inflections do |inflect|
|
|
50
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
|
51
|
+
# inflect.singular /^(ox)en/i, '\1'
|
|
52
|
+
# inflect.irregular 'person', 'people'
|
|
53
|
+
# inflect.uncountable %w( fish sheep )
|
|
54
|
+
# end
|
|
55
|
+
|
|
56
|
+
# Add new mime types for use in respond_to blocks:
|
|
57
|
+
# Mime::Type.register "text/richtext", :rtf
|
|
58
|
+
# Mime::Type.register "application/x-mobile", :mobile
|
|
59
|
+
|
|
60
|
+
# Include your application configuration below
|