forked from kurund/CiviMobile-Prototype
-
Notifications
You must be signed in to change notification settings - Fork 0
/
diff.txt
101 lines (91 loc) · 4.15 KB
/
diff.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
diff --git a/templates/civimobile.contact.tpl.php b/templates/civimobile.contact.tpl.php
index 60e2e12..6187484 100644
--- a/templates/civimobile.contact.tpl.php
+++ b/templates/civimobile.contact.tpl.php
@@ -1,4 +1,4 @@
-<?php
+ <?php
$url = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
$parse_url = parse_url($url, PHP_URL_PATH);
diff --git a/templates/civimobile.contact_list.tpl.php b/templates/civimobile.contact_list.tpl.php
index 8c14564..04842d1 100644
--- a/templates/civimobile.contact_list.tpl.php
+++ b/templates/civimobile.contact_list.tpl.php
@@ -4,6 +4,8 @@
<div id="jqm-contactsheader" data-role="header">
<h3>Search Contacts</h3>
<a href="/civimobile" data-ajax="false" data-direction="reverse" data-role="button" data-icon="home" data-iconpos="notext" class="ui-btn-right jqm-home">Home</a>
+ <a href="#" id="add-contact-button" data-role="button" data-icon="plus" class="ui-btn-left jqm-home">Add</a>
+ <a href="#" id="back-contact-button" data-role="button" data-icon="arrow-l" class="ui-btn-left jqm-home" style="display:none">Back</a>
</div>
@@ -17,30 +19,26 @@
<div style="display:none" id="add_contact">
<div data-role="fieldcontain">
- <label for="name">First Name</label>
- <input type="text" name="first_name" id="first_name" value="" />
+ <input type="text" name="first_name" id="first_name" value="" placeholder="First Name" />
</div>
<div data-role="fieldcontain">
- <label for="name">Last Name</label>
- <input type="text" name="last_name" id="last_name" value="" />
+ <input type="text" name="last_name" id="last_name" value="" placeholder="Last Name" />
</div>
<div data-role="fieldcontain">
- <label for="name">Email</label>
- <input type="email" name="email" id="email" value="" />
+ <input type="email" name="email" id="email" value="" placeholder="Email" />
</div>
<div data-role="fieldcontain">
- <label for="name">Phone</label>
- <input type="tel" name="tel" id="tel" value="" />
+ <input type="tel" name="tel" id="tel" value="" placeholder="Phone" />
</div>
<div data-role="fieldcontain">
- <label for="textarea">Note:</label>
- <textarea cols="40" rows="8" name="note" id="note"></textarea>
+ <textarea cols="40" rows="8" name="note" id="note" placeholder="Note"></textarea>
</div>
- <a href="#" id="save-contact" data-role="button">Save Contact</a>
+ <a href="#" id="save-contact" data-role="button" data-theme="b">Save Contact</a>
</div>
<script>
+
$( function(){
<?php
@@ -61,6 +59,23 @@ $( function(){
});
+ $('#add-contact-button').click(function(){ addContact(); });
+ $('#back-contact-button').click(function(){ goBack(); });
+
+function goBack() {
+ $('#back-contact-button').hide();
+ $('#add_contact').hide();
+ $('#contacts').show();
+ $('#add-contact-button').show();
+ }
+function addContact() {
+ $('#contact-content').append($('#add_contact'));
+ $('#contacts').hide();
+ $('#add-contact-button').hide();
+ $('#add_contact').show();
+ $('#back-contact-button').show();
+ $('#save-contact').click(function(){ createContact(); });
+}
function contactSearch (q){
$.mobile.showPageLoadingMsg( 'Searching' );
@@ -70,11 +85,11 @@ function contactSearch (q){
success:function (data){
if (data.count == 0) {
cmd = null;
- $('#contact-content').append($('#add_contact'));
+ // $('#contact-content').append($('#add_contact'));
$('#contacts').hide();
- $('#add_contact').show();
- populateContactForm();
- $('#save-contact').click(function(){ createContact(); });
+ // $('#add_contact').show();
+ // populateContactForm();
+ // $('#save-contact').click(function(){ createContact(); });
}
else {
cmd = "refresh";