229b180c |
1 | {* |
2 | +--------------------------------------------------------------------+ |
fee14197 |
3 | | CiviCRM version 5 | |
229b180c |
4 | +--------------------------------------------------------------------+ |
6b83d5bd |
5 | | Copyright CiviCRM LLC (c) 2004-2019 | |
229b180c |
6 | +--------------------------------------------------------------------+ |
7 | | This file is a part of CiviCRM. | |
8 | | | |
9 | | CiviCRM is free software; you can copy, modify, and distribute it | |
10 | | under the terms of the GNU affero General Public License | |
11 | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | |
12 | | | |
13 | | CiviCRM is distributed in the hope that it will be useful, but | |
14 | | WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
16 | | See the GNU Affero General Public License for more details. | |
17 | | | |
18 | | You should have received a copy of the GNU Affero General Public | |
19 | | License and the CiviCRM Licensing Exception along | |
20 | | with this program; if not, contact CiviCRM LLC | |
21 | | at info[AT]civicrm[DOT]org. If you have questions about the | |
22 | | GNU Affero General Public License or the licensing of CiviCRM, | |
23 | | see the CiviCRM license FAQ at http://civicrm.org/licensing | |
24 | +--------------------------------------------------------------------+ |
25 | *} |
26 | {assign var="class" value="_qf_AddTo"|cat:$contactType} |
27 | {assign var="refresh" value="$class"|cat:"_refresh"} |
28 | {assign var="cancel" value="$class"|cat:"_cancel"} |
29 | <div class="crm-block crm-form-block crm-contact-task-addto{$contactType}-form-block"> |
30 | <div class="help"> |
31 | {ts 1=$contactType}Choose Relationship Type and Target %1{/ts} |
32 | </div> |
33 | <table class="form-layout-compressed"> |
34 | <tr><td></td><td>{include file="CRM/Contact/Form/Task.tpl"}</td></tr> |
35 | {if $action EQ 2} {* action = update *} |
36 | <tr><td><label>{$sort_name}</label></td></tr> |
37 | {else} {* action = add *} |
38 | <tr class="crm-contact-task-addto{$contactType}-form-block-relationship_type_id"> |
39 | <td>{$form.relationship_type_id.label}</td> |
40 | <td>{$form.relationship_type_id.html}</td> |
41 | </tr> |
42 | <tr><td></td></tr> |
43 | <tr class="crm-contact-task-addto{$contactType}-form-block-name"> |
44 | <td>{$form.name.label}</td> |
45 | <td>{$form.name.html}</td> |
46 | </tr> |
47 | <tr><td></td><td>{$form.$refresh.html} {$form.$cancel.html}</td></tr> |
48 | </table> |
49 | {if $searchDone } {* Search button clicked *} |
50 | {if $searchCount} |
51 | {if $searchRows} {* we've got rows to display *} |
52 | <fieldset><legend>{ts}Mark Target Contact(s) for this Relationship{/ts}</legend> |
53 | <div class="description"> |
54 | {ts}Mark the target contact(s) for this relationship if it appears below. Otherwise you may modify the search name above and click Search again.{/ts} |
55 | </div> |
56 | {strip} |
57 | <table> |
58 | <tr class="columnheader"> |
59 | <td> </td> |
60 | <td>{ts}Name{/ts}</td> |
61 | <td>{ts}City{/ts}</td> |
62 | <td>{ts}State{/ts}</td> |
63 | <td>{ts}Email{/ts}</td> |
64 | <td>{ts}Phone{/ts}</td> |
65 | </tr> |
66 | {foreach from=$searchRows item=row} |
67 | <tr class="{cycle values="odd-row,even-row"}"> |
68 | <td>{$form.contact_check[$row.id].html}</td> |
69 | <td>{$row.type} {$row.name}</td> |
70 | <td>{$row.city}</td> |
71 | <td>{$row.state}</td> |
72 | <td>{$row.email}</td> |
73 | <td>{$row.phone}</td> |
74 | </tr> |
75 | {/foreach} |
76 | </table> |
77 | {/strip} |
78 | </fieldset> |
79 | {else} {* too many results - we're only displaying 50 *} |
80 | </div></fieldset> |
81 | {capture assign=infoTitle}{ts}Too many matching results{/ts}{/capture} |
82 | {capture assign=infoMessage}{ts}Please narrow your search by entering a more complete target contact name.{/ts}{/capture} |
83 | {include file="CRM/common/info.tpl"} |
84 | {/if} |
85 | {else} {* no valid matches for name + contact_type *} |
86 | </div></fieldset> |
87 | {capture assign=infoTitle}{ts}No matching results for{/ts}{/capture} |
88 | {capture assign=infoMessage}<ul><li>{ts 1=$form.name.value}Name like: %1{/ts}</li><li>{ts 1=$contact_type_display}Contact Type: %1{/ts}</li></ul>{ts}Check your spelling, or try fewer letters for the target contact name.{/ts}{/capture} |
89 | {include file="CRM/common/info.tpl"} |
90 | {/if} {* end if searchCount *} |
91 | {else} |
92 | </div></fieldset> |
93 | {/if} {* end if searchDone *} |
94 | {/if} {* end action = add *} |
95 | |
96 | {* Only show buttons if action=update, OR if we have $contacts (results)*} |
97 | {if $searchRows OR $action EQ 2} |
98 | <div class="form-item"> |
99 | |
100 | <div class="description"> |
101 | |
102 | </div> |
103 | <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl"}</div> |
104 | </div> |
105 | <div class="form-item"> |
106 | {$form.status.label} {$form.status.html} |
107 | </div> |
108 | |
109 | |
110 | </div></fieldset> |
111 | {/if} |