@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | // Protection to avoid direct call of template |
4 | 4 | if (empty($conf) || ! is_object($conf)) |
5 | 5 | { |
6 | - print "Error, template page can't be called as URL"; |
|
7 | - exit; |
|
6 | + print "Error, template page can't be called as URL"; |
|
7 | + exit; |
|
8 | 8 | } |
9 | 9 | |
10 | 10 | // Require |
@@ -56,59 +56,59 @@ discard block |
||
56 | 56 | // List of comments |
57 | 57 | if (!empty($object->comments)) |
58 | 58 | { |
59 | - // Default color for current user |
|
60 | - $TColors = array($user->id => array('bgcolor'=>'efefef','color'=>'555')); |
|
61 | - $first = true; |
|
62 | - foreach($object->comments as $comment) |
|
63 | - { |
|
64 | - $fk_user = $comment->fk_user_author; |
|
65 | - $userstatic->fetch($fk_user); |
|
66 | - |
|
67 | - if(empty($TColors[$fk_user])) { |
|
68 | - $bgcolor = random_color(180,240); |
|
69 | - if(!empty($userstatic->color)) { |
|
70 | - $bgcolor = $userstatic->color; |
|
71 | - } |
|
72 | - $color = (colorIsLight($bgcolor))?'555':'fff'; |
|
73 | - $TColors[$fk_user] = array('bgcolor'=>$bgcolor,'color'=>$color); |
|
74 | - } |
|
75 | - print '<div class="width100p" style="color:#'.$TColors[$fk_user]['color'].'">'; |
|
76 | - if ($fk_user != $user->id) { |
|
77 | - print '<div class="width25p float"> </div>'; |
|
78 | - } |
|
79 | - |
|
80 | - print '<div class="width75p float comment comment-table" style="background-color:#'.$TColors[$fk_user]['bgcolor'].'">'; |
|
81 | - print '<div class="comment-info comment-cell">'; |
|
82 | - if (! empty($user->photo)) |
|
83 | - { |
|
84 | - print Form::showphoto('userphoto', $userstatic, 80, 0, 0, '', 'small', 0, 1).'<br/>'; |
|
85 | - } |
|
86 | - print $langs->trans('User').' : '.$userstatic->getNomUrl().'<br/>'; |
|
87 | - print $langs->trans('Date').' : '.dol_print_date($comment->datec,'dayhoursec'); |
|
88 | - print '</div>'; // End comment-info |
|
89 | - |
|
90 | - print '<div class="comment-cell comment-right">'; |
|
91 | - print '<div class="comment-table width100p">'; |
|
92 | - print '<div class="comment-description comment-cell">'; |
|
93 | - print $comment->description; |
|
94 | - print '</div>'; // End comment-description |
|
95 | - if(($first && $fk_user == $user->id) || $user->admin == 1) { |
|
96 | - print '<a class="comment-delete comment-cell" href="'.$varpage.'?action=deletecomment&id='.$id.'&withproject=1&idcomment='.$comment->id.'" title="'.$langs->trans('Delete').'">'; |
|
97 | - print img_picto('', 'delete.png'); |
|
98 | - print '</a>'; |
|
99 | - } |
|
100 | - print '</div>'; // End comment-table |
|
101 | - print '</div>'; // End comment-right |
|
102 | - print '</div>'; // End comment |
|
103 | - |
|
104 | - if($fk_user == $user->id) { |
|
105 | - print '<div class="width25p float"> </div>'; |
|
106 | - } |
|
107 | - print '<div class="clearboth"></div>'; |
|
108 | - print '</div>'; // end 100p |
|
109 | - |
|
110 | - $first = false; |
|
111 | - } |
|
59 | + // Default color for current user |
|
60 | + $TColors = array($user->id => array('bgcolor'=>'efefef','color'=>'555')); |
|
61 | + $first = true; |
|
62 | + foreach($object->comments as $comment) |
|
63 | + { |
|
64 | + $fk_user = $comment->fk_user_author; |
|
65 | + $userstatic->fetch($fk_user); |
|
66 | + |
|
67 | + if(empty($TColors[$fk_user])) { |
|
68 | + $bgcolor = random_color(180,240); |
|
69 | + if(!empty($userstatic->color)) { |
|
70 | + $bgcolor = $userstatic->color; |
|
71 | + } |
|
72 | + $color = (colorIsLight($bgcolor))?'555':'fff'; |
|
73 | + $TColors[$fk_user] = array('bgcolor'=>$bgcolor,'color'=>$color); |
|
74 | + } |
|
75 | + print '<div class="width100p" style="color:#'.$TColors[$fk_user]['color'].'">'; |
|
76 | + if ($fk_user != $user->id) { |
|
77 | + print '<div class="width25p float"> </div>'; |
|
78 | + } |
|
79 | + |
|
80 | + print '<div class="width75p float comment comment-table" style="background-color:#'.$TColors[$fk_user]['bgcolor'].'">'; |
|
81 | + print '<div class="comment-info comment-cell">'; |
|
82 | + if (! empty($user->photo)) |
|
83 | + { |
|
84 | + print Form::showphoto('userphoto', $userstatic, 80, 0, 0, '', 'small', 0, 1).'<br/>'; |
|
85 | + } |
|
86 | + print $langs->trans('User').' : '.$userstatic->getNomUrl().'<br/>'; |
|
87 | + print $langs->trans('Date').' : '.dol_print_date($comment->datec,'dayhoursec'); |
|
88 | + print '</div>'; // End comment-info |
|
89 | + |
|
90 | + print '<div class="comment-cell comment-right">'; |
|
91 | + print '<div class="comment-table width100p">'; |
|
92 | + print '<div class="comment-description comment-cell">'; |
|
93 | + print $comment->description; |
|
94 | + print '</div>'; // End comment-description |
|
95 | + if(($first && $fk_user == $user->id) || $user->admin == 1) { |
|
96 | + print '<a class="comment-delete comment-cell" href="'.$varpage.'?action=deletecomment&id='.$id.'&withproject=1&idcomment='.$comment->id.'" title="'.$langs->trans('Delete').'">'; |
|
97 | + print img_picto('', 'delete.png'); |
|
98 | + print '</a>'; |
|
99 | + } |
|
100 | + print '</div>'; // End comment-table |
|
101 | + print '</div>'; // End comment-right |
|
102 | + print '</div>'; // End comment |
|
103 | + |
|
104 | + if($fk_user == $user->id) { |
|
105 | + print '<div class="width25p float"> </div>'; |
|
106 | + } |
|
107 | + print '<div class="clearboth"></div>'; |
|
108 | + print '</div>'; // end 100p |
|
109 | + |
|
110 | + $first = false; |
|
111 | + } |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | print '<br>'; |
@@ -47,484 +47,484 @@ |
||
47 | 47 | </script>'; |
48 | 48 | |
49 | 49 | |
50 | - print_fiche_titre($langs->trans("AdvTgtTitle")); |
|
51 | - |
|
52 | - print '<div class="tabBar">' . "\n"; |
|
53 | - print '<form name="find_customer" id="find_customer" action="' . $_SERVER['PHP_SELF'] . '?id=' . $id . '" method="POST">' . "\n"; |
|
54 | - print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">' . "\n"; |
|
55 | - print '<input type="hidden" name="action" value="">' . "\n"; |
|
56 | - print '<table class="border" width="100%">' . "\n"; |
|
57 | - |
|
58 | - print '<tr>' . "\n"; |
|
59 | - print '<td colspan="3" align="right">' . "\n"; |
|
60 | - |
|
61 | - print '<input type="button" name="addcontact" id="addcontact" value="' . $langs->trans('AdvTgtAddContact') . '" class="butAction"/>' . "\n"; |
|
62 | - |
|
63 | - print '</td>' . "\n"; |
|
64 | - print '</tr>' . "\n"; |
|
65 | - |
|
66 | - print '<tr><td>' . $langs->trans('AdvTgtNameTemplate') . '</td><td>'; |
|
67 | - if (! empty($template_id)) { |
|
68 | - $default_template = $template_id; |
|
69 | - } else { |
|
70 | - $default_template = $advTarget->id; |
|
71 | - } |
|
72 | - print $formadvtargetemaling->selectAdvtargetemailingTemplate('template_id', $default_template,0,$advTarget->type_element); |
|
73 | - print '<input type="button" name="loadfilter" id="loadfilter" value="' . $langs->trans('AdvTgtLoadFilter') . '" class="butAction"/>'; |
|
74 | - print '<input type="button" name="deletefilter" id="deletefilter" value="' . $langs->trans('AdvTgtDeleteFilter') . '" class="butAction"/>'; |
|
75 | - print '<input type="button" name="savefilter" id="savefilter" value="' . $langs->trans('AdvTgtSaveFilter') . '" class="butAction"/>'; |
|
76 | - print $langs->trans('AdvTgtOrCreateNewFilter'); |
|
77 | - print '<input type="text" name="template_name" id="template_name" value=""/>'; |
|
78 | - print '<input type="button" name="createfilter" id="createfilter" value="' . $langs->trans('AdvTgtCreateFilter') . '" class="butAction"/>'; |
|
79 | - print '</td><td>' . "\n"; |
|
80 | - print '</td></tr>' . "\n"; |
|
81 | - |
|
82 | - print '<tr><td>' . $langs->trans('AdvTgtTypeOfIncude') . '</td><td>'; |
|
83 | - print $form->selectarray('type_of_target', $advTarget->select_target_type, $array_query['type_of_target']); |
|
84 | - print '</td><td>' . "\n"; |
|
85 | - print $form->textwithpicto('', $langs->trans("AdvTgtTypeOfIncudeHelp"), 1, 'help'); |
|
86 | - print '</td></tr>' . "\n"; |
|
87 | - |
|
88 | - // Customer name |
|
89 | - print '<tr><td>' . $langs->trans('ThirdPartyName'); |
|
90 | - if (! empty($array_query['cust_name'])) { |
|
91 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
92 | - } |
|
93 | - print '</td><td><input type="text" name="cust_name" value="' . $array_query['cust_name'] . '"/></td><td>' . "\n"; |
|
94 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
95 | - print '</td></tr>' . "\n"; |
|
96 | - |
|
97 | - // Code Client |
|
98 | - print '<tr><td>' . $langs->trans('CustomerCode'); |
|
99 | - if (! empty($array_query['cust_code'])) { |
|
100 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
101 | - } |
|
102 | - print '</td><td><input type="text" name="cust_code" value="' . $array_query['cust_code'] . '"/></td><td>' . "\n"; |
|
103 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
104 | - print '</td></tr>' . "\n"; |
|
105 | - |
|
106 | - // Address Client |
|
107 | - print '<tr><td>' . $langs->trans('Address'); |
|
108 | - if (! empty($array_query['cust_adress'])) { |
|
109 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
110 | - } |
|
111 | - print '</td><td><input type="text" name="cust_adress" value="' . $array_query['cust_adress'] . '"/></td><td>' . "\n"; |
|
112 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
113 | - print '</td></tr>' . "\n"; |
|
114 | - |
|
115 | - // Zip Client |
|
116 | - print '<tr><td>' . $langs->trans('Zip'); |
|
117 | - if (! empty($array_query['cust_zip'])) { |
|
118 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
119 | - } |
|
120 | - print '</td><td><input type="text" name="cust_zip" value="' . $array_query['cust_zip'] . '"/></td><td>' . "\n"; |
|
121 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
122 | - print '</td></tr>' . "\n"; |
|
123 | - |
|
124 | - // City Client |
|
125 | - print '<tr><td>' . $langs->trans('Town'); |
|
126 | - if (! empty($array_query['cust_city'])) { |
|
127 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
128 | - } |
|
129 | - print '</td><td><input type="text" name="cust_city" value="' . $array_query['cust_city'] . '"/></td><td>' . "\n"; |
|
130 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
131 | - print '</td></tr>' . "\n"; |
|
132 | - |
|
133 | - // Customer Country |
|
134 | - print '<tr><td>' . $langs->trans("Country"); |
|
135 | - if (count($array_query['cust_country']) > 0) { |
|
136 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
137 | - } |
|
138 | - print '</td><td>' . "\n"; |
|
139 | - print $formadvtargetemaling->multiselectCountry('cust_country', $array_query['cust_country']); |
|
140 | - print '</td><td>' . "\n"; |
|
141 | - print '</td></tr>' . "\n"; |
|
142 | - |
|
143 | - // State Customer |
|
144 | - print '<tr><td>' . $langs->trans('Status') . ' ' . $langs->trans('ThirdParty'); |
|
145 | - if (count($array_query['cust_status']) > 0) { |
|
146 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
147 | - } |
|
148 | - print '</td><td>'; |
|
149 | - print $formadvtargetemaling->advMultiselectarray('cust_status', array ( |
|
150 | - '0' => $langs->trans('ActivityCeased'), |
|
151 | - '1' => $langs->trans('InActivity') |
|
152 | - ), $array_query['cust_status']); |
|
153 | - print '</td><td>' . "\n"; |
|
154 | - print '</td></tr>' . "\n"; |
|
155 | - |
|
156 | - // Mother Company |
|
157 | - print '<tr><td>' . $langs->trans("Maison mère"); |
|
158 | - if (! empty($array_query['cust_mothercompany'])) { |
|
159 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
160 | - } |
|
161 | - print '</td><td>' . "\n"; |
|
162 | - print '<input type="text" name="cust_mothercompany" value="' . $array_query['cust_mothercompany'] . '"/>'; |
|
163 | - print '</td><td>' . "\n"; |
|
164 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
165 | - print '</td></tr>' . "\n"; |
|
166 | - |
|
167 | - // Prospect/Customer |
|
168 | - $selected = $array_query['cust_typecust']; |
|
169 | - print '<tr><td>' . $langs->trans('ProspectCustomer') . ' ' . $langs->trans('ThirdParty'); |
|
170 | - if (count($array_query['cust_typecust']) > 0) { |
|
171 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
172 | - } |
|
173 | - print '</td><td>'; |
|
174 | - $options_array = array ( |
|
175 | - 2 => $langs->trans('Prospect'), |
|
176 | - 3 => $langs->trans('ProspectCustomer'), |
|
177 | - 1 => $langs->trans('Customer'), |
|
178 | - 0 => $langs->trans('NorProspectNorCustomer') |
|
179 | - ); |
|
180 | - print $formadvtargetemaling->advMultiselectarray('cust_typecust', $options_array, $array_query['cust_typecust']); |
|
181 | - print '</td><td>' . "\n"; |
|
182 | - print '</td></tr>' . "\n"; |
|
183 | - |
|
184 | - // Prospection status |
|
185 | - print '<tr><td>' . $langs->trans('ProspectLevel'); |
|
186 | - if (count($array_query['cust_prospect_status']) > 0) { |
|
187 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
188 | - } |
|
189 | - print '</td><td>'; |
|
190 | - print $formadvtargetemaling->multiselectProspectionStatus($array_query['cust_prospect_status'], 'cust_prospect_status', 1); |
|
191 | - print '</td><td>' . "\n"; |
|
192 | - print '</td></tr>' . "\n"; |
|
193 | - |
|
194 | - // Prospection comm status |
|
195 | - print '<tr><td>' . $langs->trans('StatusProsp'); |
|
196 | - if (count($array_query['cust_comm_status']) > 0) { |
|
197 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
198 | - } |
|
199 | - print '</td><td>'; |
|
200 | - print $formadvtargetemaling->advMultiselectarray('cust_comm_status', $advTarget->type_statuscommprospect, $array_query['cust_comm_status']); |
|
201 | - print '</td><td>' . "\n"; |
|
202 | - print '</td></tr>' . "\n"; |
|
203 | - |
|
204 | - // Customer Type |
|
205 | - print '<tr><td>' . $langs->trans("ThirdPartyType"); |
|
206 | - if (count($array_query['cust_typeent']) > 0) { |
|
207 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
208 | - } |
|
209 | - print '</td><td>' . "\n"; |
|
210 | - print $formadvtargetemaling->advMultiselectarray('cust_typeent', $formcompany->typent_array(0, " AND id <> 0"), $array_query['cust_typeent']); |
|
211 | - print '</td><td>' . "\n"; |
|
212 | - print '</td></tr>' . "\n"; |
|
213 | - |
|
214 | - // Staff number |
|
215 | - print '<td>' . $langs->trans("Staff"); |
|
216 | - if (count($array_query['cust_effectif_id']) > 0) { |
|
217 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
218 | - } |
|
219 | - print '</td><td>'; |
|
220 | - print $formadvtargetemaling->advMultiselectarray("cust_effectif_id", $formcompany->effectif_array(0, " AND id <> 0"), $array_query['cust_effectif_id']); |
|
221 | - print '</td><td>' . "\n"; |
|
222 | - print '</td></tr>' . "\n"; |
|
223 | - |
|
224 | - // Sales manager |
|
225 | - print '<tr><td>' . $langs->trans("SalesRepresentatives"); |
|
226 | - if (count($array_query['cust_saleman']) > 0) { |
|
227 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
228 | - } |
|
229 | - print '</td><td>' . "\n"; |
|
230 | - print $formadvtargetemaling->multiselectselectSalesRepresentatives('cust_saleman', $array_query['cust_saleman'], $user); |
|
231 | - print '</td><td>' . "\n"; |
|
232 | - print '</td></tr>' . "\n"; |
|
233 | - |
|
234 | - // Customer Default Langauge |
|
235 | - if (! empty($conf->global->MAIN_MULTILANGS)) { |
|
236 | - |
|
237 | - print '<tr><td>' . $langs->trans("DefaultLang"); |
|
238 | - if (count($array_query['cust_language']) > 0) { |
|
239 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
240 | - } |
|
241 | - print '</td><td>' . "\n"; |
|
242 | - print $formadvtargetemaling->multiselectselectLanguage('cust_language', $array_query['cust_language']); |
|
243 | - print '</td><td>' . "\n"; |
|
244 | - print '</td></tr>' . "\n"; |
|
245 | - } |
|
246 | - |
|
247 | - if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) { |
|
248 | - // Customer Categories |
|
249 | - print '<tr><td>' . $langs->trans("CustomersCategoryShort"); |
|
250 | - if (count($array_query['cust_categ']) > 0) { |
|
251 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
252 | - } |
|
253 | - print '</td><td>' . "\n"; |
|
254 | - print $formadvtargetemaling->multiselectCustomerCategories('cust_categ', $array_query['cust_categ']); |
|
255 | - print '</td><td>' . "\n"; |
|
256 | - print '</td></tr>' . "\n"; |
|
257 | - } |
|
258 | - |
|
259 | - // Standard Extrafield feature |
|
260 | - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { |
|
261 | - // fetch optionals attributes and labels |
|
262 | - dol_include_once('/core/class/extrafields.class.php'); |
|
263 | - $extrafields = new ExtraFields($db); |
|
264 | - $extralabels = $extrafields->fetch_name_optionals_label('societe'); |
|
265 | - foreach ( $extralabels as $key => $val ) { |
|
266 | - if ($key != 'ts_nameextra' && $key != 'ts_payeur') { |
|
267 | - print '<tr><td>' . $extrafields->attribute_label[$key]; |
|
268 | - if (! empty($array_query['options_' . $key]) || (is_array($array_query['options_' . $key]) && count($array_query['options_' . $key]) > 0)) { |
|
269 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
270 | - } |
|
271 | - print '</td><td>'; |
|
272 | - if (($extrafields->attribute_type[$key] == 'varchar') || ($extrafields->attribute_type[$key] == 'text')) { |
|
273 | - print '<input type="text" name="options_' . $key . '"/></td><td>' . "\n"; |
|
274 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
275 | - } elseif (($extrafields->attribute_type[$key] == 'int') || ($extrafields->attribute_type[$key] == 'double')) { |
|
276 | - print $langs->trans("AdvTgtMinVal") . '<input type="text" name="options' . $key . '_min"/>'; |
|
277 | - print $langs->trans("AdvTgtMaxVal") . '<input type="text" name="options' . $key . '_max"/>'; |
|
278 | - print '</td><td>' . "\n"; |
|
279 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchIntHelp"), 1, 'help'); |
|
280 | - } elseif (($extrafields->attribute_type[$key] == 'date') || ($extrafields->attribute_type[$key] == 'datetime')) { |
|
281 | - |
|
282 | - print '<table class="nobordernopadding"><tr>'; |
|
283 | - print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
284 | - print $form->selectDate('', 'options_' . $key . '_st_dt'); |
|
285 | - print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
286 | - print $form->selectDate('', 'options_' . $key . '_end_dt'); |
|
287 | - print '</td></tr></table>'; |
|
288 | - |
|
289 | - print '</td><td>' . "\n"; |
|
290 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help'); |
|
291 | - } elseif (($extrafields->attribute_type[$key] == 'boolean')) { |
|
292 | - print $form->selectarray('options_' . $key, array ( |
|
293 | - '' => '', |
|
294 | - '1' => $langs->trans('Yes'), |
|
295 | - '0' => $langs->trans('No') |
|
296 | - ), $array_query['options_' . $key]); |
|
297 | - print '</td><td>' . "\n"; |
|
298 | - } elseif (($extrafields->attribute_type[$key] == 'select')) { |
|
299 | - print $formadvtargetemaling->advMultiselectarray('options_' . $key, $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key]); |
|
300 | - print '</td><td>' . "\n"; |
|
301 | - } elseif (($extrafields->attribute_type[$key] == 'sellist')) { |
|
302 | - print $formadvtargetemaling->advMultiselectarraySelllist('options_' . $key, $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key]); |
|
303 | - print '</td><td>' . "\n"; |
|
304 | - } else { |
|
305 | - |
|
306 | - print '<table class="nobordernopadding"><tr>'; |
|
307 | - print '<td></td><td>'; |
|
308 | - if (is_array($array_query['options_' . $key])) { |
|
309 | - print $extrafields->showInputField($key, implode(',', $array_query['options_' . $key])); |
|
310 | - } else { |
|
311 | - print $extrafields->showInputField($key, $array_query['options_' . $key]); |
|
312 | - } |
|
313 | - print '</td></tr></table>'; |
|
314 | - |
|
315 | - print '</td><td>' . "\n"; |
|
316 | - } |
|
317 | - print '</td></tr>' . "\n"; |
|
318 | - } |
|
319 | - } |
|
320 | - } else { |
|
321 | - $std_soc = new Societe($db); |
|
322 | - $action_search = 'query'; |
|
323 | - |
|
324 | - // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context |
|
325 | - include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; |
|
326 | - $hookmanager = new HookManager($db); |
|
327 | - $hookmanager->initHooks(array ('thirdpartycard')); |
|
328 | - |
|
329 | - $parameters=array(); |
|
330 | - if (! empty($advTarget->id)) { |
|
331 | - $parameters = array('array_query' => $advTarget->filtervalue); |
|
332 | - } |
|
333 | - // Other attributes |
|
334 | - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $std_soc, $action_search); |
|
50 | + print_fiche_titre($langs->trans("AdvTgtTitle")); |
|
51 | + |
|
52 | + print '<div class="tabBar">' . "\n"; |
|
53 | + print '<form name="find_customer" id="find_customer" action="' . $_SERVER['PHP_SELF'] . '?id=' . $id . '" method="POST">' . "\n"; |
|
54 | + print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">' . "\n"; |
|
55 | + print '<input type="hidden" name="action" value="">' . "\n"; |
|
56 | + print '<table class="border" width="100%">' . "\n"; |
|
57 | + |
|
58 | + print '<tr>' . "\n"; |
|
59 | + print '<td colspan="3" align="right">' . "\n"; |
|
60 | + |
|
61 | + print '<input type="button" name="addcontact" id="addcontact" value="' . $langs->trans('AdvTgtAddContact') . '" class="butAction"/>' . "\n"; |
|
62 | + |
|
63 | + print '</td>' . "\n"; |
|
64 | + print '</tr>' . "\n"; |
|
65 | + |
|
66 | + print '<tr><td>' . $langs->trans('AdvTgtNameTemplate') . '</td><td>'; |
|
67 | + if (! empty($template_id)) { |
|
68 | + $default_template = $template_id; |
|
69 | + } else { |
|
70 | + $default_template = $advTarget->id; |
|
71 | + } |
|
72 | + print $formadvtargetemaling->selectAdvtargetemailingTemplate('template_id', $default_template,0,$advTarget->type_element); |
|
73 | + print '<input type="button" name="loadfilter" id="loadfilter" value="' . $langs->trans('AdvTgtLoadFilter') . '" class="butAction"/>'; |
|
74 | + print '<input type="button" name="deletefilter" id="deletefilter" value="' . $langs->trans('AdvTgtDeleteFilter') . '" class="butAction"/>'; |
|
75 | + print '<input type="button" name="savefilter" id="savefilter" value="' . $langs->trans('AdvTgtSaveFilter') . '" class="butAction"/>'; |
|
76 | + print $langs->trans('AdvTgtOrCreateNewFilter'); |
|
77 | + print '<input type="text" name="template_name" id="template_name" value=""/>'; |
|
78 | + print '<input type="button" name="createfilter" id="createfilter" value="' . $langs->trans('AdvTgtCreateFilter') . '" class="butAction"/>'; |
|
79 | + print '</td><td>' . "\n"; |
|
80 | + print '</td></tr>' . "\n"; |
|
81 | + |
|
82 | + print '<tr><td>' . $langs->trans('AdvTgtTypeOfIncude') . '</td><td>'; |
|
83 | + print $form->selectarray('type_of_target', $advTarget->select_target_type, $array_query['type_of_target']); |
|
84 | + print '</td><td>' . "\n"; |
|
85 | + print $form->textwithpicto('', $langs->trans("AdvTgtTypeOfIncudeHelp"), 1, 'help'); |
|
86 | + print '</td></tr>' . "\n"; |
|
87 | + |
|
88 | + // Customer name |
|
89 | + print '<tr><td>' . $langs->trans('ThirdPartyName'); |
|
90 | + if (! empty($array_query['cust_name'])) { |
|
91 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
92 | + } |
|
93 | + print '</td><td><input type="text" name="cust_name" value="' . $array_query['cust_name'] . '"/></td><td>' . "\n"; |
|
94 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
95 | + print '</td></tr>' . "\n"; |
|
96 | + |
|
97 | + // Code Client |
|
98 | + print '<tr><td>' . $langs->trans('CustomerCode'); |
|
99 | + if (! empty($array_query['cust_code'])) { |
|
100 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
101 | + } |
|
102 | + print '</td><td><input type="text" name="cust_code" value="' . $array_query['cust_code'] . '"/></td><td>' . "\n"; |
|
103 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
104 | + print '</td></tr>' . "\n"; |
|
105 | + |
|
106 | + // Address Client |
|
107 | + print '<tr><td>' . $langs->trans('Address'); |
|
108 | + if (! empty($array_query['cust_adress'])) { |
|
109 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
110 | + } |
|
111 | + print '</td><td><input type="text" name="cust_adress" value="' . $array_query['cust_adress'] . '"/></td><td>' . "\n"; |
|
112 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
113 | + print '</td></tr>' . "\n"; |
|
114 | + |
|
115 | + // Zip Client |
|
116 | + print '<tr><td>' . $langs->trans('Zip'); |
|
117 | + if (! empty($array_query['cust_zip'])) { |
|
118 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
119 | + } |
|
120 | + print '</td><td><input type="text" name="cust_zip" value="' . $array_query['cust_zip'] . '"/></td><td>' . "\n"; |
|
121 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
122 | + print '</td></tr>' . "\n"; |
|
123 | + |
|
124 | + // City Client |
|
125 | + print '<tr><td>' . $langs->trans('Town'); |
|
126 | + if (! empty($array_query['cust_city'])) { |
|
127 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
128 | + } |
|
129 | + print '</td><td><input type="text" name="cust_city" value="' . $array_query['cust_city'] . '"/></td><td>' . "\n"; |
|
130 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
131 | + print '</td></tr>' . "\n"; |
|
132 | + |
|
133 | + // Customer Country |
|
134 | + print '<tr><td>' . $langs->trans("Country"); |
|
135 | + if (count($array_query['cust_country']) > 0) { |
|
136 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
137 | + } |
|
138 | + print '</td><td>' . "\n"; |
|
139 | + print $formadvtargetemaling->multiselectCountry('cust_country', $array_query['cust_country']); |
|
140 | + print '</td><td>' . "\n"; |
|
141 | + print '</td></tr>' . "\n"; |
|
142 | + |
|
143 | + // State Customer |
|
144 | + print '<tr><td>' . $langs->trans('Status') . ' ' . $langs->trans('ThirdParty'); |
|
145 | + if (count($array_query['cust_status']) > 0) { |
|
146 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
147 | + } |
|
148 | + print '</td><td>'; |
|
149 | + print $formadvtargetemaling->advMultiselectarray('cust_status', array ( |
|
150 | + '0' => $langs->trans('ActivityCeased'), |
|
151 | + '1' => $langs->trans('InActivity') |
|
152 | + ), $array_query['cust_status']); |
|
153 | + print '</td><td>' . "\n"; |
|
154 | + print '</td></tr>' . "\n"; |
|
155 | + |
|
156 | + // Mother Company |
|
157 | + print '<tr><td>' . $langs->trans("Maison mère"); |
|
158 | + if (! empty($array_query['cust_mothercompany'])) { |
|
159 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
160 | + } |
|
161 | + print '</td><td>' . "\n"; |
|
162 | + print '<input type="text" name="cust_mothercompany" value="' . $array_query['cust_mothercompany'] . '"/>'; |
|
163 | + print '</td><td>' . "\n"; |
|
164 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
165 | + print '</td></tr>' . "\n"; |
|
166 | + |
|
167 | + // Prospect/Customer |
|
168 | + $selected = $array_query['cust_typecust']; |
|
169 | + print '<tr><td>' . $langs->trans('ProspectCustomer') . ' ' . $langs->trans('ThirdParty'); |
|
170 | + if (count($array_query['cust_typecust']) > 0) { |
|
171 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
172 | + } |
|
173 | + print '</td><td>'; |
|
174 | + $options_array = array ( |
|
175 | + 2 => $langs->trans('Prospect'), |
|
176 | + 3 => $langs->trans('ProspectCustomer'), |
|
177 | + 1 => $langs->trans('Customer'), |
|
178 | + 0 => $langs->trans('NorProspectNorCustomer') |
|
179 | + ); |
|
180 | + print $formadvtargetemaling->advMultiselectarray('cust_typecust', $options_array, $array_query['cust_typecust']); |
|
181 | + print '</td><td>' . "\n"; |
|
182 | + print '</td></tr>' . "\n"; |
|
183 | + |
|
184 | + // Prospection status |
|
185 | + print '<tr><td>' . $langs->trans('ProspectLevel'); |
|
186 | + if (count($array_query['cust_prospect_status']) > 0) { |
|
187 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
188 | + } |
|
189 | + print '</td><td>'; |
|
190 | + print $formadvtargetemaling->multiselectProspectionStatus($array_query['cust_prospect_status'], 'cust_prospect_status', 1); |
|
191 | + print '</td><td>' . "\n"; |
|
192 | + print '</td></tr>' . "\n"; |
|
193 | + |
|
194 | + // Prospection comm status |
|
195 | + print '<tr><td>' . $langs->trans('StatusProsp'); |
|
196 | + if (count($array_query['cust_comm_status']) > 0) { |
|
197 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
198 | + } |
|
199 | + print '</td><td>'; |
|
200 | + print $formadvtargetemaling->advMultiselectarray('cust_comm_status', $advTarget->type_statuscommprospect, $array_query['cust_comm_status']); |
|
201 | + print '</td><td>' . "\n"; |
|
202 | + print '</td></tr>' . "\n"; |
|
203 | + |
|
204 | + // Customer Type |
|
205 | + print '<tr><td>' . $langs->trans("ThirdPartyType"); |
|
206 | + if (count($array_query['cust_typeent']) > 0) { |
|
207 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
208 | + } |
|
209 | + print '</td><td>' . "\n"; |
|
210 | + print $formadvtargetemaling->advMultiselectarray('cust_typeent', $formcompany->typent_array(0, " AND id <> 0"), $array_query['cust_typeent']); |
|
211 | + print '</td><td>' . "\n"; |
|
212 | + print '</td></tr>' . "\n"; |
|
213 | + |
|
214 | + // Staff number |
|
215 | + print '<td>' . $langs->trans("Staff"); |
|
216 | + if (count($array_query['cust_effectif_id']) > 0) { |
|
217 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
218 | + } |
|
219 | + print '</td><td>'; |
|
220 | + print $formadvtargetemaling->advMultiselectarray("cust_effectif_id", $formcompany->effectif_array(0, " AND id <> 0"), $array_query['cust_effectif_id']); |
|
221 | + print '</td><td>' . "\n"; |
|
222 | + print '</td></tr>' . "\n"; |
|
223 | + |
|
224 | + // Sales manager |
|
225 | + print '<tr><td>' . $langs->trans("SalesRepresentatives"); |
|
226 | + if (count($array_query['cust_saleman']) > 0) { |
|
227 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
228 | + } |
|
229 | + print '</td><td>' . "\n"; |
|
230 | + print $formadvtargetemaling->multiselectselectSalesRepresentatives('cust_saleman', $array_query['cust_saleman'], $user); |
|
231 | + print '</td><td>' . "\n"; |
|
232 | + print '</td></tr>' . "\n"; |
|
233 | + |
|
234 | + // Customer Default Langauge |
|
235 | + if (! empty($conf->global->MAIN_MULTILANGS)) { |
|
236 | + |
|
237 | + print '<tr><td>' . $langs->trans("DefaultLang"); |
|
238 | + if (count($array_query['cust_language']) > 0) { |
|
239 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
240 | + } |
|
241 | + print '</td><td>' . "\n"; |
|
242 | + print $formadvtargetemaling->multiselectselectLanguage('cust_language', $array_query['cust_language']); |
|
243 | + print '</td><td>' . "\n"; |
|
244 | + print '</td></tr>' . "\n"; |
|
245 | + } |
|
246 | + |
|
247 | + if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) { |
|
248 | + // Customer Categories |
|
249 | + print '<tr><td>' . $langs->trans("CustomersCategoryShort"); |
|
250 | + if (count($array_query['cust_categ']) > 0) { |
|
251 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
252 | + } |
|
253 | + print '</td><td>' . "\n"; |
|
254 | + print $formadvtargetemaling->multiselectCustomerCategories('cust_categ', $array_query['cust_categ']); |
|
255 | + print '</td><td>' . "\n"; |
|
256 | + print '</td></tr>' . "\n"; |
|
257 | + } |
|
258 | + |
|
259 | + // Standard Extrafield feature |
|
260 | + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { |
|
261 | + // fetch optionals attributes and labels |
|
262 | + dol_include_once('/core/class/extrafields.class.php'); |
|
263 | + $extrafields = new ExtraFields($db); |
|
264 | + $extralabels = $extrafields->fetch_name_optionals_label('societe'); |
|
265 | + foreach ( $extralabels as $key => $val ) { |
|
266 | + if ($key != 'ts_nameextra' && $key != 'ts_payeur') { |
|
267 | + print '<tr><td>' . $extrafields->attribute_label[$key]; |
|
268 | + if (! empty($array_query['options_' . $key]) || (is_array($array_query['options_' . $key]) && count($array_query['options_' . $key]) > 0)) { |
|
269 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
270 | + } |
|
271 | + print '</td><td>'; |
|
272 | + if (($extrafields->attribute_type[$key] == 'varchar') || ($extrafields->attribute_type[$key] == 'text')) { |
|
273 | + print '<input type="text" name="options_' . $key . '"/></td><td>' . "\n"; |
|
274 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
275 | + } elseif (($extrafields->attribute_type[$key] == 'int') || ($extrafields->attribute_type[$key] == 'double')) { |
|
276 | + print $langs->trans("AdvTgtMinVal") . '<input type="text" name="options' . $key . '_min"/>'; |
|
277 | + print $langs->trans("AdvTgtMaxVal") . '<input type="text" name="options' . $key . '_max"/>'; |
|
278 | + print '</td><td>' . "\n"; |
|
279 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchIntHelp"), 1, 'help'); |
|
280 | + } elseif (($extrafields->attribute_type[$key] == 'date') || ($extrafields->attribute_type[$key] == 'datetime')) { |
|
281 | + |
|
282 | + print '<table class="nobordernopadding"><tr>'; |
|
283 | + print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
284 | + print $form->selectDate('', 'options_' . $key . '_st_dt'); |
|
285 | + print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
286 | + print $form->selectDate('', 'options_' . $key . '_end_dt'); |
|
287 | + print '</td></tr></table>'; |
|
288 | + |
|
289 | + print '</td><td>' . "\n"; |
|
290 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help'); |
|
291 | + } elseif (($extrafields->attribute_type[$key] == 'boolean')) { |
|
292 | + print $form->selectarray('options_' . $key, array ( |
|
293 | + '' => '', |
|
294 | + '1' => $langs->trans('Yes'), |
|
295 | + '0' => $langs->trans('No') |
|
296 | + ), $array_query['options_' . $key]); |
|
297 | + print '</td><td>' . "\n"; |
|
298 | + } elseif (($extrafields->attribute_type[$key] == 'select')) { |
|
299 | + print $formadvtargetemaling->advMultiselectarray('options_' . $key, $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key]); |
|
300 | + print '</td><td>' . "\n"; |
|
301 | + } elseif (($extrafields->attribute_type[$key] == 'sellist')) { |
|
302 | + print $formadvtargetemaling->advMultiselectarraySelllist('options_' . $key, $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key]); |
|
303 | + print '</td><td>' . "\n"; |
|
304 | + } else { |
|
305 | + |
|
306 | + print '<table class="nobordernopadding"><tr>'; |
|
307 | + print '<td></td><td>'; |
|
308 | + if (is_array($array_query['options_' . $key])) { |
|
309 | + print $extrafields->showInputField($key, implode(',', $array_query['options_' . $key])); |
|
310 | + } else { |
|
311 | + print $extrafields->showInputField($key, $array_query['options_' . $key]); |
|
312 | + } |
|
313 | + print '</td></tr></table>'; |
|
314 | + |
|
315 | + print '</td><td>' . "\n"; |
|
316 | + } |
|
317 | + print '</td></tr>' . "\n"; |
|
318 | + } |
|
319 | + } |
|
320 | + } else { |
|
321 | + $std_soc = new Societe($db); |
|
322 | + $action_search = 'query'; |
|
323 | + |
|
324 | + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context |
|
325 | + include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; |
|
326 | + $hookmanager = new HookManager($db); |
|
327 | + $hookmanager->initHooks(array ('thirdpartycard')); |
|
328 | + |
|
329 | + $parameters=array(); |
|
330 | + if (! empty($advTarget->id)) { |
|
331 | + $parameters = array('array_query' => $advTarget->filtervalue); |
|
332 | + } |
|
333 | + // Other attributes |
|
334 | + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $std_soc, $action_search); |
|
335 | 335 | print $hookmanager->resPrint; |
336 | - } |
|
337 | - |
|
338 | - // State Contact |
|
339 | - print '<tr><td>' . $langs->trans('Status') . ' ' . $langs->trans('Contact'); |
|
340 | - if (count($array_query['contact_status']) > 0) { |
|
341 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
342 | - } |
|
343 | - print '</td><td>'; |
|
344 | - print $formadvtargetemaling->advMultiselectarray('contact_status', array ( |
|
345 | - '0' => $langs->trans('ActivityCeased'), |
|
346 | - '1' => $langs->trans('InActivity') |
|
347 | - ), $array_query['contact_status']); |
|
348 | - print '</td><td>' . "\n"; |
|
349 | - print $form->textwithpicto('', $langs->trans("AdvTgtContactHelp"), 1, 'help'); |
|
350 | - print '</td></tr>' . "\n"; |
|
351 | - |
|
352 | - // Civility |
|
353 | - print '<tr><td width="15%">' . $langs->trans("UserTitle"); |
|
354 | - if (count($array_query['contact_civility']) > 0) { |
|
355 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
356 | - } |
|
357 | - print '</td><td>'; |
|
358 | - print $formadvtargetemaling->multiselectCivility('contact_civility', $array_query['contact_civility']); |
|
359 | - print '</td></tr>'; |
|
360 | - |
|
361 | - // contact name |
|
362 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans('Lastname'); |
|
363 | - if (! empty($array_query['contact_lastname'])) { |
|
364 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
365 | - } |
|
366 | - print '</td><td><input type="text" name="contact_lastname" value="' . $array_query['contact_lastname'] . '"/></td><td>' . "\n"; |
|
367 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
368 | - print '</td></tr>' . "\n"; |
|
369 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans('Firstname'); |
|
370 | - if (! empty($array_query['contact_firstname'])) { |
|
371 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
372 | - } |
|
373 | - print '</td><td><input type="text" name="contact_firstname" value="' . $array_query['contact_firstname'] . '"/></td><td>' . "\n"; |
|
374 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
375 | - print '</td></tr>' . "\n"; |
|
376 | - |
|
377 | - // Contact Country |
|
378 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("Country"); |
|
379 | - if (count($array_query['contact_country']) > 0) { |
|
380 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
381 | - } |
|
382 | - print '</td><td>' . "\n"; |
|
383 | - print $formadvtargetemaling->multiselectCountry('contact_country', $array_query['contact_country']); |
|
384 | - print '</td><td>' . "\n"; |
|
385 | - print '</td></tr>' . "\n"; |
|
386 | - |
|
387 | - // Never send mass mailing |
|
388 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("No_Email"); |
|
389 | - if (! empty($array_query['contact_no_email'])) { |
|
390 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
391 | - } |
|
392 | - print '</td><td>' . "\n"; |
|
393 | - print $form->selectarray('contact_no_email', array ( |
|
394 | - '' => '', |
|
395 | - '1' => $langs->trans('Yes'), |
|
396 | - '0' => $langs->trans('No') |
|
397 | - ), $array_query['contact_no_email']); |
|
398 | - print '</td><td>' . "\n"; |
|
399 | - print '</td></tr>' . "\n"; |
|
400 | - |
|
401 | - // Contact Date Create |
|
402 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("DateCreation"); |
|
403 | - if (! empty($array_query['contact_create_st_dt'])) { |
|
404 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
405 | - } |
|
406 | - print '</td><td>' . "\n"; |
|
407 | - print '<table class="nobordernopadding"><tr>'; |
|
408 | - print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
409 | - print $form->selectDate($array_query['contact_create_st_dt'], 'contact_create_st_dt', 0, 0, 1, 'find_customer', 1, 1); |
|
410 | - print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
411 | - print $form->selectDate($array_query['contact_create_end_dt'], 'contact_create_end_dt', 0, 0, 1, 'find_customer', 1, 1); |
|
412 | - print '</td></tr></table>'; |
|
413 | - print '</td><td>' . "\n"; |
|
414 | - print '</td></tr>' . "\n"; |
|
415 | - |
|
416 | - // Contact update Create |
|
417 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("DateLastModification"); |
|
418 | - if (! empty($array_query['contact_update_st_dt'])) { |
|
419 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
420 | - } |
|
421 | - print '</td><td>' . "\n"; |
|
422 | - print '<table class="nobordernopadding"><tr>'; |
|
423 | - print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
424 | - print $form->selectDate($array_query['contact_update_st_dt'], 'contact_update_st_dt', 0, 0, 1, 'find_customer', 1, 1); |
|
425 | - print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
426 | - print $form->selectDate($array_query['contact_update_end_dt'], 'contact_update_end_dt', 0, 0, 1, 'find_customer', 1, 1); |
|
427 | - print '</td></tr></table>'; |
|
428 | - print '</td><td>' . "\n"; |
|
429 | - print '</td></tr>' . "\n"; |
|
430 | - |
|
431 | - if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) { |
|
432 | - // Customer Categories |
|
433 | - print '<tr><td>' . $langs->trans("ContactCategoriesShort"); |
|
434 | - if (count($array_query['contact_categ']) > 0) { |
|
435 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
436 | - } |
|
437 | - print '</td><td>' . "\n"; |
|
438 | - print $formadvtargetemaling->multiselectContactCategories('contact_categ', $array_query['contact_categ']); |
|
439 | - print '</td><td>' . "\n"; |
|
440 | - print '</td></tr>' . "\n"; |
|
441 | - } |
|
442 | - |
|
443 | - // Standard Extrafield feature |
|
444 | - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { |
|
445 | - // fetch optionals attributes and labels |
|
446 | - dol_include_once('/core/class/extrafields.class.php'); |
|
447 | - $extrafields = new ExtraFields($db); |
|
448 | - $extralabels = $extrafields->fetch_name_optionals_label('socpeople'); |
|
336 | + } |
|
337 | + |
|
338 | + // State Contact |
|
339 | + print '<tr><td>' . $langs->trans('Status') . ' ' . $langs->trans('Contact'); |
|
340 | + if (count($array_query['contact_status']) > 0) { |
|
341 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
342 | + } |
|
343 | + print '</td><td>'; |
|
344 | + print $formadvtargetemaling->advMultiselectarray('contact_status', array ( |
|
345 | + '0' => $langs->trans('ActivityCeased'), |
|
346 | + '1' => $langs->trans('InActivity') |
|
347 | + ), $array_query['contact_status']); |
|
348 | + print '</td><td>' . "\n"; |
|
349 | + print $form->textwithpicto('', $langs->trans("AdvTgtContactHelp"), 1, 'help'); |
|
350 | + print '</td></tr>' . "\n"; |
|
351 | + |
|
352 | + // Civility |
|
353 | + print '<tr><td width="15%">' . $langs->trans("UserTitle"); |
|
354 | + if (count($array_query['contact_civility']) > 0) { |
|
355 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
356 | + } |
|
357 | + print '</td><td>'; |
|
358 | + print $formadvtargetemaling->multiselectCivility('contact_civility', $array_query['contact_civility']); |
|
359 | + print '</td></tr>'; |
|
360 | + |
|
361 | + // contact name |
|
362 | + print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans('Lastname'); |
|
363 | + if (! empty($array_query['contact_lastname'])) { |
|
364 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
365 | + } |
|
366 | + print '</td><td><input type="text" name="contact_lastname" value="' . $array_query['contact_lastname'] . '"/></td><td>' . "\n"; |
|
367 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
368 | + print '</td></tr>' . "\n"; |
|
369 | + print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans('Firstname'); |
|
370 | + if (! empty($array_query['contact_firstname'])) { |
|
371 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
372 | + } |
|
373 | + print '</td><td><input type="text" name="contact_firstname" value="' . $array_query['contact_firstname'] . '"/></td><td>' . "\n"; |
|
374 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
375 | + print '</td></tr>' . "\n"; |
|
376 | + |
|
377 | + // Contact Country |
|
378 | + print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("Country"); |
|
379 | + if (count($array_query['contact_country']) > 0) { |
|
380 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
381 | + } |
|
382 | + print '</td><td>' . "\n"; |
|
383 | + print $formadvtargetemaling->multiselectCountry('contact_country', $array_query['contact_country']); |
|
384 | + print '</td><td>' . "\n"; |
|
385 | + print '</td></tr>' . "\n"; |
|
386 | + |
|
387 | + // Never send mass mailing |
|
388 | + print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("No_Email"); |
|
389 | + if (! empty($array_query['contact_no_email'])) { |
|
390 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
391 | + } |
|
392 | + print '</td><td>' . "\n"; |
|
393 | + print $form->selectarray('contact_no_email', array ( |
|
394 | + '' => '', |
|
395 | + '1' => $langs->trans('Yes'), |
|
396 | + '0' => $langs->trans('No') |
|
397 | + ), $array_query['contact_no_email']); |
|
398 | + print '</td><td>' . "\n"; |
|
399 | + print '</td></tr>' . "\n"; |
|
400 | + |
|
401 | + // Contact Date Create |
|
402 | + print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("DateCreation"); |
|
403 | + if (! empty($array_query['contact_create_st_dt'])) { |
|
404 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
405 | + } |
|
406 | + print '</td><td>' . "\n"; |
|
407 | + print '<table class="nobordernopadding"><tr>'; |
|
408 | + print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
409 | + print $form->selectDate($array_query['contact_create_st_dt'], 'contact_create_st_dt', 0, 0, 1, 'find_customer', 1, 1); |
|
410 | + print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
411 | + print $form->selectDate($array_query['contact_create_end_dt'], 'contact_create_end_dt', 0, 0, 1, 'find_customer', 1, 1); |
|
412 | + print '</td></tr></table>'; |
|
413 | + print '</td><td>' . "\n"; |
|
414 | + print '</td></tr>' . "\n"; |
|
415 | + |
|
416 | + // Contact update Create |
|
417 | + print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("DateLastModification"); |
|
418 | + if (! empty($array_query['contact_update_st_dt'])) { |
|
419 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
420 | + } |
|
421 | + print '</td><td>' . "\n"; |
|
422 | + print '<table class="nobordernopadding"><tr>'; |
|
423 | + print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
424 | + print $form->selectDate($array_query['contact_update_st_dt'], 'contact_update_st_dt', 0, 0, 1, 'find_customer', 1, 1); |
|
425 | + print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
426 | + print $form->selectDate($array_query['contact_update_end_dt'], 'contact_update_end_dt', 0, 0, 1, 'find_customer', 1, 1); |
|
427 | + print '</td></tr></table>'; |
|
428 | + print '</td><td>' . "\n"; |
|
429 | + print '</td></tr>' . "\n"; |
|
430 | + |
|
431 | + if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) { |
|
432 | + // Customer Categories |
|
433 | + print '<tr><td>' . $langs->trans("ContactCategoriesShort"); |
|
434 | + if (count($array_query['contact_categ']) > 0) { |
|
435 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
436 | + } |
|
437 | + print '</td><td>' . "\n"; |
|
438 | + print $formadvtargetemaling->multiselectContactCategories('contact_categ', $array_query['contact_categ']); |
|
439 | + print '</td><td>' . "\n"; |
|
440 | + print '</td></tr>' . "\n"; |
|
441 | + } |
|
442 | + |
|
443 | + // Standard Extrafield feature |
|
444 | + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { |
|
445 | + // fetch optionals attributes and labels |
|
446 | + dol_include_once('/core/class/extrafields.class.php'); |
|
447 | + $extrafields = new ExtraFields($db); |
|
448 | + $extralabels = $extrafields->fetch_name_optionals_label('socpeople'); |
|
449 | 449 | foreach($extrafields->attribute_type as $key=>&$value) { |
450 | 450 | if($value == 'radio')$value = 'select'; |
451 | 451 | } |
452 | 452 | |
453 | 453 | |
454 | - foreach ( $extralabels as $key => $val ) { |
|
455 | - |
|
456 | - print '<tr><td>' . $extrafields->attribute_label[$key]; |
|
457 | - if ($array_query['options_' . $key . '_cnct'] != '' || (is_array($array_query['options_' . $key . '_cnct']) && count($array_query['options_' . $key . '_cnct']) > 0)) { |
|
458 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
459 | - } |
|
460 | - print '</td><td>'; |
|
461 | - if (($extrafields->attribute_type[$key] == 'varchar') || ($extrafields->attribute_type[$key] == 'text')) { |
|
462 | - print '<input type="text" name="options_' . $key . '_cnct"/></td><td>' . "\n"; |
|
463 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
464 | - } elseif (($extrafields->attribute_type[$key] == 'int') || ($extrafields->attribute_type[$key] == 'double')) { |
|
465 | - print $langs->trans("AdvTgtMinVal") . '<input type="text" name="options_' . $key . '_min_cnct"/>'; |
|
466 | - print $langs->trans("AdvTgtMaxVal") . '<input type="text" name="options_' . $key . '_max_cnct"/>'; |
|
467 | - print '</td><td>' . "\n"; |
|
468 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchIntHelp"), 1, 'help'); |
|
469 | - } elseif (($extrafields->attribute_type[$key] == 'date') || ($extrafields->attribute_type[$key] == 'datetime')) { |
|
470 | - |
|
471 | - print '<table class="nobordernopadding"><tr>'; |
|
472 | - print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
473 | - print $form->selectDate('', 'options_' . $key . '_st_dt' . '_cnct'); |
|
474 | - print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
475 | - print $form->selectDate('', 'options_' . $key . '_end_dt' . '_cnct'); |
|
476 | - print '</td></tr></table>'; |
|
477 | - |
|
478 | - print '</td><td>' . "\n"; |
|
479 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help'); |
|
480 | - } elseif (($extrafields->attribute_type[$key] == 'boolean')) { |
|
481 | - print $form->selectarray('options_' . $key . '_cnct', array ( |
|
482 | - '' => '', |
|
483 | - '1' => $langs->trans('Yes'), |
|
484 | - '0' => $langs->trans('No') |
|
485 | - ), $array_query['options_' . $key . '_cnct']); |
|
486 | - print '</td><td>' . "\n"; |
|
487 | - } elseif (($extrafields->attribute_type[$key] == 'select')) { |
|
488 | - print $formadvtargetemaling->advMultiselectarray('options_' . $key . '_cnct', $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key . '_cnct']); |
|
489 | - print '</td><td>' . "\n"; |
|
490 | - } elseif (($extrafields->attribute_type[$key] == 'sellist')) { |
|
491 | - print $formadvtargetemaling->advMultiselectarraySelllist('options_' . $key . '_cnct', $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key . '_cnct']); |
|
492 | - print '</td><td>' . "\n"; |
|
493 | - } else { |
|
494 | - |
|
495 | - print '<table class="nobordernopadding"><tr>'; |
|
496 | - print '<td></td><td>'; |
|
497 | - if (is_array($array_query['options_' . $key . '_cnct'])) { |
|
498 | - print $extrafields->showInputField($key, implode(',', $array_query['options_' . $key . '_cnct']), '', '_cnct'); |
|
499 | - } else { |
|
500 | - print $extrafields->showInputField($key, $array_query['options_' . $key . '_cnct'], '', '_cnct'); |
|
501 | - } |
|
502 | - print '</td></tr></table>'; |
|
503 | - |
|
504 | - print '</td><td>' . "\n"; |
|
505 | - } |
|
506 | - print '</td></tr>' . "\n"; |
|
507 | - } |
|
508 | - } |
|
509 | - |
|
510 | - print '<tr>' . "\n"; |
|
511 | - print '<td colspan="3" align="right">' . "\n"; |
|
512 | - |
|
513 | - print '<input type="button" name="addcontact" id="addcontact" value="' . $langs->trans('AdvTgtAddContact') . '" class="butAction"/>' . "\n"; |
|
514 | - |
|
515 | - print '</td>' . "\n"; |
|
516 | - print '</tr>' . "\n"; |
|
517 | - print '</table>' . "\n"; |
|
518 | - print '</form>' . "\n"; |
|
519 | - print '</div>' . "\n"; |
|
520 | - |
|
521 | - print '<form action="' . $_SERVER['PHP_SELF'] . '?action=clear&id=' . $object->id . '" method="POST">'; |
|
522 | - print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; |
|
523 | - print_titre($langs->trans("ToClearAllRecipientsClickHere")); |
|
524 | - print '<table class="noborder" width="100%">'; |
|
525 | - print '<tr class="liste_titre">'; |
|
526 | - print '<td class="liste_titre" align="right"><input type="submit" class="button" value="' . $langs->trans("TargetsReset") . '"></td>'; |
|
527 | - print '</tr>'; |
|
528 | - print '</table>'; |
|
529 | - print '</form>'; |
|
530 | - print '<br>'; |
|
531 | 454 | \ No newline at end of file |
455 | + foreach ( $extralabels as $key => $val ) { |
|
456 | + |
|
457 | + print '<tr><td>' . $extrafields->attribute_label[$key]; |
|
458 | + if ($array_query['options_' . $key . '_cnct'] != '' || (is_array($array_query['options_' . $key . '_cnct']) && count($array_query['options_' . $key . '_cnct']) > 0)) { |
|
459 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
460 | + } |
|
461 | + print '</td><td>'; |
|
462 | + if (($extrafields->attribute_type[$key] == 'varchar') || ($extrafields->attribute_type[$key] == 'text')) { |
|
463 | + print '<input type="text" name="options_' . $key . '_cnct"/></td><td>' . "\n"; |
|
464 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
465 | + } elseif (($extrafields->attribute_type[$key] == 'int') || ($extrafields->attribute_type[$key] == 'double')) { |
|
466 | + print $langs->trans("AdvTgtMinVal") . '<input type="text" name="options_' . $key . '_min_cnct"/>'; |
|
467 | + print $langs->trans("AdvTgtMaxVal") . '<input type="text" name="options_' . $key . '_max_cnct"/>'; |
|
468 | + print '</td><td>' . "\n"; |
|
469 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchIntHelp"), 1, 'help'); |
|
470 | + } elseif (($extrafields->attribute_type[$key] == 'date') || ($extrafields->attribute_type[$key] == 'datetime')) { |
|
471 | + |
|
472 | + print '<table class="nobordernopadding"><tr>'; |
|
473 | + print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
474 | + print $form->selectDate('', 'options_' . $key . '_st_dt' . '_cnct'); |
|
475 | + print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
476 | + print $form->selectDate('', 'options_' . $key . '_end_dt' . '_cnct'); |
|
477 | + print '</td></tr></table>'; |
|
478 | + |
|
479 | + print '</td><td>' . "\n"; |
|
480 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help'); |
|
481 | + } elseif (($extrafields->attribute_type[$key] == 'boolean')) { |
|
482 | + print $form->selectarray('options_' . $key . '_cnct', array ( |
|
483 | + '' => '', |
|
484 | + '1' => $langs->trans('Yes'), |
|
485 | + '0' => $langs->trans('No') |
|
486 | + ), $array_query['options_' . $key . '_cnct']); |
|
487 | + print '</td><td>' . "\n"; |
|
488 | + } elseif (($extrafields->attribute_type[$key] == 'select')) { |
|
489 | + print $formadvtargetemaling->advMultiselectarray('options_' . $key . '_cnct', $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key . '_cnct']); |
|
490 | + print '</td><td>' . "\n"; |
|
491 | + } elseif (($extrafields->attribute_type[$key] == 'sellist')) { |
|
492 | + print $formadvtargetemaling->advMultiselectarraySelllist('options_' . $key . '_cnct', $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key . '_cnct']); |
|
493 | + print '</td><td>' . "\n"; |
|
494 | + } else { |
|
495 | + |
|
496 | + print '<table class="nobordernopadding"><tr>'; |
|
497 | + print '<td></td><td>'; |
|
498 | + if (is_array($array_query['options_' . $key . '_cnct'])) { |
|
499 | + print $extrafields->showInputField($key, implode(',', $array_query['options_' . $key . '_cnct']), '', '_cnct'); |
|
500 | + } else { |
|
501 | + print $extrafields->showInputField($key, $array_query['options_' . $key . '_cnct'], '', '_cnct'); |
|
502 | + } |
|
503 | + print '</td></tr></table>'; |
|
504 | + |
|
505 | + print '</td><td>' . "\n"; |
|
506 | + } |
|
507 | + print '</td></tr>' . "\n"; |
|
508 | + } |
|
509 | + } |
|
510 | + |
|
511 | + print '<tr>' . "\n"; |
|
512 | + print '<td colspan="3" align="right">' . "\n"; |
|
513 | + |
|
514 | + print '<input type="button" name="addcontact" id="addcontact" value="' . $langs->trans('AdvTgtAddContact') . '" class="butAction"/>' . "\n"; |
|
515 | + |
|
516 | + print '</td>' . "\n"; |
|
517 | + print '</tr>' . "\n"; |
|
518 | + print '</table>' . "\n"; |
|
519 | + print '</form>' . "\n"; |
|
520 | + print '</div>' . "\n"; |
|
521 | + |
|
522 | + print '<form action="' . $_SERVER['PHP_SELF'] . '?action=clear&id=' . $object->id . '" method="POST">'; |
|
523 | + print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; |
|
524 | + print_titre($langs->trans("ToClearAllRecipientsClickHere")); |
|
525 | + print '<table class="noborder" width="100%">'; |
|
526 | + print '<tr class="liste_titre">'; |
|
527 | + print '<td class="liste_titre" align="right"><input type="submit" class="button" value="' . $langs->trans("TargetsReset") . '"></td>'; |
|
528 | + print '</tr>'; |
|
529 | + print '</table>'; |
|
530 | + print '</form>'; |
|
531 | + print '<br>'; |
|
532 | 532 | \ No newline at end of file |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | // Protection to avoid direct call of template |
22 | 22 | if (empty($conf) || ! is_object($conf)) |
23 | 23 | { |
24 | - print "Error, template page filemanager.tpl.php can't be called as URL"; |
|
25 | - exit; |
|
24 | + print "Error, template page filemanager.tpl.php can't be called as URL"; |
|
25 | + exit; |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | ?> |
@@ -41,15 +41,15 @@ discard block |
||
41 | 41 | $showroot = 0; |
42 | 42 | if ($module == 'ecm') |
43 | 43 | { |
44 | - $permtoadd = $user->rights->ecm->setup; |
|
45 | - $permtoupload = $user->rights->ecm->upload; |
|
46 | - $showroot = 0; |
|
44 | + $permtoadd = $user->rights->ecm->setup; |
|
45 | + $permtoupload = $user->rights->ecm->upload; |
|
46 | + $showroot = 0; |
|
47 | 47 | } |
48 | 48 | if ($module == 'medias') |
49 | 49 | { |
50 | - $permtoadd = ($user->rights->mailing->creer || $user->rights->website->write); |
|
51 | - $permtoupload = ($user->rights->mailing->creer || $user->rights->website->write); |
|
52 | - $showroot = 1; |
|
50 | + $permtoadd = ($user->rights->mailing->creer || $user->rights->website->write); |
|
51 | + $permtoupload = ($user->rights->mailing->creer || $user->rights->website->write); |
|
52 | + $showroot = 1; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | // Confirm remove file (for non javascript users) |
58 | 58 | if (($action == 'delete' || $action == 'file_manager_delete') && empty($conf->use_javascript_ajax)) |
59 | 59 | { |
60 | - // TODO Add website, pageid, filemanager if defined |
|
61 | - print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1); |
|
60 | + // TODO Add website, pageid, filemanager if defined |
|
61 | + print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | // Start container of all panels |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | // Toolbar |
75 | 75 | if ($permtoadd) |
76 | 76 | { |
77 | - print '<a href="'.DOL_URL_ROOT.'/ecm/dir_add_card.php?action=create&module='.urlencode($module).($websitekey?'&website='.$websitekey:'').($pageid?'&pageid='.$pageid:'').'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid).'" class="inline-block valignmiddle toolbarbutton" title="'.dol_escape_htmltag($langs->trans('ECMAddSection')).'">'; |
|
77 | + print '<a href="'.DOL_URL_ROOT.'/ecm/dir_add_card.php?action=create&module='.urlencode($module).($websitekey?'&website='.$websitekey:'').($pageid?'&pageid='.$pageid:'').'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid).'" class="inline-block valignmiddle toolbarbutton" title="'.dol_escape_htmltag($langs->trans('ECMAddSection')).'">'; |
|
78 | 78 | print '<img class="toolbarbutton" border="0" src="'.DOL_URL_ROOT.'/theme/common/folder-new.png">'; |
79 | 79 | print '</a>'; |
80 | 80 | } |
@@ -86,10 +86,10 @@ discard block |
||
86 | 86 | } |
87 | 87 | if ($module == 'ecm') |
88 | 88 | { |
89 | - $tmpurl=((! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))?'#':($_SERVER["PHP_SELF"].'?action=refreshmanual'.($module?'&module='.$module:'').($section?'&section='.$section:''))); |
|
90 | - print '<a href="'.$tmpurl.'" class="inline-block valignmiddle toolbarbutton" title="'.dol_escape_htmltag($langs->trans('ReSyncListOfDir')).'">'; |
|
91 | - print '<img id="refreshbutton" class="toolbarbutton" border="0" src="'.DOL_URL_ROOT.'/theme/common/view-refresh.png">'; |
|
92 | - print '</a>'; |
|
89 | + $tmpurl=((! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))?'#':($_SERVER["PHP_SELF"].'?action=refreshmanual'.($module?'&module='.$module:'').($section?'&section='.$section:''))); |
|
90 | + print '<a href="'.$tmpurl.'" class="inline-block valignmiddle toolbarbutton" title="'.dol_escape_htmltag($langs->trans('ReSyncListOfDir')).'">'; |
|
91 | + print '<img id="refreshbutton" class="toolbarbutton" border="0" src="'.DOL_URL_ROOT.'/theme/common/view-refresh.png">'; |
|
92 | + print '</a>'; |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | // Start "Add new file" area |
@@ -100,20 +100,20 @@ discard block |
||
100 | 100 | // To attach new file |
101 | 101 | if ((! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) || ! empty($section)) |
102 | 102 | { |
103 | - if ((empty($section) || $section == -1) && ($module != 'medias')) |
|
104 | - { |
|
105 | - ?> |
|
103 | + if ((empty($section) || $section == -1) && ($module != 'medias')) |
|
104 | + { |
|
105 | + ?> |
|
106 | 106 | <script type="text/javascript"> |
107 | 107 | jQuery(document).ready(function() { |
108 | 108 | jQuery('#<?php echo $nameforformuserfile ?>').hide(); |
109 | 109 | }); |
110 | 110 | </script> |
111 | 111 | <?php |
112 | - } |
|
112 | + } |
|
113 | 113 | |
114 | - $sectiondir=GETPOST('file','alpha')?GETPOST('file','alpha'):GETPOST('section_dir','alpha'); |
|
115 | - print '<!-- Start form to attach new file in filemanager.tpl.php sectionid='.$section.' sectiondir='.$sectiondir.' -->'."\n"; |
|
116 | - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
114 | + $sectiondir=GETPOST('file','alpha')?GETPOST('file','alpha'):GETPOST('section_dir','alpha'); |
|
115 | + print '<!-- Start form to attach new file in filemanager.tpl.php sectionid='.$section.' sectiondir='.$sectiondir.' -->'."\n"; |
|
116 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
117 | 117 | $formfile=new FormFile($db); |
118 | 118 | $formfile->form_attach_new_file($_SERVER["PHP_SELF"], 'none', 0, ($section?$section:-1), $permtoupload, 48, null, '', 0, '', 0, $nameforformuserfile, '', $sectiondir); |
119 | 119 | } |
@@ -143,39 +143,39 @@ discard block |
||
143 | 143 | |
144 | 144 | if (empty($action) || $action == 'editfile' || $action == 'file_manager' || preg_match('/refresh/i',$action) || $action == 'delete') |
145 | 145 | { |
146 | - $langs->load("ecm"); |
|
146 | + $langs->load("ecm"); |
|
147 | 147 | |
148 | - print '<table width="100%" class="liste noborderbottom">'."\n"; |
|
148 | + print '<table width="100%" class="liste noborderbottom">'."\n"; |
|
149 | 149 | |
150 | - print '<!-- Title for manual directories -->'."\n"; |
|
151 | - print '<tr class="liste_titre">'."\n"; |
|
150 | + print '<!-- Title for manual directories -->'."\n"; |
|
151 | + print '<tr class="liste_titre">'."\n"; |
|
152 | 152 | print '<th class="liste_titre" align="left">'; |
153 | 153 | print ' '.$langs->trans("ECMSections"); |
154 | - print '</th></tr>'; |
|
154 | + print '</th></tr>'; |
|
155 | 155 | |
156 | 156 | $showonrightsize=''; |
157 | 157 | |
158 | - // Manual section |
|
159 | - $htmltooltip=$langs->trans("ECMAreaDesc2"); |
|
158 | + // Manual section |
|
159 | + $htmltooltip=$langs->trans("ECMAreaDesc2"); |
|
160 | 160 | |
161 | 161 | if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) |
162 | 162 | { |
163 | - // Show the link to "Root" |
|
164 | - if ($showroot) |
|
165 | - { |
|
166 | - print '<tr><td><div style="padding-left: 5px; padding-right: 5px;"><a href="'.$_SERVER["PHP_SELF"].'?file_manager=1&pageid='.$pageid.'">'.$langs->trans("Root").'</a></div></td></tr>'; |
|
167 | - } |
|
163 | + // Show the link to "Root" |
|
164 | + if ($showroot) |
|
165 | + { |
|
166 | + print '<tr><td><div style="padding-left: 5px; padding-right: 5px;"><a href="'.$_SERVER["PHP_SELF"].'?file_manager=1&pageid='.$pageid.'">'.$langs->trans("Root").'</a></div></td></tr>'; |
|
167 | + } |
|
168 | 168 | |
169 | 169 | |
170 | 170 | |
171 | - print '<tr><td>'; |
|
171 | + print '<tr><td>'; |
|
172 | 172 | |
173 | - // Show filemanager tree (will be filled by a call of ajax /ecm/tpl/enablefiletreeajax.tpl.php, later, that executes ajaxdirtree.php) |
|
174 | - print '<div id="filetree" class="ecmfiletree"></div>'; |
|
173 | + // Show filemanager tree (will be filled by a call of ajax /ecm/tpl/enablefiletreeajax.tpl.php, later, that executes ajaxdirtree.php) |
|
174 | + print '<div id="filetree" class="ecmfiletree"></div>'; |
|
175 | 175 | |
176 | - if ($action == 'deletefile') print $form->formconfirm('eeeee', $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', '', 'deletefile'); |
|
176 | + if ($action == 'deletefile') print $form->formconfirm('eeeee', $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', '', 'deletefile'); |
|
177 | 177 | |
178 | - print '</td></tr>'; |
|
178 | + print '</td></tr>'; |
|
179 | 179 | } |
180 | 180 | else // Show filtree when ajax is disabled (rare) |
181 | 181 | { |
@@ -195,12 +195,12 @@ discard block |
||
195 | 195 | if (empty($url)) $url=DOL_URL_ROOT.'/ecm/index.php'; |
196 | 196 | include DOL_DOCUMENT_ROOT.'/core/ajax/ajaxdirtree.php'; |
197 | 197 | |
198 | - print '</div>'; |
|
199 | - print '</td></tr>'; |
|
198 | + print '</div>'; |
|
199 | + print '</td></tr>'; |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | |
203 | - print "</table>"; |
|
203 | + print "</table>"; |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | |
@@ -231,14 +231,14 @@ discard block |
||
231 | 231 | |
232 | 232 | if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) // Show filtree when ajax is enabled |
233 | 233 | { |
234 | - //var_dump($modulepart); |
|
235 | - // Variables that may be defined: |
|
236 | - // $_GET['modulepart'], $_GET['openeddir'], $_GET['sortfield'], $_GET['sortorder'] |
|
237 | - // $_POST['dir'] |
|
238 | - // $_POST['section_dir'], $_POST['section_id'], $_POST['token'], $_POST['max_file_size'], $_POST['sendit'] |
|
239 | - if (GETPOST('section_dir','alpha')) { $preopened=GETPOST('section_dir','alpha'); } |
|
240 | - |
|
241 | - include DOL_DOCUMENT_ROOT.'/ecm/tpl/enablefiletreeajax.tpl.php'; |
|
234 | + //var_dump($modulepart); |
|
235 | + // Variables that may be defined: |
|
236 | + // $_GET['modulepart'], $_GET['openeddir'], $_GET['sortfield'], $_GET['sortorder'] |
|
237 | + // $_POST['dir'] |
|
238 | + // $_POST['section_dir'], $_POST['section_id'], $_POST['token'], $_POST['max_file_size'], $_POST['sendit'] |
|
239 | + if (GETPOST('section_dir','alpha')) { $preopened=GETPOST('section_dir','alpha'); } |
|
240 | + |
|
241 | + include DOL_DOCUMENT_ROOT.'/ecm/tpl/enablefiletreeajax.tpl.php'; |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | ?> |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | // Protection to avoid direct call of template |
27 | 27 | if (empty($conf) || ! is_object($conf)) |
28 | 28 | { |
29 | - print "Error, template page can't be called as URL"; |
|
30 | - exit; |
|
29 | + print "Error, template page can't be called as URL"; |
|
30 | + exit; |
|
31 | 31 | } |
32 | 32 | if (! is_object($form)) $form=new Form($db); |
33 | 33 | |
@@ -39,29 +39,29 @@ discard block |
||
39 | 39 | |
40 | 40 | foreach($object->fields as $key => $val) |
41 | 41 | { |
42 | - // Discard if extrafield is a hidden field on form |
|
43 | - if (abs($val['visible']) != 1) continue; |
|
42 | + // Discard if extrafield is a hidden field on form |
|
43 | + if (abs($val['visible']) != 1) continue; |
|
44 | 44 | |
45 | - if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! verifCond($val['enabled'])) continue; // We don't want this field |
|
46 | - if (in_array($key, array('ref','status'))) continue; // Ref and status are already in dol_banner |
|
45 | + if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! verifCond($val['enabled'])) continue; // We don't want this field |
|
46 | + if (in_array($key, array('ref','status'))) continue; // Ref and status are already in dol_banner |
|
47 | 47 | |
48 | - $value=$object->$key; |
|
48 | + $value=$object->$key; |
|
49 | 49 | |
50 | - print '<tr><td'; |
|
51 | - print ' class="titlefield'; |
|
52 | - if ($val['notnull'] > 0) print ' fieldrequired'; |
|
53 | - if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; |
|
54 | - print '">'; |
|
55 | - if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
56 | - else print $langs->trans($val['label']); |
|
57 | - print '</td>'; |
|
58 | - print '<td>'; |
|
59 | - print $object->showOutputField($val, $key, $value, '', '', '', 0); |
|
60 | - //print dol_escape_htmltag($object->$key, 1, 1); |
|
61 | - print '</td>'; |
|
62 | - print '</tr>'; |
|
50 | + print '<tr><td'; |
|
51 | + print ' class="titlefield'; |
|
52 | + if ($val['notnull'] > 0) print ' fieldrequired'; |
|
53 | + if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; |
|
54 | + print '">'; |
|
55 | + if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
56 | + else print $langs->trans($val['label']); |
|
57 | + print '</td>'; |
|
58 | + print '<td>'; |
|
59 | + print $object->showOutputField($val, $key, $value, '', '', '', 0); |
|
60 | + //print dol_escape_htmltag($object->$key, 1, 1); |
|
61 | + print '</td>'; |
|
62 | + print '</tr>'; |
|
63 | 63 | |
64 | - if (! empty($keyforbreak) && $key == $keyforbreak) break; // key used for break on second column |
|
64 | + if (! empty($keyforbreak) && $key == $keyforbreak) break; // key used for break on second column |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | print '</table>'; |
@@ -74,31 +74,31 @@ discard block |
||
74 | 74 | $alreadyoutput = 1; |
75 | 75 | foreach($object->fields as $key => $val) |
76 | 76 | { |
77 | - if ($alreadyoutput) |
|
78 | - { |
|
79 | - if (! empty($keyforbreak) && $key == $keyforbreak) $alreadyoutput = 0; // key used for break on second column |
|
80 | - continue; |
|
81 | - } |
|
77 | + if ($alreadyoutput) |
|
78 | + { |
|
79 | + if (! empty($keyforbreak) && $key == $keyforbreak) $alreadyoutput = 0; // key used for break on second column |
|
80 | + continue; |
|
81 | + } |
|
82 | 82 | |
83 | - if (abs($val['visible']) != 1) continue; // Discard such field from form |
|
84 | - if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field |
|
85 | - if (in_array($key, array('ref','status'))) continue; // Ref and status are already in dol_banner |
|
83 | + if (abs($val['visible']) != 1) continue; // Discard such field from form |
|
84 | + if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field |
|
85 | + if (in_array($key, array('ref','status'))) continue; // Ref and status are already in dol_banner |
|
86 | 86 | |
87 | - $value=$object->$key; |
|
87 | + $value=$object->$key; |
|
88 | 88 | |
89 | - print '<tr><td'; |
|
90 | - print ' class="titlefield'; |
|
91 | - if ($val['notnull'] > 0) print ' fieldrequired'; |
|
92 | - if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; |
|
93 | - print '">'; |
|
94 | - if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
95 | - else print $langs->trans($val['label']); |
|
96 | - print '</td>'; |
|
97 | - print '<td>'; |
|
98 | - print $object->showOutputField($val, $key, $value, '', '', '', 0); |
|
99 | - //print dol_escape_htmltag($object->$key, 1, 1); |
|
100 | - print '</td>'; |
|
101 | - print '</tr>'; |
|
89 | + print '<tr><td'; |
|
90 | + print ' class="titlefield'; |
|
91 | + if ($val['notnull'] > 0) print ' fieldrequired'; |
|
92 | + if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; |
|
93 | + print '">'; |
|
94 | + if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
95 | + else print $langs->trans($val['label']); |
|
96 | + print '</td>'; |
|
97 | + print '<td>'; |
|
98 | + print $object->showOutputField($val, $key, $value, '', '', '', 0); |
|
99 | + //print dol_escape_htmltag($object->$key, 1, 1); |
|
100 | + print '</td>'; |
|
101 | + print '</tr>'; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | ?> |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | // Protection to avoid direct call of template |
41 | 41 | if (empty($object) || ! is_object($object)) |
42 | 42 | { |
43 | - print "Error, template page can't be called as URL"; |
|
44 | - exit; |
|
43 | + print "Error, template page can't be called as URL"; |
|
44 | + exit; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
@@ -72,126 +72,126 @@ discard block |
||
72 | 72 | <?php } ?> |
73 | 73 | <td class="linecoldescription minwidth300imp"><?php $coldisplay++; ?><div id="line_<?php echo $line->id; ?>"></div> |
74 | 74 | <?php |
75 | - if (($line->info_bits & 2) == 2) { |
|
76 | - ?> |
|
75 | + if (($line->info_bits & 2) == 2) { |
|
76 | + ?> |
|
77 | 77 | <a href="<?php echo DOL_URL_ROOT.'/comm/remx.php?id='.$this->socid; ?>"> |
78 | 78 | <?php |
79 | - $txt=''; |
|
80 | - print img_object($langs->trans("ShowReduc"),'reduc').' '; |
|
81 | - if ($line->description == '(DEPOSIT)') $txt=$langs->trans("Deposit"); |
|
82 | - elseif ($line->description == '(EXCESS RECEIVED)') $txt=$langs->trans("ExcessReceived"); |
|
83 | - elseif ($line->description == '(EXCESS PAID)') $txt=$langs->trans("ExcessPaid"); |
|
84 | - //else $txt=$langs->trans("Discount"); |
|
85 | - print $txt; |
|
86 | - ?> |
|
79 | + $txt=''; |
|
80 | + print img_object($langs->trans("ShowReduc"),'reduc').' '; |
|
81 | + if ($line->description == '(DEPOSIT)') $txt=$langs->trans("Deposit"); |
|
82 | + elseif ($line->description == '(EXCESS RECEIVED)') $txt=$langs->trans("ExcessReceived"); |
|
83 | + elseif ($line->description == '(EXCESS PAID)') $txt=$langs->trans("ExcessPaid"); |
|
84 | + //else $txt=$langs->trans("Discount"); |
|
85 | + print $txt; |
|
86 | + ?> |
|
87 | 87 | </a> |
88 | 88 | <?php |
89 | - if ($line->description) |
|
90 | - { |
|
91 | - if ($line->description == '(CREDIT_NOTE)' && $line->fk_remise_except > 0) |
|
92 | - { |
|
93 | - $discount=new DiscountAbsolute($this->db); |
|
94 | - $discount->fetch($line->fk_remise_except); |
|
95 | - echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0)); |
|
96 | - } |
|
97 | - elseif ($line->description == '(DEPOSIT)' && $line->fk_remise_except > 0) |
|
98 | - { |
|
99 | - $discount=new DiscountAbsolute($this->db); |
|
100 | - $discount->fetch($line->fk_remise_except); |
|
101 | - echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0)); |
|
102 | - // Add date of deposit |
|
103 | - if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) |
|
104 | - echo ' ('.dol_print_date($discount->datec).')'; |
|
105 | - } |
|
106 | - elseif ($line->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0) |
|
107 | - { |
|
108 | - $discount=new DiscountAbsolute($this->db); |
|
109 | - $discount->fetch($line->fk_remise_except); |
|
110 | - echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessReceived",$discount->getNomUrl(0)); |
|
111 | - } |
|
112 | - elseif ($line->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0) |
|
113 | - { |
|
114 | - $discount=new DiscountAbsolute($this->db); |
|
115 | - $discount->fetch($line->fk_remise_except); |
|
116 | - echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessPaid",$discount->getNomUrl(0)); |
|
117 | - } |
|
118 | - else |
|
119 | - { |
|
120 | - echo ($txt?' - ':'').dol_htmlentitiesbr($line->description); |
|
121 | - } |
|
122 | - } |
|
123 | - } |
|
124 | - else |
|
125 | - { |
|
126 | - $format = $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE?'dayhour':'day'; |
|
89 | + if ($line->description) |
|
90 | + { |
|
91 | + if ($line->description == '(CREDIT_NOTE)' && $line->fk_remise_except > 0) |
|
92 | + { |
|
93 | + $discount=new DiscountAbsolute($this->db); |
|
94 | + $discount->fetch($line->fk_remise_except); |
|
95 | + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0)); |
|
96 | + } |
|
97 | + elseif ($line->description == '(DEPOSIT)' && $line->fk_remise_except > 0) |
|
98 | + { |
|
99 | + $discount=new DiscountAbsolute($this->db); |
|
100 | + $discount->fetch($line->fk_remise_except); |
|
101 | + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0)); |
|
102 | + // Add date of deposit |
|
103 | + if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) |
|
104 | + echo ' ('.dol_print_date($discount->datec).')'; |
|
105 | + } |
|
106 | + elseif ($line->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0) |
|
107 | + { |
|
108 | + $discount=new DiscountAbsolute($this->db); |
|
109 | + $discount->fetch($line->fk_remise_except); |
|
110 | + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessReceived",$discount->getNomUrl(0)); |
|
111 | + } |
|
112 | + elseif ($line->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0) |
|
113 | + { |
|
114 | + $discount=new DiscountAbsolute($this->db); |
|
115 | + $discount->fetch($line->fk_remise_except); |
|
116 | + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessPaid",$discount->getNomUrl(0)); |
|
117 | + } |
|
118 | + else |
|
119 | + { |
|
120 | + echo ($txt?' - ':'').dol_htmlentitiesbr($line->description); |
|
121 | + } |
|
122 | + } |
|
123 | + } |
|
124 | + else |
|
125 | + { |
|
126 | + $format = $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE?'dayhour':'day'; |
|
127 | 127 | |
128 | - if ($line->fk_product > 0) |
|
129 | - { |
|
130 | - echo $form->textwithtooltip($text,$description,3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); |
|
131 | - } |
|
132 | - else |
|
133 | - { |
|
134 | - if ($type==1) $text = img_object($langs->trans('Service'),'service'); |
|
135 | - else $text = img_object($langs->trans('Product'),'product'); |
|
128 | + if ($line->fk_product > 0) |
|
129 | + { |
|
130 | + echo $form->textwithtooltip($text,$description,3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); |
|
131 | + } |
|
132 | + else |
|
133 | + { |
|
134 | + if ($type==1) $text = img_object($langs->trans('Service'),'service'); |
|
135 | + else $text = img_object($langs->trans('Product'),'product'); |
|
136 | 136 | |
137 | - if (! empty($line->label)) { |
|
138 | - $text.= ' <strong>'.$line->label.'</strong>'; |
|
139 | - echo $form->textwithtooltip($text,dol_htmlentitiesbr($line->description),3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); |
|
140 | - } else { |
|
141 | - if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow'); |
|
142 | - echo $text.' '.dol_htmlentitiesbr($line->description); |
|
143 | - } |
|
144 | - } |
|
137 | + if (! empty($line->label)) { |
|
138 | + $text.= ' <strong>'.$line->label.'</strong>'; |
|
139 | + echo $form->textwithtooltip($text,dol_htmlentitiesbr($line->description),3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); |
|
140 | + } else { |
|
141 | + if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow'); |
|
142 | + echo $text.' '.dol_htmlentitiesbr($line->description); |
|
143 | + } |
|
144 | + } |
|
145 | 145 | |
146 | - // Show date range |
|
147 | - if ($line->element == 'facturedetrec') { |
|
148 | - if ($line->date_start_fill || $line->date_end_fill) echo '<br><div class="clearboth nowraponall">'; |
|
149 | - if ($line->date_start_fill) echo $langs->trans('AutoFillDateFromShort').': '.yn($line->date_start_fill); |
|
150 | - if ($line->date_start_fill && $line->date_end_fill) echo ' - '; |
|
151 | - if ($line->date_end_fill) echo $langs->trans('AutoFillDateToShort').': '.yn($line->date_end_fill); |
|
152 | - if ($line->date_start_fill || $line->date_end_fill) echo '</div>'; |
|
153 | - } |
|
154 | - else { |
|
155 | - if ($line->date_start || $line->date_end) echo '<br><div class="clearboth nowraponall">'.get_date_range($line->date_start, $line->date_end, $format).'</div>'; |
|
156 | - //echo get_date_range($line->date_start, $line->date_end, $format); |
|
157 | - } |
|
146 | + // Show date range |
|
147 | + if ($line->element == 'facturedetrec') { |
|
148 | + if ($line->date_start_fill || $line->date_end_fill) echo '<br><div class="clearboth nowraponall">'; |
|
149 | + if ($line->date_start_fill) echo $langs->trans('AutoFillDateFromShort').': '.yn($line->date_start_fill); |
|
150 | + if ($line->date_start_fill && $line->date_end_fill) echo ' - '; |
|
151 | + if ($line->date_end_fill) echo $langs->trans('AutoFillDateToShort').': '.yn($line->date_end_fill); |
|
152 | + if ($line->date_start_fill || $line->date_end_fill) echo '</div>'; |
|
153 | + } |
|
154 | + else { |
|
155 | + if ($line->date_start || $line->date_end) echo '<br><div class="clearboth nowraponall">'.get_date_range($line->date_start, $line->date_end, $format).'</div>'; |
|
156 | + //echo get_date_range($line->date_start, $line->date_end, $format); |
|
157 | + } |
|
158 | 158 | |
159 | - // Add description in form |
|
160 | - if ($line->fk_product > 0 && ! empty($conf->global->PRODUIT_DESC_IN_FORM)) |
|
161 | - { |
|
162 | - print (! empty($line->description) && $line->description!=$line->product_label)?'<br>'.dol_htmlentitiesbr($line->description):''; |
|
163 | - } |
|
164 | - } |
|
159 | + // Add description in form |
|
160 | + if ($line->fk_product > 0 && ! empty($conf->global->PRODUIT_DESC_IN_FORM)) |
|
161 | + { |
|
162 | + print (! empty($line->description) && $line->description!=$line->product_label)?'<br>'.dol_htmlentitiesbr($line->description):''; |
|
163 | + } |
|
164 | + } |
|
165 | 165 | |
166 | - if (! empty($conf->accounting->enabled) && $line->fk_accounting_account > 0) |
|
167 | - { |
|
168 | - $accountingaccount=new AccountingAccount($this->db); |
|
169 | - $accountingaccount->fetch($line->fk_accounting_account); |
|
170 | - echo '<div class="clearboth"></div><br><span class="opacitymedium">' . $langs->trans('AccountingAffectation') . ' : </span>' . $accountingaccount->getNomUrl(0,1,1); |
|
171 | - } |
|
166 | + if (! empty($conf->accounting->enabled) && $line->fk_accounting_account > 0) |
|
167 | + { |
|
168 | + $accountingaccount=new AccountingAccount($this->db); |
|
169 | + $accountingaccount->fetch($line->fk_accounting_account); |
|
170 | + echo '<div class="clearboth"></div><br><span class="opacitymedium">' . $langs->trans('AccountingAffectation') . ' : </span>' . $accountingaccount->getNomUrl(0,1,1); |
|
171 | + } |
|
172 | 172 | |
173 | - ?> |
|
173 | + ?> |
|
174 | 174 | </td> |
175 | 175 | <?php |
176 | - if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines |
|
177 | - { |
|
178 | - ?> |
|
176 | + if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines |
|
177 | + { |
|
178 | + ?> |
|
179 | 179 | <td class="linecolrefsupplier"><?php |
180 | - echo ($line->ref_fourn?$line->ref_fourn:$line->ref_supplier); |
|
181 | - ?></td> |
|
180 | + echo ($line->ref_fourn?$line->ref_fourn:$line->ref_supplier); |
|
181 | + ?></td> |
|
182 | 182 | <?php |
183 | - } |
|
184 | - // VAT Rate |
|
185 | - ?> |
|
183 | + } |
|
184 | + // VAT Rate |
|
185 | + ?> |
|
186 | 186 | <td align="right" class="linecolvat nowrap"><?php $coldisplay++; ?><?php |
187 | - $positiverates=''; |
|
188 | - if (price2num($line->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx); |
|
189 | - if (price2num($line->total_localtax1)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); |
|
190 | - if (price2num($line->total_localtax2)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); |
|
191 | - if (empty($positiverates)) $positiverates='0'; |
|
192 | - echo vatrate($positiverates.($line->vat_src_code?' ('.$line->vat_src_code.')':''), '%', $line->info_bits); |
|
193 | - //echo vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits); |
|
194 | - ?></td> |
|
187 | + $positiverates=''; |
|
188 | + if (price2num($line->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx); |
|
189 | + if (price2num($line->total_localtax1)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); |
|
190 | + if (price2num($line->total_localtax2)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); |
|
191 | + if (empty($positiverates)) $positiverates='0'; |
|
192 | + echo vatrate($positiverates.($line->vat_src_code?' ('.$line->vat_src_code.')':''), '%', $line->info_bits); |
|
193 | + //echo vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits); |
|
194 | + ?></td> |
|
195 | 195 | |
196 | 196 | <td align="right" class="linecoluht nowrap"><?php $coldisplay++; ?><?php echo price($line->subprice); ?></td> |
197 | 197 | |
@@ -205,45 +205,45 @@ discard block |
||
205 | 205 | |
206 | 206 | <td align="right" class="linecolqty nowrap"><?php $coldisplay++; ?> |
207 | 207 | <?php if ((($line->info_bits & 2) != 2) && $line->special_code != 3) { |
208 | - // I comment this because it shows info even when not required |
|
209 | - // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated |
|
210 | - // must also not be output for most entities (proposal, intervention, ...) |
|
211 | - //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." "; |
|
212 | - echo $line->qty; |
|
213 | - } else echo ' '; ?> |
|
208 | + // I comment this because it shows info even when not required |
|
209 | + // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated |
|
210 | + // must also not be output for most entities (proposal, intervention, ...) |
|
211 | + //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." "; |
|
212 | + echo $line->qty; |
|
213 | + } else echo ' '; ?> |
|
214 | 214 | </td> |
215 | 215 | |
216 | 216 | <?php |
217 | - if($conf->global->PRODUCT_USE_UNITS) |
|
218 | - { |
|
219 | - print '<td align="left" class="linecoluseunit nowrap">'; |
|
220 | - $label = $line->getLabelOfUnit('short'); |
|
221 | - if ($label !== '') { |
|
222 | - print $langs->trans($label); |
|
223 | - } |
|
224 | - print '</td>'; |
|
225 | - } |
|
226 | - ?> |
|
217 | + if($conf->global->PRODUCT_USE_UNITS) |
|
218 | + { |
|
219 | + print '<td align="left" class="linecoluseunit nowrap">'; |
|
220 | + $label = $line->getLabelOfUnit('short'); |
|
221 | + if ($label !== '') { |
|
222 | + print $langs->trans($label); |
|
223 | + } |
|
224 | + print '</td>'; |
|
225 | + } |
|
226 | + ?> |
|
227 | 227 | |
228 | 228 | <?php if (!empty($line->remise_percent) && $line->special_code != 3) { ?> |
229 | 229 | <td class="linecoldiscount" align="right"><?php |
230 | - $coldisplay++; |
|
231 | - include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
|
232 | - echo dol_print_reduction($line->remise_percent,$langs); |
|
233 | - ?></td> |
|
230 | + $coldisplay++; |
|
231 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
|
232 | + echo dol_print_reduction($line->remise_percent,$langs); |
|
233 | + ?></td> |
|
234 | 234 | <?php } else { ?> |
235 | 235 | <td class="linecoldiscount"><?php $coldisplay++; ?> </td> |
236 | 236 | <?php } |
237 | 237 | |
238 | - if ($this->situation_cycle_ref) { |
|
239 | - $coldisplay++; |
|
240 | - print '<td align="right" class="linecolcycleref nowrap">' . $line->situation_percent . '%</td>'; |
|
241 | - } |
|
238 | + if ($this->situation_cycle_ref) { |
|
239 | + $coldisplay++; |
|
240 | + print '<td align="right" class="linecolcycleref nowrap">' . $line->situation_percent . '%</td>'; |
|
241 | + } |
|
242 | 242 | |
243 | - if ($usemargins && ! empty($conf->margin->enabled) && empty($user->societe_id)) |
|
244 | - { |
|
245 | - $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); |
|
246 | - ?> |
|
243 | + if ($usemargins && ! empty($conf->margin->enabled) && empty($user->societe_id)) |
|
244 | + { |
|
245 | + $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); |
|
246 | + ?> |
|
247 | 247 | |
248 | 248 | <?php if (!empty($user->rights->margins->creer)) { ?> |
249 | 249 | <td align="right" class="linecolmargin1 nowrap margininfos"><?php $coldisplay++; ?><?php echo price($line->pa_ht); ?></td> |
@@ -254,8 +254,8 @@ discard block |
||
254 | 254 | if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {?> |
255 | 255 | <td align="right" class="linecolmargin2 nowrap margininfos"><?php $coldisplay++; ?><?php echo price($line->marque_tx, null, null, null, null, $rounding).'%'; ?></td> |
256 | 256 | <?php } |
257 | - } |
|
258 | - ?> |
|
257 | + } |
|
258 | + ?> |
|
259 | 259 | |
260 | 260 | <?php if ($line->special_code == 3) { ?> |
261 | 261 | <td align="right" class="linecoloption nowrap"><?php $coldisplay++; ?><?php echo $langs->trans('Option'); ?></td> |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | |
272 | 272 | |
273 | 273 | <?php |
274 | - if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines' ) { ?> |
|
274 | + if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines' ) { ?> |
|
275 | 275 | <td class="linecoledit" align="center"><?php $coldisplay++; ?> |
276 | 276 | <?php if (($line->info_bits & 2) == 2 || ! empty($disableedit)) { ?> |
277 | 277 | <?php } else { ?> |
@@ -283,16 +283,16 @@ discard block |
||
283 | 283 | |
284 | 284 | <td class="linecoldelete" align="center"><?php $coldisplay++; ?> |
285 | 285 | <?php |
286 | - if (($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disableremove)) { |
|
287 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $this->id . '&action=ask_deleteline&lineid=' . $line->id . '">'; |
|
288 | - print img_delete(); |
|
289 | - print '</a>'; |
|
290 | - } |
|
291 | - ?> |
|
286 | + if (($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disableremove)) { |
|
287 | + print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $this->id . '&action=ask_deleteline&lineid=' . $line->id . '">'; |
|
288 | + print img_delete(); |
|
289 | + print '</a>'; |
|
290 | + } |
|
291 | + ?> |
|
292 | 292 | </td> |
293 | 293 | |
294 | 294 | <?php |
295 | - if ($num > 1 && $conf->browser->layout != 'phone' && ($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disablemove)) { ?> |
|
295 | + if ($num > 1 && $conf->browser->layout != 'phone' && ($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disablemove)) { ?> |
|
296 | 296 | <td align="center" class="linecolmove tdlineupdown"><?php $coldisplay++; ?> |
297 | 297 | <?php if ($i > 0) { ?> |
298 | 298 | <a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=up&rowid='.$line->id; ?>"> |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | //Line extrafield |
322 | 322 | if (!empty($extrafieldsline)) |
323 | 323 | { |
324 | - print $line->showOptionals($extrafieldsline, 'view', array('style'=>'class="drag drop oddeven"','colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); |
|
324 | + print $line->showOptionals($extrafieldsline, 'view', array('style'=>'class="drag drop oddeven"','colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); |
|
325 | 325 | } |
326 | 326 | ?> |
327 | 327 |
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | // Protection to avoid direct call of template |
20 | 20 | if (empty($conf) || ! is_object($conf)) |
21 | 21 | { |
22 | - print "Error, template page can't be called as URL"; |
|
23 | - exit; |
|
22 | + print "Error, template page can't be called as URL"; |
|
23 | + exit; |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | ?> |
@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | print '<td align="right">'.$this->tpl['vat_rate'].'</td>'; |
34 | 34 | print '<td align="right">'.$this->tpl['price'].'</td>'; |
35 | 35 | if (!empty($conf->multicurrency->enabled)) |
36 | - print '<td align="right">'.$this->tpl['multicurrency_price'].'</td>'; |
|
36 | + print '<td align="right">'.$this->tpl['multicurrency_price'].'</td>'; |
|
37 | 37 | |
38 | 38 | print '<td align="right">'.$this->tpl['qty'].'</td>'; |
39 | 39 | if($conf->global->PRODUCT_USE_UNITS) |
40 | - print '<td align="left">'.$langs->trans($this->tpl['unit']).'</td>'; |
|
40 | + print '<td align="left">'.$langs->trans($this->tpl['unit']).'</td>'; |
|
41 | 41 | |
42 | 42 | print '<td align="right">'.$this->tpl['remise_percent'].'</td>'; |
43 | 43 | print '</tr>'."\n"; |
@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | // Protection to avoid direct call of template |
4 | 4 | if (empty($conf) || ! is_object($conf)) |
5 | 5 | { |
6 | - print "Error, template page can't be called as URL"; |
|
7 | - exit; |
|
6 | + print "Error, template page can't be called as URL"; |
|
7 | + exit; |
|
8 | 8 | } |
9 | 9 | |
10 | 10 | if (empty($extrafieldsobjectkey) && is_object($object)) $extrafieldsobjectkey=$object->table_element; |
@@ -12,37 +12,37 @@ discard block |
||
12 | 12 | // Loop to show all columns of extrafields for the search title line |
13 | 13 | if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ... |
14 | 14 | { |
15 | - if (is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label'])) |
|
16 | - { |
|
17 | - foreach($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val) |
|
18 | - { |
|
19 | - if (! empty($arrayfields["ef.".$key]['checked'])) { |
|
20 | - $align=$extrafields->getAlignFlag($key); |
|
21 | - $typeofextrafield=$extrafields->attributes[$extrafieldsobjectkey]['type'][$key]; |
|
22 | - print '<td class="liste_titre'.($align?' '.$align:'').'">'; |
|
23 | - if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key])) |
|
24 | - { |
|
25 | - $crit=$val; |
|
26 | - $tmpkey=preg_replace('/search_options_/','',$key); |
|
27 | - $searchclass=''; |
|
28 | - if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; |
|
29 | - if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; |
|
30 | - print '<input class="flat'.($searchclass?' '.$searchclass:'').'" size="4" type="text" name="search_options_'.$tmpkey.'" value="'.dol_escape_htmltag($search_array_options['search_options_'.$tmpkey]).'">'; |
|
31 | - } |
|
32 | - elseif (! in_array($typeofextrafield, array('datetime','timestamp'))) |
|
33 | - { |
|
34 | - // for the type as 'checkbox', 'chkbxlst', 'sellist' we should use code instead of id (example: I declare a 'chkbxlst' to have a link with dictionnairy, I have to extend it with the 'code' instead 'rowid') |
|
35 | - $morecss=''; |
|
36 | - if ($typeofextrafield == 'sellist') $morecss='maxwidth200'; |
|
37 | - echo $extrafields->showInputField($key, $search_array_options['search_options_'.$key], '', '', 'search_', $morecss); |
|
38 | - } |
|
39 | - elseif (in_array($typeofextrafield, array('datetime','timestamp'))) |
|
40 | - { |
|
41 | - // TODO |
|
42 | - // Use showInputField in a particular manner to have input with a comparison operator, not input for a specific value date-hour-minutes |
|
43 | - } |
|
44 | - print '</td>'; |
|
45 | - } |
|
46 | - } |
|
47 | - } |
|
15 | + if (is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label'])) |
|
16 | + { |
|
17 | + foreach($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val) |
|
18 | + { |
|
19 | + if (! empty($arrayfields["ef.".$key]['checked'])) { |
|
20 | + $align=$extrafields->getAlignFlag($key); |
|
21 | + $typeofextrafield=$extrafields->attributes[$extrafieldsobjectkey]['type'][$key]; |
|
22 | + print '<td class="liste_titre'.($align?' '.$align:'').'">'; |
|
23 | + if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key])) |
|
24 | + { |
|
25 | + $crit=$val; |
|
26 | + $tmpkey=preg_replace('/search_options_/','',$key); |
|
27 | + $searchclass=''; |
|
28 | + if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; |
|
29 | + if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; |
|
30 | + print '<input class="flat'.($searchclass?' '.$searchclass:'').'" size="4" type="text" name="search_options_'.$tmpkey.'" value="'.dol_escape_htmltag($search_array_options['search_options_'.$tmpkey]).'">'; |
|
31 | + } |
|
32 | + elseif (! in_array($typeofextrafield, array('datetime','timestamp'))) |
|
33 | + { |
|
34 | + // for the type as 'checkbox', 'chkbxlst', 'sellist' we should use code instead of id (example: I declare a 'chkbxlst' to have a link with dictionnairy, I have to extend it with the 'code' instead 'rowid') |
|
35 | + $morecss=''; |
|
36 | + if ($typeofextrafield == 'sellist') $morecss='maxwidth200'; |
|
37 | + echo $extrafields->showInputField($key, $search_array_options['search_options_'.$key], '', '', 'search_', $morecss); |
|
38 | + } |
|
39 | + elseif (in_array($typeofextrafield, array('datetime','timestamp'))) |
|
40 | + { |
|
41 | + // TODO |
|
42 | + // Use showInputField in a particular manner to have input with a comparison operator, not input for a specific value date-hour-minutes |
|
43 | + } |
|
44 | + print '</td>'; |
|
45 | + } |
|
46 | + } |
|
47 | + } |
|
48 | 48 | } |
49 | 49 | \ No newline at end of file |
@@ -27,8 +27,8 @@ discard block |
||
27 | 27 | // Protection to avoid direct call of template |
28 | 28 | if (empty($langs) || ! is_object($langs)) |
29 | 29 | { |
30 | - print "Error, template page can't be called as URL"; |
|
31 | - exit; |
|
30 | + print "Error, template page can't be called as URL"; |
|
31 | + exit; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | |
@@ -66,50 +66,50 @@ discard block |
||
66 | 66 | print '<td align="center">'.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).'</td>'; |
67 | 67 | print '<td align="center">'.$form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")).'</td>'; |
68 | 68 | if ($conf->multicompany->enabled) { |
69 | - print '<td align="center">'.$langs->trans("Entities").'</td>'; |
|
69 | + print '<td align="center">'.$langs->trans("Entities").'</td>'; |
|
70 | 70 | } |
71 | 71 | print '<td width="80"> </td>'; |
72 | 72 | print "</tr>\n"; |
73 | 73 | |
74 | 74 | if (is_array($extrafields->attributes[$elementtype]['type']) && count($extrafields->attributes[$elementtype]['type'])) |
75 | 75 | { |
76 | - foreach($extrafields->attributes[$elementtype]['type'] as $key => $value) |
|
77 | - { |
|
78 | - // Load language if required |
|
79 | - if (! empty($extrafields->attributes[$elementtype]['langfile'][$key])) { |
|
80 | - $langs->load($extrafields->attributes[$elementtype]['langfile'][$key]); |
|
81 | - } |
|
76 | + foreach($extrafields->attributes[$elementtype]['type'] as $key => $value) |
|
77 | + { |
|
78 | + // Load language if required |
|
79 | + if (! empty($extrafields->attributes[$elementtype]['langfile'][$key])) { |
|
80 | + $langs->load($extrafields->attributes[$elementtype]['langfile'][$key]); |
|
81 | + } |
|
82 | 82 | |
83 | - print '<tr class="oddeven">'; |
|
84 | - print "<td>".$extrafields->attributes[$elementtype]['pos'][$key]."</td>\n"; |
|
85 | - print "<td>".$extrafields->attributes[$elementtype]['label'][$key]."</td>\n"; // We don't translate here, we want admin to know what is the key not translated value |
|
86 | - print "<td>".$langs->trans($extrafields->attributes[$elementtype]['label'][$key])."</td>\n"; |
|
87 | - print "<td>".$key."</td>\n"; |
|
88 | - print "<td>".$type2label[$extrafields->attributes[$elementtype]['type'][$key]]."</td>\n"; |
|
89 | - print '<td align="right">'.$extrafields->attributes[$elementtype]['size'][$key]."</td>\n"; |
|
90 | - print '<td>'.dol_trunc($extrafields->attributes[$elementtype]['computed'][$key], 20)."</td>\n"; |
|
91 | - print '<td align="center">'.yn($extrafields->attributes[$elementtype]['unique'][$key])."</td>\n"; |
|
92 | - print '<td align="center">'.yn($extrafields->attributes[$elementtype]['required'][$key])."</td>\n"; |
|
93 | - print '<td align="center">'.yn($extrafields->attributes[$elementtype]['alwayseditable'][$key])."</td>\n"; |
|
94 | - print '<td align="center">'.$extrafields->attributes[$elementtype]['list'][$key]."</td>\n"; |
|
95 | - print '<td align="center">'.yn($extrafields->attributes[$elementtype]['totalizable'][$key])."</td>\n"; |
|
96 | - if (! empty($conf->multicompany->enabled)) { |
|
97 | - print '<td align="center">'.($extrafields->attributes[$elementtype]['entityid'][$key]==0?$langs->trans("All"):$extrafields->attributes[$elementtype]['entitylabel'][$key]).'</td>'; |
|
98 | - } |
|
99 | - print '<td class="right nowraponall""><a href="'.$_SERVER["PHP_SELF"].'?action=edit&attrname='.$key.'#formeditextrafield">'.img_edit().'</a>'; |
|
100 | - print " <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=$key\">".img_delete()."</a></td>\n"; |
|
101 | - print "</tr>"; |
|
102 | - } |
|
83 | + print '<tr class="oddeven">'; |
|
84 | + print "<td>".$extrafields->attributes[$elementtype]['pos'][$key]."</td>\n"; |
|
85 | + print "<td>".$extrafields->attributes[$elementtype]['label'][$key]."</td>\n"; // We don't translate here, we want admin to know what is the key not translated value |
|
86 | + print "<td>".$langs->trans($extrafields->attributes[$elementtype]['label'][$key])."</td>\n"; |
|
87 | + print "<td>".$key."</td>\n"; |
|
88 | + print "<td>".$type2label[$extrafields->attributes[$elementtype]['type'][$key]]."</td>\n"; |
|
89 | + print '<td align="right">'.$extrafields->attributes[$elementtype]['size'][$key]."</td>\n"; |
|
90 | + print '<td>'.dol_trunc($extrafields->attributes[$elementtype]['computed'][$key], 20)."</td>\n"; |
|
91 | + print '<td align="center">'.yn($extrafields->attributes[$elementtype]['unique'][$key])."</td>\n"; |
|
92 | + print '<td align="center">'.yn($extrafields->attributes[$elementtype]['required'][$key])."</td>\n"; |
|
93 | + print '<td align="center">'.yn($extrafields->attributes[$elementtype]['alwayseditable'][$key])."</td>\n"; |
|
94 | + print '<td align="center">'.$extrafields->attributes[$elementtype]['list'][$key]."</td>\n"; |
|
95 | + print '<td align="center">'.yn($extrafields->attributes[$elementtype]['totalizable'][$key])."</td>\n"; |
|
96 | + if (! empty($conf->multicompany->enabled)) { |
|
97 | + print '<td align="center">'.($extrafields->attributes[$elementtype]['entityid'][$key]==0?$langs->trans("All"):$extrafields->attributes[$elementtype]['entitylabel'][$key]).'</td>'; |
|
98 | + } |
|
99 | + print '<td class="right nowraponall""><a href="'.$_SERVER["PHP_SELF"].'?action=edit&attrname='.$key.'#formeditextrafield">'.img_edit().'</a>'; |
|
100 | + print " <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=$key\">".img_delete()."</a></td>\n"; |
|
101 | + print "</tr>"; |
|
102 | + } |
|
103 | 103 | } |
104 | 104 | else |
105 | 105 | { |
106 | - $colspan=9; |
|
106 | + $colspan=9; |
|
107 | 107 | |
108 | - print '<tr class="oddeven">'; |
|
109 | - print '<td class="opacitymedium" colspan="'.$colspan.'">'; |
|
110 | - print $langs->trans("None"); |
|
111 | - print '</td>'; |
|
112 | - print '</tr>'; |
|
108 | + print '<tr class="oddeven">'; |
|
109 | + print '<td class="opacitymedium" colspan="'.$colspan.'">'; |
|
110 | + print $langs->trans("None"); |
|
111 | + print '</td>'; |
|
112 | + print '</tr>'; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | print "</table>"; |
@@ -10,31 +10,31 @@ discard block |
||
10 | 10 | dol_include_once($keyforclassfile); |
11 | 11 | if (class_exists($keyforclass)) |
12 | 12 | { |
13 | - $tmpobject=new $keyforclass($this->db); |
|
13 | + $tmpobject=new $keyforclass($this->db); |
|
14 | 14 | |
15 | - // Add common fields |
|
16 | - foreach($tmpobject->fields as $keyfield => $valuefield) |
|
17 | - { |
|
18 | - $fieldname = 't' . '.' . $keyfield; |
|
19 | - $fieldlabel = ucfirst($valuefield['label']); |
|
20 | - $typeFilter = "Text"; |
|
21 | - $typefield=preg_replace('/\(.*$/', '', $valuefield['type']); // double(24,8) -> double |
|
22 | - switch ($typefield) { |
|
23 | - case 'int': |
|
24 | - case 'integer': |
|
25 | - case 'double': |
|
26 | - case 'price': |
|
27 | - $typeFilter = "Numeric"; |
|
28 | - break; |
|
29 | - case 'date': |
|
30 | - case 'datetime': |
|
31 | - case 'timestamp': |
|
32 | - $typeFilter = "Date"; |
|
33 | - break; |
|
34 | - case 'boolean': |
|
35 | - $typeFilter = "Boolean"; |
|
36 | - break; |
|
37 | - /* |
|
15 | + // Add common fields |
|
16 | + foreach($tmpobject->fields as $keyfield => $valuefield) |
|
17 | + { |
|
18 | + $fieldname = 't' . '.' . $keyfield; |
|
19 | + $fieldlabel = ucfirst($valuefield['label']); |
|
20 | + $typeFilter = "Text"; |
|
21 | + $typefield=preg_replace('/\(.*$/', '', $valuefield['type']); // double(24,8) -> double |
|
22 | + switch ($typefield) { |
|
23 | + case 'int': |
|
24 | + case 'integer': |
|
25 | + case 'double': |
|
26 | + case 'price': |
|
27 | + $typeFilter = "Numeric"; |
|
28 | + break; |
|
29 | + case 'date': |
|
30 | + case 'datetime': |
|
31 | + case 'timestamp': |
|
32 | + $typeFilter = "Date"; |
|
33 | + break; |
|
34 | + case 'boolean': |
|
35 | + $typeFilter = "Boolean"; |
|
36 | + break; |
|
37 | + /* |
|
38 | 38 | * case 'sellist': |
39 | 39 | * $tmp=''; |
40 | 40 | * $tmpparam=unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null |
@@ -45,16 +45,16 @@ discard block |
||
45 | 45 | * if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter="List:".$tmp; |
46 | 46 | * break; |
47 | 47 | */ |
48 | - } |
|
49 | - if ($valuefield['enabled']) { |
|
50 | - $this->export_fields_array[$r][$fieldname] = $fieldlabel; |
|
51 | - $this->export_TypeFields_array[$r][$fieldname] = $typeFilter; |
|
52 | - $this->export_entities_array[$r][$fieldname] = $keyforelement; |
|
53 | - } |
|
54 | - } |
|
48 | + } |
|
49 | + if ($valuefield['enabled']) { |
|
50 | + $this->export_fields_array[$r][$fieldname] = $fieldlabel; |
|
51 | + $this->export_TypeFields_array[$r][$fieldname] = $typeFilter; |
|
52 | + $this->export_entities_array[$r][$fieldname] = $keyforelement; |
|
53 | + } |
|
54 | + } |
|
55 | 55 | } |
56 | 56 | else |
57 | 57 | { |
58 | - dol_print_error($this->db, 'Failed to find class '.$keyforclass.', even after the include of '.$keyforclassfile); |
|
58 | + dol_print_error($this->db, 'Failed to find class '.$keyforclass.', even after the include of '.$keyforclassfile); |
|
59 | 59 | } |
60 | 60 | // End add common fields |