@@ -34,22 +34,22 @@ |
||
34 | 34 | */ |
35 | 35 | function import_prepare_head($param, $maxstep=0) |
36 | 36 | { |
37 | - global $langs; |
|
37 | + global $langs; |
|
38 | 38 | |
39 | - if (empty($maxstep)) $maxstep=6; |
|
39 | + if (empty($maxstep)) $maxstep=6; |
|
40 | 40 | |
41 | - $h=0; |
|
42 | - $head = array(); |
|
43 | - $i=1; |
|
44 | - while($i <= $maxstep) |
|
45 | - { |
|
46 | - $head[$h][0] = DOL_URL_ROOT.'/imports/import.php?step='.$i.$param; |
|
47 | - $head[$h][1] = $langs->trans("Step")." ".$i; |
|
48 | - $head[$h][2] = 'step'.$i; |
|
49 | - $h++; |
|
50 | - $i++; |
|
51 | - } |
|
41 | + $h=0; |
|
42 | + $head = array(); |
|
43 | + $i=1; |
|
44 | + while($i <= $maxstep) |
|
45 | + { |
|
46 | + $head[$h][0] = DOL_URL_ROOT.'/imports/import.php?step='.$i.$param; |
|
47 | + $head[$h][1] = $langs->trans("Step")." ".$i; |
|
48 | + $head[$h][2] = 'step'.$i; |
|
49 | + $h++; |
|
50 | + $i++; |
|
51 | + } |
|
52 | 52 | |
53 | - return $head; |
|
53 | + return $head; |
|
54 | 54 | } |
55 | 55 |
@@ -32,16 +32,16 @@ |
||
32 | 32 | * @param int $maxstep Limit steps to maxstep or no limit if 0 |
33 | 33 | * @return array Array of tabs |
34 | 34 | */ |
35 | -function import_prepare_head($param, $maxstep=0) |
|
35 | +function import_prepare_head($param, $maxstep = 0) |
|
36 | 36 | { |
37 | 37 | global $langs; |
38 | 38 | |
39 | - if (empty($maxstep)) $maxstep=6; |
|
39 | + if (empty($maxstep)) $maxstep = 6; |
|
40 | 40 | |
41 | - $h=0; |
|
41 | + $h = 0; |
|
42 | 42 | $head = array(); |
43 | - $i=1; |
|
44 | - while($i <= $maxstep) |
|
43 | + $i = 1; |
|
44 | + while ($i <= $maxstep) |
|
45 | 45 | { |
46 | 46 | $head[$h][0] = DOL_URL_ROOT.'/imports/import.php?step='.$i.$param; |
47 | 47 | $head[$h][1] = $langs->trans("Step")." ".$i; |
@@ -36,7 +36,9 @@ |
||
36 | 36 | { |
37 | 37 | global $langs; |
38 | 38 | |
39 | - if (empty($maxstep)) $maxstep=6; |
|
39 | + if (empty($maxstep)) { |
|
40 | + $maxstep=6; |
|
41 | + } |
|
40 | 42 | |
41 | 43 | $h=0; |
42 | 44 | $head = array(); |
@@ -49,157 +49,157 @@ discard block |
||
49 | 49 | */ |
50 | 50 | function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $action, $showextcals=array(), $actioncode='', $usergroupid='', $excludetype='', $resourceid=0) |
51 | 51 | { |
52 | - global $conf, $user, $langs, $db, $hookmanager; |
|
53 | - global $begin_h, $end_h, $begin_d, $end_d; |
|
54 | - |
|
55 | - $langs->load("companies"); |
|
56 | - |
|
57 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; |
|
58 | - $formactions=new FormActions($db); |
|
59 | - |
|
60 | - // Filters |
|
61 | - //print '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="get">'; |
|
62 | - print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">'; |
|
63 | - print '<input type="hidden" name="year" value="' . $year . '">'; |
|
64 | - print '<input type="hidden" name="month" value="' . $month . '">'; |
|
65 | - print '<input type="hidden" name="day" value="' . $day . '">'; |
|
66 | - print '<input type="hidden" name="action" value="' . $action . '">'; |
|
67 | - print '<input type="hidden" name="search_showbirthday" value="' . $showbirthday . '">'; |
|
68 | - |
|
69 | - print '<div class="fichecenter">'; |
|
70 | - |
|
71 | - if ($conf->browser->layout == 'phone') print '<div class="fichehalfleft">'; |
|
72 | - else print '<table class="nobordernopadding" width="100%"><tr><td class="borderright">'; |
|
73 | - |
|
74 | - print '<table class="nobordernopadding centpercent">'; |
|
75 | - |
|
76 | - if ($canedit) |
|
77 | - { |
|
78 | - print '<tr>'; |
|
79 | - print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">'; |
|
80 | - print $langs->trans("ActionsToDoBy").' '; |
|
81 | - print '</td><td style="padding-bottom: 2px; padding-right: 4px;">'; |
|
82 | - print $form->select_dolusers($filtert, 'search_filtert', 1, '', ! $canedit, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); |
|
83 | - if (empty($conf->dol_optimize_smallscreen)) print ' '.$langs->trans("or") . ' '.$langs->trans("ToUserOfGroup").' '; |
|
84 | - print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', ! $canedit); |
|
85 | - print '</td></tr>'; |
|
86 | - |
|
87 | - if ($conf->resource->enabled) |
|
88 | - { |
|
89 | - include_once DOL_DOCUMENT_ROOT . '/resource/class/html.formresource.class.php'; |
|
90 | - $formresource=new FormResource($db); |
|
91 | - |
|
92 | - // Resource |
|
93 | - print '<tr>'; |
|
94 | - print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">'; |
|
95 | - print $langs->trans("Resource"); |
|
96 | - print ' </td><td class="nowrap maxwidthonsmartphone" style="padding-bottom: 2px; padding-right: 4px;">'; |
|
52 | + global $conf, $user, $langs, $db, $hookmanager; |
|
53 | + global $begin_h, $end_h, $begin_d, $end_d; |
|
54 | + |
|
55 | + $langs->load("companies"); |
|
56 | + |
|
57 | + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; |
|
58 | + $formactions=new FormActions($db); |
|
59 | + |
|
60 | + // Filters |
|
61 | + //print '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="get">'; |
|
62 | + print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">'; |
|
63 | + print '<input type="hidden" name="year" value="' . $year . '">'; |
|
64 | + print '<input type="hidden" name="month" value="' . $month . '">'; |
|
65 | + print '<input type="hidden" name="day" value="' . $day . '">'; |
|
66 | + print '<input type="hidden" name="action" value="' . $action . '">'; |
|
67 | + print '<input type="hidden" name="search_showbirthday" value="' . $showbirthday . '">'; |
|
68 | + |
|
69 | + print '<div class="fichecenter">'; |
|
70 | + |
|
71 | + if ($conf->browser->layout == 'phone') print '<div class="fichehalfleft">'; |
|
72 | + else print '<table class="nobordernopadding" width="100%"><tr><td class="borderright">'; |
|
73 | + |
|
74 | + print '<table class="nobordernopadding centpercent">'; |
|
75 | + |
|
76 | + if ($canedit) |
|
77 | + { |
|
78 | + print '<tr>'; |
|
79 | + print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">'; |
|
80 | + print $langs->trans("ActionsToDoBy").' '; |
|
81 | + print '</td><td style="padding-bottom: 2px; padding-right: 4px;">'; |
|
82 | + print $form->select_dolusers($filtert, 'search_filtert', 1, '', ! $canedit, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); |
|
83 | + if (empty($conf->dol_optimize_smallscreen)) print ' '.$langs->trans("or") . ' '.$langs->trans("ToUserOfGroup").' '; |
|
84 | + print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', ! $canedit); |
|
85 | + print '</td></tr>'; |
|
86 | + |
|
87 | + if ($conf->resource->enabled) |
|
88 | + { |
|
89 | + include_once DOL_DOCUMENT_ROOT . '/resource/class/html.formresource.class.php'; |
|
90 | + $formresource=new FormResource($db); |
|
91 | + |
|
92 | + // Resource |
|
93 | + print '<tr>'; |
|
94 | + print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">'; |
|
95 | + print $langs->trans("Resource"); |
|
96 | + print ' </td><td class="nowrap maxwidthonsmartphone" style="padding-bottom: 2px; padding-right: 4px;">'; |
|
97 | 97 | print $formresource->select_resource_list($resourceid, "search_resourceid", '', 1, 0, 0, null, '', 2); |
98 | - print '</td></tr>'; |
|
99 | - } |
|
100 | - |
|
101 | - // Type |
|
102 | - print '<tr>'; |
|
103 | - print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">'; |
|
104 | - print $langs->trans("Type"); |
|
105 | - print ' </td><td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">'; |
|
106 | - $multiselect=0; |
|
107 | - if (! empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) // We use an option here because it adds bugs when used on agenda page "peruser" and "list" |
|
108 | - { |
|
98 | + print '</td></tr>'; |
|
99 | + } |
|
100 | + |
|
101 | + // Type |
|
102 | + print '<tr>'; |
|
103 | + print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">'; |
|
104 | + print $langs->trans("Type"); |
|
105 | + print ' </td><td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">'; |
|
106 | + $multiselect=0; |
|
107 | + if (! empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) // We use an option here because it adds bugs when used on agenda page "peruser" and "list" |
|
108 | + { |
|
109 | 109 | $multiselect=(!empty($conf->global->AGENDA_USE_EVENT_TYPE)); |
110 | - } |
|
110 | + } |
|
111 | 111 | print $formactions->select_type_actions($actioncode, "search_actioncode", $excludetype, (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:-1), 0, $multiselect); |
112 | - print '</td></tr>'; |
|
113 | - } |
|
114 | - |
|
115 | - if (! empty($conf->societe->enabled) && $user->rights->societe->lire) |
|
116 | - { |
|
117 | - print '<tr>'; |
|
118 | - print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">'; |
|
119 | - print $langs->trans("ThirdParty").' '; |
|
120 | - print '</td><td class="nowrap" style="padding-bottom: 2px;">'; |
|
121 | - print $form->select_company($socid, 'search_socid', '', 'SelectThirdParty', 0, 0, null, 0); |
|
122 | - print '</td></tr>'; |
|
123 | - } |
|
124 | - |
|
125 | - if (! empty($conf->projet->enabled) && $user->rights->projet->lire) |
|
126 | - { |
|
127 | - require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
128 | - $formproject=new FormProjets($db); |
|
129 | - |
|
130 | - print '<tr>'; |
|
131 | - print '<td class="nowrap" style="padding-bottom: 2px;">'; |
|
132 | - print $langs->trans("Project").' '; |
|
133 | - print '</td><td class="nowrap" style="padding-bottom: 2px;">'; |
|
134 | - print $formproject->select_projects($socid?$socid:-1, $pid, 'search_projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, 'maxwidth500'); |
|
135 | - print '</td></tr>'; |
|
136 | - } |
|
137 | - |
|
138 | - if ($canedit && ! preg_match('/list/', $_SERVER["PHP_SELF"])) |
|
139 | - { |
|
140 | - // Status |
|
141 | - print '<tr>'; |
|
142 | - print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">'; |
|
143 | - print $langs->trans("Status"); |
|
144 | - print ' </td><td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">'; |
|
145 | - $formactions->form_select_status_action('formaction', $status, 1, 'search_status', 1, 2, 'minwidth100'); |
|
146 | - print '</td></tr>'; |
|
147 | - } |
|
148 | - |
|
149 | - if ($canedit && $action == 'show_peruser') |
|
150 | - { |
|
151 | - // Filter on hours |
|
152 | - print '<tr>'; |
|
153 | - print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">'.$langs->trans("VisibleTimeRange").'</td>'; |
|
154 | - print "<td class='nowrap'>"; |
|
155 | - print '<div class="ui-grid-a"><div class="ui-block-a">'; |
|
156 | - print '<input type="number" class="short" name="begin_h" value="'.$begin_h.'" min="0" max="23">'; |
|
157 | - if (empty($conf->dol_use_jmobile)) print ' - '; |
|
158 | - else print '</div><div class="ui-block-b">'; |
|
159 | - print '<input type="number" class="short" name="end_h" value="'.$end_h.'" min="1" max="24">'; |
|
160 | - if (empty($conf->dol_use_jmobile)) print ' '.$langs->trans("H"); |
|
161 | - print '</div></div>'; |
|
162 | - print '</td></tr>'; |
|
163 | - |
|
164 | - // Filter on days |
|
165 | - print '<tr>'; |
|
166 | - print '<td class="nowrap">'.$langs->trans("VisibleDaysRange").'</td>'; |
|
167 | - print "<td class='nowrap'>"; |
|
168 | - print '<div class="ui-grid-a"><div class="ui-block-a">'; |
|
169 | - print '<input type="number" class="short" name="begin_d" value="'.$begin_d.'" min="1" max="7">'; |
|
170 | - if (empty($conf->dol_use_jmobile)) print ' - '; |
|
171 | - else print '</div><div class="ui-block-b">'; |
|
172 | - print '<input type="number" class="short" name="end_d" value="'.$end_d.'" min="1" max="7">'; |
|
173 | - print '</div></div>'; |
|
174 | - print '</td></tr>'; |
|
175 | - } |
|
176 | - |
|
177 | - // Hooks |
|
178 | - $parameters = array('canedit'=>$canedit, 'pid'=>$pid, 'socid'=>$socid); |
|
179 | - $reshook = $hookmanager->executeHooks('searchAgendaFrom', $parameters, $object, $action); // Note that $action and $object may have been |
|
180 | - |
|
181 | - print '</table>'; |
|
182 | - |
|
183 | - if ($conf->browser->layout == 'phone') print '</div>'; |
|
184 | - else print '</td>'; |
|
185 | - |
|
186 | - if ($conf->browser->layout == 'phone') print '<div class="fichehalfright">'; |
|
187 | - else print '<td align="center" valign="middle" class="nowrap">'; |
|
188 | - |
|
189 | - print '<table class="centpercent"><tr><td align="center">'; |
|
190 | - print '<div class="formleftzone">'; |
|
191 | - print '<input type="submit" class="button" style="min-width:120px" name="refresh" value="' . $langs->trans("Refresh") . '">'; |
|
192 | - print '</div>'; |
|
193 | - print '</td></tr>'; |
|
194 | - print '</table>'; |
|
195 | - |
|
196 | - if ($conf->browser->layout == 'phone') print '</div>'; |
|
197 | - else print '</td></tr></table>'; |
|
198 | - |
|
199 | - print '</div>'; // Close fichecenter |
|
200 | - print '<div style="clear:both"></div>'; |
|
201 | - |
|
202 | - //print '</form>'; |
|
112 | + print '</td></tr>'; |
|
113 | + } |
|
114 | + |
|
115 | + if (! empty($conf->societe->enabled) && $user->rights->societe->lire) |
|
116 | + { |
|
117 | + print '<tr>'; |
|
118 | + print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">'; |
|
119 | + print $langs->trans("ThirdParty").' '; |
|
120 | + print '</td><td class="nowrap" style="padding-bottom: 2px;">'; |
|
121 | + print $form->select_company($socid, 'search_socid', '', 'SelectThirdParty', 0, 0, null, 0); |
|
122 | + print '</td></tr>'; |
|
123 | + } |
|
124 | + |
|
125 | + if (! empty($conf->projet->enabled) && $user->rights->projet->lire) |
|
126 | + { |
|
127 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
128 | + $formproject=new FormProjets($db); |
|
129 | + |
|
130 | + print '<tr>'; |
|
131 | + print '<td class="nowrap" style="padding-bottom: 2px;">'; |
|
132 | + print $langs->trans("Project").' '; |
|
133 | + print '</td><td class="nowrap" style="padding-bottom: 2px;">'; |
|
134 | + print $formproject->select_projects($socid?$socid:-1, $pid, 'search_projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, 'maxwidth500'); |
|
135 | + print '</td></tr>'; |
|
136 | + } |
|
137 | + |
|
138 | + if ($canedit && ! preg_match('/list/', $_SERVER["PHP_SELF"])) |
|
139 | + { |
|
140 | + // Status |
|
141 | + print '<tr>'; |
|
142 | + print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">'; |
|
143 | + print $langs->trans("Status"); |
|
144 | + print ' </td><td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">'; |
|
145 | + $formactions->form_select_status_action('formaction', $status, 1, 'search_status', 1, 2, 'minwidth100'); |
|
146 | + print '</td></tr>'; |
|
147 | + } |
|
148 | + |
|
149 | + if ($canedit && $action == 'show_peruser') |
|
150 | + { |
|
151 | + // Filter on hours |
|
152 | + print '<tr>'; |
|
153 | + print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">'.$langs->trans("VisibleTimeRange").'</td>'; |
|
154 | + print "<td class='nowrap'>"; |
|
155 | + print '<div class="ui-grid-a"><div class="ui-block-a">'; |
|
156 | + print '<input type="number" class="short" name="begin_h" value="'.$begin_h.'" min="0" max="23">'; |
|
157 | + if (empty($conf->dol_use_jmobile)) print ' - '; |
|
158 | + else print '</div><div class="ui-block-b">'; |
|
159 | + print '<input type="number" class="short" name="end_h" value="'.$end_h.'" min="1" max="24">'; |
|
160 | + if (empty($conf->dol_use_jmobile)) print ' '.$langs->trans("H"); |
|
161 | + print '</div></div>'; |
|
162 | + print '</td></tr>'; |
|
163 | + |
|
164 | + // Filter on days |
|
165 | + print '<tr>'; |
|
166 | + print '<td class="nowrap">'.$langs->trans("VisibleDaysRange").'</td>'; |
|
167 | + print "<td class='nowrap'>"; |
|
168 | + print '<div class="ui-grid-a"><div class="ui-block-a">'; |
|
169 | + print '<input type="number" class="short" name="begin_d" value="'.$begin_d.'" min="1" max="7">'; |
|
170 | + if (empty($conf->dol_use_jmobile)) print ' - '; |
|
171 | + else print '</div><div class="ui-block-b">'; |
|
172 | + print '<input type="number" class="short" name="end_d" value="'.$end_d.'" min="1" max="7">'; |
|
173 | + print '</div></div>'; |
|
174 | + print '</td></tr>'; |
|
175 | + } |
|
176 | + |
|
177 | + // Hooks |
|
178 | + $parameters = array('canedit'=>$canedit, 'pid'=>$pid, 'socid'=>$socid); |
|
179 | + $reshook = $hookmanager->executeHooks('searchAgendaFrom', $parameters, $object, $action); // Note that $action and $object may have been |
|
180 | + |
|
181 | + print '</table>'; |
|
182 | + |
|
183 | + if ($conf->browser->layout == 'phone') print '</div>'; |
|
184 | + else print '</td>'; |
|
185 | + |
|
186 | + if ($conf->browser->layout == 'phone') print '<div class="fichehalfright">'; |
|
187 | + else print '<td align="center" valign="middle" class="nowrap">'; |
|
188 | + |
|
189 | + print '<table class="centpercent"><tr><td align="center">'; |
|
190 | + print '<div class="formleftzone">'; |
|
191 | + print '<input type="submit" class="button" style="min-width:120px" name="refresh" value="' . $langs->trans("Refresh") . '">'; |
|
192 | + print '</div>'; |
|
193 | + print '</td></tr>'; |
|
194 | + print '</table>'; |
|
195 | + |
|
196 | + if ($conf->browser->layout == 'phone') print '</div>'; |
|
197 | + else print '</td></tr></table>'; |
|
198 | + |
|
199 | + print '</div>'; // Close fichecenter |
|
200 | + print '<div style="clear:both"></div>'; |
|
201 | + |
|
202 | + //print '</form>'; |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | |
@@ -211,42 +211,42 @@ discard block |
||
211 | 211 | */ |
212 | 212 | function show_array_actions_to_do($max=5) |
213 | 213 | { |
214 | - global $langs, $conf, $user, $db, $bc, $socid; |
|
214 | + global $langs, $conf, $user, $db, $bc, $socid; |
|
215 | 215 | |
216 | - $now=dol_now(); |
|
216 | + $now=dol_now(); |
|
217 | 217 | |
218 | - include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; |
|
219 | - include_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; |
|
218 | + include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; |
|
219 | + include_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; |
|
220 | 220 | |
221 | - $sql = "SELECT a.id, a.label, a.datep as dp, a.datep2 as dp2, a.fk_user_author, a.percent,"; |
|
222 | - $sql.= " c.code, c.libelle as type_label,"; |
|
223 | - $sql.= " s.nom as sname, s.rowid, s.client"; |
|
224 | - $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a LEFT JOIN "; |
|
225 | - $sql.= " ".MAIN_DB_PREFIX."c_actioncomm as c ON c.id = a.fk_action"; |
|
221 | + $sql = "SELECT a.id, a.label, a.datep as dp, a.datep2 as dp2, a.fk_user_author, a.percent,"; |
|
222 | + $sql.= " c.code, c.libelle as type_label,"; |
|
223 | + $sql.= " s.nom as sname, s.rowid, s.client"; |
|
224 | + $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a LEFT JOIN "; |
|
225 | + $sql.= " ".MAIN_DB_PREFIX."c_actioncomm as c ON c.id = a.fk_action"; |
|
226 | 226 | $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; |
227 | - if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; |
|
228 | - $sql.= " WHERE a.entity = ".$conf->entity; |
|
227 | + if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; |
|
228 | + $sql.= " WHERE a.entity = ".$conf->entity; |
|
229 | 229 | $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; |
230 | - if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; |
|
231 | - if ($socid) $sql.= " AND s.rowid = ".$socid; |
|
232 | - $sql.= " ORDER BY a.datep DESC, a.id DESC"; |
|
233 | - $sql.= $db->plimit($max, 0); |
|
230 | + if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; |
|
231 | + if ($socid) $sql.= " AND s.rowid = ".$socid; |
|
232 | + $sql.= " ORDER BY a.datep DESC, a.id DESC"; |
|
233 | + $sql.= $db->plimit($max, 0); |
|
234 | 234 | |
235 | - $resql=$db->query($sql); |
|
236 | - if ($resql) |
|
237 | - { |
|
238 | - $num = $db->num_rows($resql); |
|
235 | + $resql=$db->query($sql); |
|
236 | + if ($resql) |
|
237 | + { |
|
238 | + $num = $db->num_rows($resql); |
|
239 | 239 | |
240 | - print '<table class="noborder" width="100%">'; |
|
241 | - print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("LastActionsToDo",$max).'</th>'; |
|
242 | - print '<th colspan="2" align="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/comm/action/list.php?status=todo">'.$langs->trans("FullList").'</a></th>'; |
|
243 | - print '</tr>'; |
|
240 | + print '<table class="noborder" width="100%">'; |
|
241 | + print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("LastActionsToDo",$max).'</th>'; |
|
242 | + print '<th colspan="2" align="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/comm/action/list.php?status=todo">'.$langs->trans("FullList").'</a></th>'; |
|
243 | + print '</tr>'; |
|
244 | 244 | |
245 | - $var = true; |
|
246 | - $i = 0; |
|
245 | + $var = true; |
|
246 | + $i = 0; |
|
247 | 247 | |
248 | - $staticaction=new ActionComm($db); |
|
249 | - $customerstatic=new Client($db); |
|
248 | + $staticaction=new ActionComm($db); |
|
249 | + $customerstatic=new Client($db); |
|
250 | 250 | |
251 | 251 | while ($i < $num) |
252 | 252 | { |
@@ -260,15 +260,15 @@ discard block |
||
260 | 260 | $staticaction->id=$obj->id; |
261 | 261 | print '<td>'.$staticaction->getNomUrl(1,34).'</td>'; |
262 | 262 | |
263 | - // print '<td>'.dol_trunc($obj->label,22).'</td>'; |
|
263 | + // print '<td>'.dol_trunc($obj->label,22).'</td>'; |
|
264 | 264 | |
265 | 265 | print '<td>'; |
266 | 266 | if ($obj->rowid > 0) |
267 | 267 | { |
268 | - $customerstatic->id=$obj->rowid; |
|
269 | - $customerstatic->name=$obj->sname; |
|
270 | - $customerstatic->client=$obj->client; |
|
271 | - print $customerstatic->getNomUrl(1,'',16); |
|
268 | + $customerstatic->id=$obj->rowid; |
|
269 | + $customerstatic->name=$obj->sname; |
|
270 | + $customerstatic->client=$obj->client; |
|
271 | + print $customerstatic->getNomUrl(1,'',16); |
|
272 | 272 | } |
273 | 273 | print '</td>'; |
274 | 274 | |
@@ -276,30 +276,30 @@ discard block |
||
276 | 276 | $datep2=$db->jdate($obj->dp2); |
277 | 277 | |
278 | 278 | // Date |
279 | - print '<td width="100" align="right">'.dol_print_date($datep,'day').' '; |
|
280 | - $late=0; |
|
281 | - if ($obj->percent == 0 && $datep && $datep < time()) $late=1; |
|
282 | - if ($obj->percent == 0 && ! $datep && $datep2 && $datep2 < time()) $late=1; |
|
283 | - if ($obj->percent > 0 && $obj->percent < 100 && $datep2 && $datep2 < time()) $late=1; |
|
284 | - if ($obj->percent > 0 && $obj->percent < 100 && ! $datep2 && $datep && $datep < time()) $late=1; |
|
285 | - if ($late) print img_warning($langs->trans("Late")); |
|
286 | - print "</td>"; |
|
279 | + print '<td width="100" align="right">'.dol_print_date($datep,'day').' '; |
|
280 | + $late=0; |
|
281 | + if ($obj->percent == 0 && $datep && $datep < time()) $late=1; |
|
282 | + if ($obj->percent == 0 && ! $datep && $datep2 && $datep2 < time()) $late=1; |
|
283 | + if ($obj->percent > 0 && $obj->percent < 100 && $datep2 && $datep2 < time()) $late=1; |
|
284 | + if ($obj->percent > 0 && $obj->percent < 100 && ! $datep2 && $datep && $datep < time()) $late=1; |
|
285 | + if ($late) print img_warning($langs->trans("Late")); |
|
286 | + print "</td>"; |
|
287 | 287 | |
288 | - // Statut |
|
289 | - print "<td align=\"right\" width=\"14\">".$staticaction->LibStatut($obj->percent,3)."</td>\n"; |
|
288 | + // Statut |
|
289 | + print "<td align=\"right\" width=\"14\">".$staticaction->LibStatut($obj->percent,3)."</td>\n"; |
|
290 | 290 | |
291 | - print "</tr>\n"; |
|
291 | + print "</tr>\n"; |
|
292 | 292 | |
293 | 293 | $i++; |
294 | 294 | } |
295 | - print "</table><br>"; |
|
296 | - |
|
297 | - $db->free($resql); |
|
298 | - } |
|
299 | - else |
|
300 | - { |
|
301 | - dol_print_error($db); |
|
302 | - } |
|
295 | + print "</table><br>"; |
|
296 | + |
|
297 | + $db->free($resql); |
|
298 | + } |
|
299 | + else |
|
300 | + { |
|
301 | + dol_print_error($db); |
|
302 | + } |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | |
@@ -311,83 +311,83 @@ discard block |
||
311 | 311 | */ |
312 | 312 | function show_array_last_actions_done($max=5) |
313 | 313 | { |
314 | - global $langs, $conf, $user, $db, $bc, $socid; |
|
314 | + global $langs, $conf, $user, $db, $bc, $socid; |
|
315 | 315 | |
316 | - $now=dol_now(); |
|
316 | + $now=dol_now(); |
|
317 | 317 | |
318 | - $sql = "SELECT a.id, a.percent, a.datep as da, a.datep2 as da2, a.fk_user_author, a.label,"; |
|
319 | - $sql.= " c.code, c.libelle,"; |
|
320 | - $sql.= " s.rowid, s.nom as sname, s.client"; |
|
321 | - $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a LEFT JOIN "; |
|
322 | - $sql.= " ".MAIN_DB_PREFIX."c_actioncomm as c ON c.id = a.fk_action "; |
|
318 | + $sql = "SELECT a.id, a.percent, a.datep as da, a.datep2 as da2, a.fk_user_author, a.label,"; |
|
319 | + $sql.= " c.code, c.libelle,"; |
|
320 | + $sql.= " s.rowid, s.nom as sname, s.client"; |
|
321 | + $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a LEFT JOIN "; |
|
322 | + $sql.= " ".MAIN_DB_PREFIX."c_actioncomm as c ON c.id = a.fk_action "; |
|
323 | 323 | $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; |
324 | - if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; |
|
325 | - $sql.= " WHERE a.entity = ".$conf->entity; |
|
324 | + if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; |
|
325 | + $sql.= " WHERE a.entity = ".$conf->entity; |
|
326 | 326 | $sql.= " AND (a.percent >= 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; |
327 | - if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; |
|
327 | + if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; |
|
328 | 328 | if ($socid) $sql.= " AND s.rowid = ".$socid; |
329 | - $sql .= " ORDER BY a.datep2 DESC"; |
|
330 | - $sql .= $db->plimit($max, 0); |
|
329 | + $sql .= " ORDER BY a.datep2 DESC"; |
|
330 | + $sql .= $db->plimit($max, 0); |
|
331 | 331 | |
332 | - $resql=$db->query($sql); |
|
333 | - if ($resql) |
|
334 | - { |
|
335 | - $num = $db->num_rows($resql); |
|
332 | + $resql=$db->query($sql); |
|
333 | + if ($resql) |
|
334 | + { |
|
335 | + $num = $db->num_rows($resql); |
|
336 | 336 | |
337 | - print '<table class="noborder" width="100%">'; |
|
338 | - print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("LastDoneTasks",$max).'</th>'; |
|
339 | - print '<th colspan="2" align="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/comm/action/list.php?status=done">'.$langs->trans("FullList").'</a></th>'; |
|
340 | - print '</tr>'; |
|
341 | - $var = true; |
|
342 | - $i = 0; |
|
337 | + print '<table class="noborder" width="100%">'; |
|
338 | + print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("LastDoneTasks",$max).'</th>'; |
|
339 | + print '<th colspan="2" align="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/comm/action/list.php?status=done">'.$langs->trans("FullList").'</a></th>'; |
|
340 | + print '</tr>'; |
|
341 | + $var = true; |
|
342 | + $i = 0; |
|
343 | 343 | |
344 | - $staticaction=new ActionComm($db); |
|
345 | - $customerstatic=new Societe($db); |
|
344 | + $staticaction=new ActionComm($db); |
|
345 | + $customerstatic=new Societe($db); |
|
346 | 346 | |
347 | - while ($i < $num) |
|
348 | - { |
|
349 | - $obj = $db->fetch_object($resql); |
|
347 | + while ($i < $num) |
|
348 | + { |
|
349 | + $obj = $db->fetch_object($resql); |
|
350 | 350 | |
351 | 351 | |
352 | - print '<tr class="oddeven">'; |
|
352 | + print '<tr class="oddeven">'; |
|
353 | 353 | |
354 | - $staticaction->type_code=$obj->code; |
|
355 | - $staticaction->libelle=$obj->label; |
|
356 | - $staticaction->id=$obj->id; |
|
357 | - print '<td>'.$staticaction->getNomUrl(1,34).'</td>'; |
|
354 | + $staticaction->type_code=$obj->code; |
|
355 | + $staticaction->libelle=$obj->label; |
|
356 | + $staticaction->id=$obj->id; |
|
357 | + print '<td>'.$staticaction->getNomUrl(1,34).'</td>'; |
|
358 | 358 | |
359 | 359 | //print '<td>'.dol_trunc($obj->label,24).'</td>'; |
360 | 360 | |
361 | - print '<td>'; |
|
362 | - if ($obj->rowid > 0) |
|
363 | - { |
|
361 | + print '<td>'; |
|
362 | + if ($obj->rowid > 0) |
|
363 | + { |
|
364 | 364 | $customerstatic->id=$obj->rowid; |
365 | 365 | $customerstatic->name=$obj->sname; |
366 | 366 | $customerstatic->client=$obj->client; |
367 | - print $customerstatic->getNomUrl(1,'',24); |
|
368 | - } |
|
369 | - print '</td>'; |
|
370 | - |
|
371 | - // Date |
|
372 | - print '<td width="100" align="right">'.dol_print_date($db->jdate($obj->da2),'day'); |
|
373 | - print "</td>"; |
|
374 | - |
|
375 | - // Statut |
|
376 | - print "<td align=\"right\" width=\"14\">".$staticaction->LibStatut($obj->percent,3)."</td>\n"; |
|
377 | - |
|
378 | - print "</tr>\n"; |
|
379 | - $i++; |
|
380 | - } |
|
381 | - // TODO Ajouter rappel pour "il y a des contrats a mettre en service" |
|
382 | - // TODO Ajouter rappel pour "il y a des contrats qui arrivent a expiration" |
|
383 | - print "</table><br>"; |
|
384 | - |
|
385 | - $db->free($resql); |
|
386 | - } |
|
387 | - else |
|
388 | - { |
|
389 | - dol_print_error($db); |
|
390 | - } |
|
367 | + print $customerstatic->getNomUrl(1,'',24); |
|
368 | + } |
|
369 | + print '</td>'; |
|
370 | + |
|
371 | + // Date |
|
372 | + print '<td width="100" align="right">'.dol_print_date($db->jdate($obj->da2),'day'); |
|
373 | + print "</td>"; |
|
374 | + |
|
375 | + // Statut |
|
376 | + print "<td align=\"right\" width=\"14\">".$staticaction->LibStatut($obj->percent,3)."</td>\n"; |
|
377 | + |
|
378 | + print "</tr>\n"; |
|
379 | + $i++; |
|
380 | + } |
|
381 | + // TODO Ajouter rappel pour "il y a des contrats a mettre en service" |
|
382 | + // TODO Ajouter rappel pour "il y a des contrats qui arrivent a expiration" |
|
383 | + print "</table><br>"; |
|
384 | + |
|
385 | + $db->free($resql); |
|
386 | + } |
|
387 | + else |
|
388 | + { |
|
389 | + dol_print_error($db); |
|
390 | + } |
|
391 | 391 | } |
392 | 392 | |
393 | 393 | |
@@ -398,49 +398,49 @@ discard block |
||
398 | 398 | */ |
399 | 399 | function agenda_prepare_head() |
400 | 400 | { |
401 | - global $langs, $conf, $user; |
|
402 | - $h = 0; |
|
403 | - $head = array(); |
|
401 | + global $langs, $conf, $user; |
|
402 | + $h = 0; |
|
403 | + $head = array(); |
|
404 | 404 | |
405 | - $head[$h][0] = DOL_URL_ROOT."/admin/agenda_other.php"; |
|
406 | - $head[$h][1] = $langs->trans("Miscellaneous"); |
|
407 | - $head[$h][2] = 'other'; |
|
408 | - $h++; |
|
405 | + $head[$h][0] = DOL_URL_ROOT."/admin/agenda_other.php"; |
|
406 | + $head[$h][1] = $langs->trans("Miscellaneous"); |
|
407 | + $head[$h][2] = 'other'; |
|
408 | + $h++; |
|
409 | 409 | |
410 | - $head[$h][0] = DOL_URL_ROOT."/admin/agenda.php"; |
|
411 | - $head[$h][1] = $langs->trans("AutoActions"); |
|
412 | - $head[$h][2] = 'autoactions'; |
|
413 | - $h++; |
|
410 | + $head[$h][0] = DOL_URL_ROOT."/admin/agenda.php"; |
|
411 | + $head[$h][1] = $langs->trans("AutoActions"); |
|
412 | + $head[$h][2] = 'autoactions'; |
|
413 | + $h++; |
|
414 | 414 | |
415 | - if ($conf->global->MAIN_FEATURES_LEVEL > 0) |
|
416 | - { |
|
417 | - $head[$h][0] = DOL_URL_ROOT."/admin/agenda_reminder.php"; |
|
418 | - $head[$h][1] = $langs->trans("Reminders"); |
|
419 | - $head[$h][2] = 'reminders'; |
|
420 | - $h++; |
|
421 | - } |
|
415 | + if ($conf->global->MAIN_FEATURES_LEVEL > 0) |
|
416 | + { |
|
417 | + $head[$h][0] = DOL_URL_ROOT."/admin/agenda_reminder.php"; |
|
418 | + $head[$h][1] = $langs->trans("Reminders"); |
|
419 | + $head[$h][2] = 'reminders'; |
|
420 | + $h++; |
|
421 | + } |
|
422 | 422 | |
423 | - $head[$h][0] = DOL_URL_ROOT."/admin/agenda_xcal.php"; |
|
424 | - $head[$h][1] = $langs->trans("ExportCal"); |
|
425 | - $head[$h][2] = 'xcal'; |
|
426 | - $h++; |
|
423 | + $head[$h][0] = DOL_URL_ROOT."/admin/agenda_xcal.php"; |
|
424 | + $head[$h][1] = $langs->trans("ExportCal"); |
|
425 | + $head[$h][2] = 'xcal'; |
|
426 | + $h++; |
|
427 | 427 | |
428 | - $head[$h][0] = DOL_URL_ROOT."/admin/agenda_extsites.php"; |
|
429 | - $head[$h][1] = $langs->trans("ExtSites"); |
|
430 | - $head[$h][2] = 'extsites'; |
|
431 | - $h++; |
|
428 | + $head[$h][0] = DOL_URL_ROOT."/admin/agenda_extsites.php"; |
|
429 | + $head[$h][1] = $langs->trans("ExtSites"); |
|
430 | + $head[$h][2] = 'extsites'; |
|
431 | + $h++; |
|
432 | 432 | |
433 | - complete_head_from_modules($conf,$langs,null,$head,$h,'agenda_admin'); |
|
433 | + complete_head_from_modules($conf,$langs,null,$head,$h,'agenda_admin'); |
|
434 | 434 | |
435 | - $head[$h][0] = DOL_URL_ROOT."/admin/agenda_extrafields.php"; |
|
436 | - $head[$h][1] = $langs->trans("ExtraFields"); |
|
437 | - $head[$h][2] = 'attributes'; |
|
438 | - $h++; |
|
435 | + $head[$h][0] = DOL_URL_ROOT."/admin/agenda_extrafields.php"; |
|
436 | + $head[$h][1] = $langs->trans("ExtraFields"); |
|
437 | + $head[$h][2] = 'attributes'; |
|
438 | + $h++; |
|
439 | 439 | |
440 | - complete_head_from_modules($conf,$langs,null,$head,$h,'agenda_admin','remove'); |
|
440 | + complete_head_from_modules($conf,$langs,null,$head,$h,'agenda_admin','remove'); |
|
441 | 441 | |
442 | 442 | |
443 | - return $head; |
|
443 | + return $head; |
|
444 | 444 | } |
445 | 445 | |
446 | 446 | /** |
@@ -451,30 +451,30 @@ discard block |
||
451 | 451 | */ |
452 | 452 | function actions_prepare_head($object) |
453 | 453 | { |
454 | - global $db, $langs, $conf, $user; |
|
454 | + global $db, $langs, $conf, $user; |
|
455 | 455 | |
456 | - $h = 0; |
|
457 | - $head = array(); |
|
456 | + $h = 0; |
|
457 | + $head = array(); |
|
458 | 458 | |
459 | - $head[$h][0] = DOL_URL_ROOT.'/comm/action/card.php?id='.$object->id; |
|
460 | - $head[$h][1] = $langs->trans("CardAction"); |
|
461 | - $head[$h][2] = 'card'; |
|
462 | - $h++; |
|
459 | + $head[$h][0] = DOL_URL_ROOT.'/comm/action/card.php?id='.$object->id; |
|
460 | + $head[$h][1] = $langs->trans("CardAction"); |
|
461 | + $head[$h][2] = 'card'; |
|
462 | + $h++; |
|
463 | 463 | |
464 | 464 | // Tab to link resources |
465 | - if ($conf->resource->enabled) |
|
466 | - { |
|
467 | - include_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php'; |
|
468 | - $resource=new DolResource($db); |
|
465 | + if ($conf->resource->enabled) |
|
466 | + { |
|
467 | + include_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php'; |
|
468 | + $resource=new DolResource($db); |
|
469 | 469 | |
470 | - $head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=action&element_id='.$object->id; |
|
470 | + $head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=action&element_id='.$object->id; |
|
471 | 471 | $listofresourcelinked = $resource->getElementResources($object->element, $object->id); |
472 | 472 | $nbResources=count($listofresourcelinked); |
473 | - $head[$h][1] = $langs->trans("Resources"); |
|
474 | - if ($nbResources > 0) $head[$h][1].= ' <span class="badge">'.($nbResources).'</span>'; |
|
475 | - $head[$h][2] = 'resources'; |
|
476 | - $h++; |
|
477 | - } |
|
473 | + $head[$h][1] = $langs->trans("Resources"); |
|
474 | + if ($nbResources > 0) $head[$h][1].= ' <span class="badge">'.($nbResources).'</span>'; |
|
475 | + $head[$h][2] = 'resources'; |
|
476 | + $h++; |
|
477 | + } |
|
478 | 478 | |
479 | 479 | // Attached files |
480 | 480 | require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
@@ -484,20 +484,20 @@ discard block |
||
484 | 484 | $nbLinks=Link::count($db, $object->element, $object->id); |
485 | 485 | $head[$h][0] = DOL_URL_ROOT.'/comm/action/document.php?id='.$object->id; |
486 | 486 | $head[$h][1] = $langs->trans("Documents"); |
487 | - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
487 | + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
488 | 488 | $head[$h][2] = 'documents'; |
489 | 489 | $h++; |
490 | 490 | |
491 | - $head[$h][0] = DOL_URL_ROOT.'/comm/action/info.php?id='.$object->id; |
|
492 | - $head[$h][1] = $langs->trans('Info'); |
|
493 | - $head[$h][2] = 'info'; |
|
494 | - $h++; |
|
491 | + $head[$h][0] = DOL_URL_ROOT.'/comm/action/info.php?id='.$object->id; |
|
492 | + $head[$h][1] = $langs->trans('Info'); |
|
493 | + $head[$h][2] = 'info'; |
|
494 | + $h++; |
|
495 | 495 | |
496 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'action'); |
|
496 | + complete_head_from_modules($conf,$langs,$object,$head,$h,'action'); |
|
497 | 497 | |
498 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'action','remove'); |
|
498 | + complete_head_from_modules($conf,$langs,$object,$head,$h,'action','remove'); |
|
499 | 499 | |
500 | - return $head; |
|
500 | + return $head; |
|
501 | 501 | } |
502 | 502 | |
503 | 503 | |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | $h++; |
550 | 550 | |
551 | 551 | |
552 | - $object=new stdClass(); |
|
552 | + $object=new stdClass(); |
|
553 | 553 | |
554 | 554 | // Show more tabs from modules |
555 | 555 | // Entries must be declared in modules descriptor with line |
@@ -47,24 +47,24 @@ discard block |
||
47 | 47 | * @param int $resourceid Preselected value of resource for filter on resource |
48 | 48 | * @return void |
49 | 49 | */ |
50 | -function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $action, $showextcals=array(), $actioncode='', $usergroupid='', $excludetype='', $resourceid=0) |
|
50 | +function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $action, $showextcals = array(), $actioncode = '', $usergroupid = '', $excludetype = '', $resourceid = 0) |
|
51 | 51 | { |
52 | 52 | global $conf, $user, $langs, $db, $hookmanager; |
53 | 53 | global $begin_h, $end_h, $begin_d, $end_d; |
54 | 54 | |
55 | 55 | $langs->load("companies"); |
56 | 56 | |
57 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; |
|
58 | - $formactions=new FormActions($db); |
|
57 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; |
|
58 | + $formactions = new FormActions($db); |
|
59 | 59 | |
60 | 60 | // Filters |
61 | 61 | //print '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="get">'; |
62 | - print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">'; |
|
63 | - print '<input type="hidden" name="year" value="' . $year . '">'; |
|
64 | - print '<input type="hidden" name="month" value="' . $month . '">'; |
|
65 | - print '<input type="hidden" name="day" value="' . $day . '">'; |
|
66 | - print '<input type="hidden" name="action" value="' . $action . '">'; |
|
67 | - print '<input type="hidden" name="search_showbirthday" value="' . $showbirthday . '">'; |
|
62 | + print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">'; |
|
63 | + print '<input type="hidden" name="year" value="'.$year.'">'; |
|
64 | + print '<input type="hidden" name="month" value="'.$month.'">'; |
|
65 | + print '<input type="hidden" name="day" value="'.$day.'">'; |
|
66 | + print '<input type="hidden" name="action" value="'.$action.'">'; |
|
67 | + print '<input type="hidden" name="search_showbirthday" value="'.$showbirthday.'">'; |
|
68 | 68 | |
69 | 69 | print '<div class="fichecenter">'; |
70 | 70 | |
@@ -79,15 +79,15 @@ discard block |
||
79 | 79 | print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">'; |
80 | 80 | print $langs->trans("ActionsToDoBy").' '; |
81 | 81 | print '</td><td style="padding-bottom: 2px; padding-right: 4px;">'; |
82 | - print $form->select_dolusers($filtert, 'search_filtert', 1, '', ! $canedit, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); |
|
83 | - if (empty($conf->dol_optimize_smallscreen)) print ' '.$langs->trans("or") . ' '.$langs->trans("ToUserOfGroup").' '; |
|
84 | - print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', ! $canedit); |
|
82 | + print $form->select_dolusers($filtert, 'search_filtert', 1, '', !$canedit, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); |
|
83 | + if (empty($conf->dol_optimize_smallscreen)) print ' '.$langs->trans("or").' '.$langs->trans("ToUserOfGroup").' '; |
|
84 | + print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', !$canedit); |
|
85 | 85 | print '</td></tr>'; |
86 | 86 | |
87 | 87 | if ($conf->resource->enabled) |
88 | 88 | { |
89 | - include_once DOL_DOCUMENT_ROOT . '/resource/class/html.formresource.class.php'; |
|
90 | - $formresource=new FormResource($db); |
|
89 | + include_once DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php'; |
|
90 | + $formresource = new FormResource($db); |
|
91 | 91 | |
92 | 92 | // Resource |
93 | 93 | print '<tr>'; |
@@ -103,16 +103,16 @@ discard block |
||
103 | 103 | print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">'; |
104 | 104 | print $langs->trans("Type"); |
105 | 105 | print ' </td><td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">'; |
106 | - $multiselect=0; |
|
107 | - if (! empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) // We use an option here because it adds bugs when used on agenda page "peruser" and "list" |
|
106 | + $multiselect = 0; |
|
107 | + if (!empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) // We use an option here because it adds bugs when used on agenda page "peruser" and "list" |
|
108 | 108 | { |
109 | - $multiselect=(!empty($conf->global->AGENDA_USE_EVENT_TYPE)); |
|
109 | + $multiselect = (!empty($conf->global->AGENDA_USE_EVENT_TYPE)); |
|
110 | 110 | } |
111 | - print $formactions->select_type_actions($actioncode, "search_actioncode", $excludetype, (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:-1), 0, $multiselect); |
|
111 | + print $formactions->select_type_actions($actioncode, "search_actioncode", $excludetype, (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 0, $multiselect); |
|
112 | 112 | print '</td></tr>'; |
113 | 113 | } |
114 | 114 | |
115 | - if (! empty($conf->societe->enabled) && $user->rights->societe->lire) |
|
115 | + if (!empty($conf->societe->enabled) && $user->rights->societe->lire) |
|
116 | 116 | { |
117 | 117 | print '<tr>'; |
118 | 118 | print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">'; |
@@ -122,20 +122,20 @@ discard block |
||
122 | 122 | print '</td></tr>'; |
123 | 123 | } |
124 | 124 | |
125 | - if (! empty($conf->projet->enabled) && $user->rights->projet->lire) |
|
125 | + if (!empty($conf->projet->enabled) && $user->rights->projet->lire) |
|
126 | 126 | { |
127 | 127 | require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
128 | - $formproject=new FormProjets($db); |
|
128 | + $formproject = new FormProjets($db); |
|
129 | 129 | |
130 | 130 | print '<tr>'; |
131 | 131 | print '<td class="nowrap" style="padding-bottom: 2px;">'; |
132 | 132 | print $langs->trans("Project").' '; |
133 | 133 | print '</td><td class="nowrap" style="padding-bottom: 2px;">'; |
134 | - print $formproject->select_projects($socid?$socid:-1, $pid, 'search_projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, 'maxwidth500'); |
|
134 | + print $formproject->select_projects($socid ? $socid : -1, $pid, 'search_projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, 'maxwidth500'); |
|
135 | 135 | print '</td></tr>'; |
136 | 136 | } |
137 | 137 | |
138 | - if ($canedit && ! preg_match('/list/', $_SERVER["PHP_SELF"])) |
|
138 | + if ($canedit && !preg_match('/list/', $_SERVER["PHP_SELF"])) |
|
139 | 139 | { |
140 | 140 | // Status |
141 | 141 | print '<tr>'; |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | |
189 | 189 | print '<table class="centpercent"><tr><td align="center">'; |
190 | 190 | print '<div class="formleftzone">'; |
191 | - print '<input type="submit" class="button" style="min-width:120px" name="refresh" value="' . $langs->trans("Refresh") . '">'; |
|
191 | + print '<input type="submit" class="button" style="min-width:120px" name="refresh" value="'.$langs->trans("Refresh").'">'; |
|
192 | 192 | print '</div>'; |
193 | 193 | print '</td></tr>'; |
194 | 194 | print '</table>'; |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | if ($conf->browser->layout == 'phone') print '</div>'; |
197 | 197 | else print '</td></tr></table>'; |
198 | 198 | |
199 | - print '</div>'; // Close fichecenter |
|
199 | + print '</div>'; // Close fichecenter |
|
200 | 200 | print '<div style="clear:both"></div>'; |
201 | 201 | |
202 | 202 | //print '</form>'; |
@@ -209,44 +209,44 @@ discard block |
||
209 | 209 | * @param int $max Max nb of records |
210 | 210 | * @return void |
211 | 211 | */ |
212 | -function show_array_actions_to_do($max=5) |
|
212 | +function show_array_actions_to_do($max = 5) |
|
213 | 213 | { |
214 | 214 | global $langs, $conf, $user, $db, $bc, $socid; |
215 | 215 | |
216 | - $now=dol_now(); |
|
216 | + $now = dol_now(); |
|
217 | 217 | |
218 | 218 | include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; |
219 | 219 | include_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; |
220 | 220 | |
221 | 221 | $sql = "SELECT a.id, a.label, a.datep as dp, a.datep2 as dp2, a.fk_user_author, a.percent,"; |
222 | - $sql.= " c.code, c.libelle as type_label,"; |
|
223 | - $sql.= " s.nom as sname, s.rowid, s.client"; |
|
224 | - $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a LEFT JOIN "; |
|
225 | - $sql.= " ".MAIN_DB_PREFIX."c_actioncomm as c ON c.id = a.fk_action"; |
|
226 | - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; |
|
227 | - if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; |
|
228 | - $sql.= " WHERE a.entity = ".$conf->entity; |
|
229 | - $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; |
|
230 | - if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; |
|
231 | - if ($socid) $sql.= " AND s.rowid = ".$socid; |
|
232 | - $sql.= " ORDER BY a.datep DESC, a.id DESC"; |
|
233 | - $sql.= $db->plimit($max, 0); |
|
234 | - |
|
235 | - $resql=$db->query($sql); |
|
222 | + $sql .= " c.code, c.libelle as type_label,"; |
|
223 | + $sql .= " s.nom as sname, s.rowid, s.client"; |
|
224 | + $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a LEFT JOIN "; |
|
225 | + $sql .= " ".MAIN_DB_PREFIX."c_actioncomm as c ON c.id = a.fk_action"; |
|
226 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; |
|
227 | + if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; |
|
228 | + $sql .= " WHERE a.entity = ".$conf->entity; |
|
229 | + $sql .= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; |
|
230 | + if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; |
|
231 | + if ($socid) $sql .= " AND s.rowid = ".$socid; |
|
232 | + $sql .= " ORDER BY a.datep DESC, a.id DESC"; |
|
233 | + $sql .= $db->plimit($max, 0); |
|
234 | + |
|
235 | + $resql = $db->query($sql); |
|
236 | 236 | if ($resql) |
237 | 237 | { |
238 | 238 | $num = $db->num_rows($resql); |
239 | 239 | |
240 | 240 | print '<table class="noborder" width="100%">'; |
241 | - print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("LastActionsToDo",$max).'</th>'; |
|
241 | + print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("LastActionsToDo", $max).'</th>'; |
|
242 | 242 | print '<th colspan="2" align="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/comm/action/list.php?status=todo">'.$langs->trans("FullList").'</a></th>'; |
243 | 243 | print '</tr>'; |
244 | 244 | |
245 | 245 | $var = true; |
246 | 246 | $i = 0; |
247 | 247 | |
248 | - $staticaction=new ActionComm($db); |
|
249 | - $customerstatic=new Client($db); |
|
248 | + $staticaction = new ActionComm($db); |
|
249 | + $customerstatic = new Client($db); |
|
250 | 250 | |
251 | 251 | while ($i < $num) |
252 | 252 | { |
@@ -255,38 +255,38 @@ discard block |
||
255 | 255 | |
256 | 256 | print '<tr class="oddeven">'; |
257 | 257 | |
258 | - $staticaction->type_code=$obj->code; |
|
259 | - $staticaction->label=($obj->label?$obj->label:$obj->type_label); |
|
260 | - $staticaction->id=$obj->id; |
|
261 | - print '<td>'.$staticaction->getNomUrl(1,34).'</td>'; |
|
258 | + $staticaction->type_code = $obj->code; |
|
259 | + $staticaction->label = ($obj->label ? $obj->label : $obj->type_label); |
|
260 | + $staticaction->id = $obj->id; |
|
261 | + print '<td>'.$staticaction->getNomUrl(1, 34).'</td>'; |
|
262 | 262 | |
263 | 263 | // print '<td>'.dol_trunc($obj->label,22).'</td>'; |
264 | 264 | |
265 | 265 | print '<td>'; |
266 | 266 | if ($obj->rowid > 0) |
267 | 267 | { |
268 | - $customerstatic->id=$obj->rowid; |
|
269 | - $customerstatic->name=$obj->sname; |
|
270 | - $customerstatic->client=$obj->client; |
|
271 | - print $customerstatic->getNomUrl(1,'',16); |
|
268 | + $customerstatic->id = $obj->rowid; |
|
269 | + $customerstatic->name = $obj->sname; |
|
270 | + $customerstatic->client = $obj->client; |
|
271 | + print $customerstatic->getNomUrl(1, '', 16); |
|
272 | 272 | } |
273 | 273 | print '</td>'; |
274 | 274 | |
275 | - $datep=$db->jdate($obj->dp); |
|
276 | - $datep2=$db->jdate($obj->dp2); |
|
275 | + $datep = $db->jdate($obj->dp); |
|
276 | + $datep2 = $db->jdate($obj->dp2); |
|
277 | 277 | |
278 | 278 | // Date |
279 | - print '<td width="100" align="right">'.dol_print_date($datep,'day').' '; |
|
280 | - $late=0; |
|
281 | - if ($obj->percent == 0 && $datep && $datep < time()) $late=1; |
|
282 | - if ($obj->percent == 0 && ! $datep && $datep2 && $datep2 < time()) $late=1; |
|
283 | - if ($obj->percent > 0 && $obj->percent < 100 && $datep2 && $datep2 < time()) $late=1; |
|
284 | - if ($obj->percent > 0 && $obj->percent < 100 && ! $datep2 && $datep && $datep < time()) $late=1; |
|
279 | + print '<td width="100" align="right">'.dol_print_date($datep, 'day').' '; |
|
280 | + $late = 0; |
|
281 | + if ($obj->percent == 0 && $datep && $datep < time()) $late = 1; |
|
282 | + if ($obj->percent == 0 && !$datep && $datep2 && $datep2 < time()) $late = 1; |
|
283 | + if ($obj->percent > 0 && $obj->percent < 100 && $datep2 && $datep2 < time()) $late = 1; |
|
284 | + if ($obj->percent > 0 && $obj->percent < 100 && !$datep2 && $datep && $datep < time()) $late = 1; |
|
285 | 285 | if ($late) print img_warning($langs->trans("Late")); |
286 | 286 | print "</td>"; |
287 | 287 | |
288 | 288 | // Statut |
289 | - print "<td align=\"right\" width=\"14\">".$staticaction->LibStatut($obj->percent,3)."</td>\n"; |
|
289 | + print "<td align=\"right\" width=\"14\">".$staticaction->LibStatut($obj->percent, 3)."</td>\n"; |
|
290 | 290 | |
291 | 291 | print "</tr>\n"; |
292 | 292 | |
@@ -309,40 +309,40 @@ discard block |
||
309 | 309 | * @param int $max Max nb of records |
310 | 310 | * @return void |
311 | 311 | */ |
312 | -function show_array_last_actions_done($max=5) |
|
312 | +function show_array_last_actions_done($max = 5) |
|
313 | 313 | { |
314 | 314 | global $langs, $conf, $user, $db, $bc, $socid; |
315 | 315 | |
316 | - $now=dol_now(); |
|
316 | + $now = dol_now(); |
|
317 | 317 | |
318 | 318 | $sql = "SELECT a.id, a.percent, a.datep as da, a.datep2 as da2, a.fk_user_author, a.label,"; |
319 | - $sql.= " c.code, c.libelle,"; |
|
320 | - $sql.= " s.rowid, s.nom as sname, s.client"; |
|
321 | - $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a LEFT JOIN "; |
|
322 | - $sql.= " ".MAIN_DB_PREFIX."c_actioncomm as c ON c.id = a.fk_action "; |
|
323 | - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; |
|
324 | - if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; |
|
325 | - $sql.= " WHERE a.entity = ".$conf->entity; |
|
326 | - $sql.= " AND (a.percent >= 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; |
|
327 | - if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; |
|
328 | - if ($socid) $sql.= " AND s.rowid = ".$socid; |
|
319 | + $sql .= " c.code, c.libelle,"; |
|
320 | + $sql .= " s.rowid, s.nom as sname, s.client"; |
|
321 | + $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a LEFT JOIN "; |
|
322 | + $sql .= " ".MAIN_DB_PREFIX."c_actioncomm as c ON c.id = a.fk_action "; |
|
323 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; |
|
324 | + if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; |
|
325 | + $sql .= " WHERE a.entity = ".$conf->entity; |
|
326 | + $sql .= " AND (a.percent >= 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; |
|
327 | + if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; |
|
328 | + if ($socid) $sql .= " AND s.rowid = ".$socid; |
|
329 | 329 | $sql .= " ORDER BY a.datep2 DESC"; |
330 | 330 | $sql .= $db->plimit($max, 0); |
331 | 331 | |
332 | - $resql=$db->query($sql); |
|
332 | + $resql = $db->query($sql); |
|
333 | 333 | if ($resql) |
334 | 334 | { |
335 | 335 | $num = $db->num_rows($resql); |
336 | 336 | |
337 | 337 | print '<table class="noborder" width="100%">'; |
338 | - print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("LastDoneTasks",$max).'</th>'; |
|
338 | + print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("LastDoneTasks", $max).'</th>'; |
|
339 | 339 | print '<th colspan="2" align="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/comm/action/list.php?status=done">'.$langs->trans("FullList").'</a></th>'; |
340 | 340 | print '</tr>'; |
341 | 341 | $var = true; |
342 | 342 | $i = 0; |
343 | 343 | |
344 | - $staticaction=new ActionComm($db); |
|
345 | - $customerstatic=new Societe($db); |
|
344 | + $staticaction = new ActionComm($db); |
|
345 | + $customerstatic = new Societe($db); |
|
346 | 346 | |
347 | 347 | while ($i < $num) |
348 | 348 | { |
@@ -351,29 +351,29 @@ discard block |
||
351 | 351 | |
352 | 352 | print '<tr class="oddeven">'; |
353 | 353 | |
354 | - $staticaction->type_code=$obj->code; |
|
355 | - $staticaction->libelle=$obj->label; |
|
356 | - $staticaction->id=$obj->id; |
|
357 | - print '<td>'.$staticaction->getNomUrl(1,34).'</td>'; |
|
354 | + $staticaction->type_code = $obj->code; |
|
355 | + $staticaction->libelle = $obj->label; |
|
356 | + $staticaction->id = $obj->id; |
|
357 | + print '<td>'.$staticaction->getNomUrl(1, 34).'</td>'; |
|
358 | 358 | |
359 | 359 | //print '<td>'.dol_trunc($obj->label,24).'</td>'; |
360 | 360 | |
361 | 361 | print '<td>'; |
362 | 362 | if ($obj->rowid > 0) |
363 | 363 | { |
364 | - $customerstatic->id=$obj->rowid; |
|
365 | - $customerstatic->name=$obj->sname; |
|
366 | - $customerstatic->client=$obj->client; |
|
367 | - print $customerstatic->getNomUrl(1,'',24); |
|
364 | + $customerstatic->id = $obj->rowid; |
|
365 | + $customerstatic->name = $obj->sname; |
|
366 | + $customerstatic->client = $obj->client; |
|
367 | + print $customerstatic->getNomUrl(1, '', 24); |
|
368 | 368 | } |
369 | 369 | print '</td>'; |
370 | 370 | |
371 | 371 | // Date |
372 | - print '<td width="100" align="right">'.dol_print_date($db->jdate($obj->da2),'day'); |
|
372 | + print '<td width="100" align="right">'.dol_print_date($db->jdate($obj->da2), 'day'); |
|
373 | 373 | print "</td>"; |
374 | 374 | |
375 | 375 | // Statut |
376 | - print "<td align=\"right\" width=\"14\">".$staticaction->LibStatut($obj->percent,3)."</td>\n"; |
|
376 | + print "<td align=\"right\" width=\"14\">".$staticaction->LibStatut($obj->percent, 3)."</td>\n"; |
|
377 | 377 | |
378 | 378 | print "</tr>\n"; |
379 | 379 | $i++; |
@@ -430,14 +430,14 @@ discard block |
||
430 | 430 | $head[$h][2] = 'extsites'; |
431 | 431 | $h++; |
432 | 432 | |
433 | - complete_head_from_modules($conf,$langs,null,$head,$h,'agenda_admin'); |
|
433 | + complete_head_from_modules($conf, $langs, null, $head, $h, 'agenda_admin'); |
|
434 | 434 | |
435 | 435 | $head[$h][0] = DOL_URL_ROOT."/admin/agenda_extrafields.php"; |
436 | 436 | $head[$h][1] = $langs->trans("ExtraFields"); |
437 | 437 | $head[$h][2] = 'attributes'; |
438 | 438 | $h++; |
439 | 439 | |
440 | - complete_head_from_modules($conf,$langs,null,$head,$h,'agenda_admin','remove'); |
|
440 | + complete_head_from_modules($conf, $langs, null, $head, $h, 'agenda_admin', 'remove'); |
|
441 | 441 | |
442 | 442 | |
443 | 443 | return $head; |
@@ -465,13 +465,13 @@ discard block |
||
465 | 465 | if ($conf->resource->enabled) |
466 | 466 | { |
467 | 467 | include_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php'; |
468 | - $resource=new DolResource($db); |
|
468 | + $resource = new DolResource($db); |
|
469 | 469 | |
470 | 470 | $head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=action&element_id='.$object->id; |
471 | 471 | $listofresourcelinked = $resource->getElementResources($object->element, $object->id); |
472 | - $nbResources=count($listofresourcelinked); |
|
472 | + $nbResources = count($listofresourcelinked); |
|
473 | 473 | $head[$h][1] = $langs->trans("Resources"); |
474 | - if ($nbResources > 0) $head[$h][1].= ' <span class="badge">'.($nbResources).'</span>'; |
|
474 | + if ($nbResources > 0) $head[$h][1] .= ' <span class="badge">'.($nbResources).'</span>'; |
|
475 | 475 | $head[$h][2] = 'resources'; |
476 | 476 | $h++; |
477 | 477 | } |
@@ -479,12 +479,12 @@ discard block |
||
479 | 479 | // Attached files |
480 | 480 | require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
481 | 481 | require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; |
482 | - $upload_dir = $conf->agenda->dir_output . "/" . $object->id; |
|
483 | - $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$')); |
|
484 | - $nbLinks=Link::count($db, $object->element, $object->id); |
|
482 | + $upload_dir = $conf->agenda->dir_output."/".$object->id; |
|
483 | + $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); |
|
484 | + $nbLinks = Link::count($db, $object->element, $object->id); |
|
485 | 485 | $head[$h][0] = DOL_URL_ROOT.'/comm/action/document.php?id='.$object->id; |
486 | 486 | $head[$h][1] = $langs->trans("Documents"); |
487 | - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
487 | + if (($nbFiles + $nbLinks) > 0) $head[$h][1] .= ' <span class="badge">'.($nbFiles + $nbLinks).'</span>'; |
|
488 | 488 | $head[$h][2] = 'documents'; |
489 | 489 | $h++; |
490 | 490 | |
@@ -493,9 +493,9 @@ discard block |
||
493 | 493 | $head[$h][2] = 'info'; |
494 | 494 | $h++; |
495 | 495 | |
496 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'action'); |
|
496 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'action'); |
|
497 | 497 | |
498 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'action','remove'); |
|
498 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'action', 'remove'); |
|
499 | 499 | |
500 | 500 | return $head; |
501 | 501 | } |
@@ -514,50 +514,50 @@ discard block |
||
514 | 514 | $h = 0; |
515 | 515 | $head = array(); |
516 | 516 | |
517 | - $head[$h][0] = DOL_URL_ROOT.'/comm/action/list.php'.($param?'?'.$param:''); |
|
517 | + $head[$h][0] = DOL_URL_ROOT.'/comm/action/list.php'.($param ? '?'.$param : ''); |
|
518 | 518 | $head[$h][1] = $langs->trans("ViewList"); |
519 | 519 | $head[$h][2] = 'cardlist'; |
520 | 520 | $h++; |
521 | 521 | |
522 | - $head[$h][0] = DOL_URL_ROOT.'/comm/action/index.php?action=show_month'.($param?'&'.$param:''); |
|
522 | + $head[$h][0] = DOL_URL_ROOT.'/comm/action/index.php?action=show_month'.($param ? '&'.$param : ''); |
|
523 | 523 | $head[$h][1] = $langs->trans("ViewCal"); |
524 | 524 | $head[$h][2] = 'cardmonth'; |
525 | 525 | $h++; |
526 | 526 | |
527 | - $head[$h][0] = DOL_URL_ROOT.'/comm/action/index.php?action=show_week'.($param?'&'.$param:''); |
|
527 | + $head[$h][0] = DOL_URL_ROOT.'/comm/action/index.php?action=show_week'.($param ? '&'.$param : ''); |
|
528 | 528 | $head[$h][1] = $langs->trans("ViewWeek"); |
529 | 529 | $head[$h][2] = 'cardweek'; |
530 | 530 | $h++; |
531 | 531 | |
532 | - $head[$h][0] = DOL_URL_ROOT.'/comm/action/index.php?action=show_day'.($param?'&'.$param:''); |
|
532 | + $head[$h][0] = DOL_URL_ROOT.'/comm/action/index.php?action=show_day'.($param ? '&'.$param : ''); |
|
533 | 533 | $head[$h][1] = $langs->trans("ViewDay"); |
534 | 534 | $head[$h][2] = 'cardday'; |
535 | 535 | $h++; |
536 | 536 | |
537 | 537 | //if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) |
538 | - if (! empty($conf->global->AGENDA_SHOW_PERTYPE)) |
|
538 | + if (!empty($conf->global->AGENDA_SHOW_PERTYPE)) |
|
539 | 539 | { |
540 | - $head[$h][0] = DOL_URL_ROOT.'/comm/action/pertype.php'.($param?'?'.$param:''); |
|
540 | + $head[$h][0] = DOL_URL_ROOT.'/comm/action/pertype.php'.($param ? '?'.$param : ''); |
|
541 | 541 | $head[$h][1] = $langs->trans("ViewPerType"); |
542 | 542 | $head[$h][2] = 'cardpertype'; |
543 | 543 | $h++; |
544 | 544 | } |
545 | 545 | |
546 | - $head[$h][0] = DOL_URL_ROOT.'/comm/action/peruser.php'.($param?'?'.$param:''); |
|
546 | + $head[$h][0] = DOL_URL_ROOT.'/comm/action/peruser.php'.($param ? '?'.$param : ''); |
|
547 | 547 | $head[$h][1] = $langs->trans("ViewPerUser"); |
548 | 548 | $head[$h][2] = 'cardperuser'; |
549 | 549 | $h++; |
550 | 550 | |
551 | 551 | |
552 | - $object=new stdClass(); |
|
552 | + $object = new stdClass(); |
|
553 | 553 | |
554 | 554 | // Show more tabs from modules |
555 | 555 | // Entries must be declared in modules descriptor with line |
556 | 556 | // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
557 | 557 | // $this->tabs = array('entity:-tabname); to remove a tab |
558 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'agenda'); |
|
558 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'agenda'); |
|
559 | 559 | |
560 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'agenda','remove'); |
|
560 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'agenda', 'remove'); |
|
561 | 561 | |
562 | 562 | return $head; |
563 | 563 | } |
@@ -68,8 +68,11 @@ discard block |
||
68 | 68 | |
69 | 69 | print '<div class="fichecenter">'; |
70 | 70 | |
71 | - if ($conf->browser->layout == 'phone') print '<div class="fichehalfleft">'; |
|
72 | - else print '<table class="nobordernopadding" width="100%"><tr><td class="borderright">'; |
|
71 | + if ($conf->browser->layout == 'phone') { |
|
72 | + print '<div class="fichehalfleft">'; |
|
73 | + } else { |
|
74 | + print '<table class="nobordernopadding" width="100%"><tr><td class="borderright">'; |
|
75 | + } |
|
73 | 76 | |
74 | 77 | print '<table class="nobordernopadding centpercent">'; |
75 | 78 | |
@@ -80,7 +83,9 @@ discard block |
||
80 | 83 | print $langs->trans("ActionsToDoBy").' '; |
81 | 84 | print '</td><td style="padding-bottom: 2px; padding-right: 4px;">'; |
82 | 85 | print $form->select_dolusers($filtert, 'search_filtert', 1, '', ! $canedit, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); |
83 | - if (empty($conf->dol_optimize_smallscreen)) print ' '.$langs->trans("or") . ' '.$langs->trans("ToUserOfGroup").' '; |
|
86 | + if (empty($conf->dol_optimize_smallscreen)) { |
|
87 | + print ' '.$langs->trans("or") . ' '.$langs->trans("ToUserOfGroup").' '; |
|
88 | + } |
|
84 | 89 | print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', ! $canedit); |
85 | 90 | print '</td></tr>'; |
86 | 91 | |
@@ -104,10 +109,12 @@ discard block |
||
104 | 109 | print $langs->trans("Type"); |
105 | 110 | print ' </td><td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">'; |
106 | 111 | $multiselect=0; |
107 | - if (! empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) // We use an option here because it adds bugs when used on agenda page "peruser" and "list" |
|
112 | + if (! empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) { |
|
113 | + // We use an option here because it adds bugs when used on agenda page "peruser" and "list" |
|
108 | 114 | { |
109 | 115 | $multiselect=(!empty($conf->global->AGENDA_USE_EVENT_TYPE)); |
110 | 116 | } |
117 | + } |
|
111 | 118 | print $formactions->select_type_actions($actioncode, "search_actioncode", $excludetype, (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:-1), 0, $multiselect); |
112 | 119 | print '</td></tr>'; |
113 | 120 | } |
@@ -154,10 +161,15 @@ discard block |
||
154 | 161 | print "<td class='nowrap'>"; |
155 | 162 | print '<div class="ui-grid-a"><div class="ui-block-a">'; |
156 | 163 | print '<input type="number" class="short" name="begin_h" value="'.$begin_h.'" min="0" max="23">'; |
157 | - if (empty($conf->dol_use_jmobile)) print ' - '; |
|
158 | - else print '</div><div class="ui-block-b">'; |
|
164 | + if (empty($conf->dol_use_jmobile)) { |
|
165 | + print ' - '; |
|
166 | + } else { |
|
167 | + print '</div><div class="ui-block-b">'; |
|
168 | + } |
|
159 | 169 | print '<input type="number" class="short" name="end_h" value="'.$end_h.'" min="1" max="24">'; |
160 | - if (empty($conf->dol_use_jmobile)) print ' '.$langs->trans("H"); |
|
170 | + if (empty($conf->dol_use_jmobile)) { |
|
171 | + print ' '.$langs->trans("H"); |
|
172 | + } |
|
161 | 173 | print '</div></div>'; |
162 | 174 | print '</td></tr>'; |
163 | 175 | |
@@ -167,8 +179,11 @@ discard block |
||
167 | 179 | print "<td class='nowrap'>"; |
168 | 180 | print '<div class="ui-grid-a"><div class="ui-block-a">'; |
169 | 181 | print '<input type="number" class="short" name="begin_d" value="'.$begin_d.'" min="1" max="7">'; |
170 | - if (empty($conf->dol_use_jmobile)) print ' - '; |
|
171 | - else print '</div><div class="ui-block-b">'; |
|
182 | + if (empty($conf->dol_use_jmobile)) { |
|
183 | + print ' - '; |
|
184 | + } else { |
|
185 | + print '</div><div class="ui-block-b">'; |
|
186 | + } |
|
172 | 187 | print '<input type="number" class="short" name="end_d" value="'.$end_d.'" min="1" max="7">'; |
173 | 188 | print '</div></div>'; |
174 | 189 | print '</td></tr>'; |
@@ -180,11 +195,17 @@ discard block |
||
180 | 195 | |
181 | 196 | print '</table>'; |
182 | 197 | |
183 | - if ($conf->browser->layout == 'phone') print '</div>'; |
|
184 | - else print '</td>'; |
|
198 | + if ($conf->browser->layout == 'phone') { |
|
199 | + print '</div>'; |
|
200 | + } else { |
|
201 | + print '</td>'; |
|
202 | + } |
|
185 | 203 | |
186 | - if ($conf->browser->layout == 'phone') print '<div class="fichehalfright">'; |
|
187 | - else print '<td align="center" valign="middle" class="nowrap">'; |
|
204 | + if ($conf->browser->layout == 'phone') { |
|
205 | + print '<div class="fichehalfright">'; |
|
206 | + } else { |
|
207 | + print '<td align="center" valign="middle" class="nowrap">'; |
|
208 | + } |
|
188 | 209 | |
189 | 210 | print '<table class="centpercent"><tr><td align="center">'; |
190 | 211 | print '<div class="formleftzone">'; |
@@ -193,8 +214,11 @@ discard block |
||
193 | 214 | print '</td></tr>'; |
194 | 215 | print '</table>'; |
195 | 216 | |
196 | - if ($conf->browser->layout == 'phone') print '</div>'; |
|
197 | - else print '</td></tr></table>'; |
|
217 | + if ($conf->browser->layout == 'phone') { |
|
218 | + print '</div>'; |
|
219 | + } else { |
|
220 | + print '</td></tr></table>'; |
|
221 | + } |
|
198 | 222 | |
199 | 223 | print '</div>'; // Close fichecenter |
200 | 224 | print '<div style="clear:both"></div>'; |
@@ -224,11 +248,17 @@ discard block |
||
224 | 248 | $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a LEFT JOIN "; |
225 | 249 | $sql.= " ".MAIN_DB_PREFIX."c_actioncomm as c ON c.id = a.fk_action"; |
226 | 250 | $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; |
227 | - if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; |
|
251 | + if (!$user->rights->societe->client->voir && !$socid) { |
|
252 | + $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; |
|
253 | + } |
|
228 | 254 | $sql.= " WHERE a.entity = ".$conf->entity; |
229 | 255 | $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; |
230 | - if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; |
|
231 | - if ($socid) $sql.= " AND s.rowid = ".$socid; |
|
256 | + if (!$user->rights->societe->client->voir && !$socid) { |
|
257 | + $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; |
|
258 | + } |
|
259 | + if ($socid) { |
|
260 | + $sql.= " AND s.rowid = ".$socid; |
|
261 | + } |
|
232 | 262 | $sql.= " ORDER BY a.datep DESC, a.id DESC"; |
233 | 263 | $sql.= $db->plimit($max, 0); |
234 | 264 | |
@@ -278,11 +308,21 @@ discard block |
||
278 | 308 | // Date |
279 | 309 | print '<td width="100" align="right">'.dol_print_date($datep,'day').' '; |
280 | 310 | $late=0; |
281 | - if ($obj->percent == 0 && $datep && $datep < time()) $late=1; |
|
282 | - if ($obj->percent == 0 && ! $datep && $datep2 && $datep2 < time()) $late=1; |
|
283 | - if ($obj->percent > 0 && $obj->percent < 100 && $datep2 && $datep2 < time()) $late=1; |
|
284 | - if ($obj->percent > 0 && $obj->percent < 100 && ! $datep2 && $datep && $datep < time()) $late=1; |
|
285 | - if ($late) print img_warning($langs->trans("Late")); |
|
311 | + if ($obj->percent == 0 && $datep && $datep < time()) { |
|
312 | + $late=1; |
|
313 | + } |
|
314 | + if ($obj->percent == 0 && ! $datep && $datep2 && $datep2 < time()) { |
|
315 | + $late=1; |
|
316 | + } |
|
317 | + if ($obj->percent > 0 && $obj->percent < 100 && $datep2 && $datep2 < time()) { |
|
318 | + $late=1; |
|
319 | + } |
|
320 | + if ($obj->percent > 0 && $obj->percent < 100 && ! $datep2 && $datep && $datep < time()) { |
|
321 | + $late=1; |
|
322 | + } |
|
323 | + if ($late) { |
|
324 | + print img_warning($langs->trans("Late")); |
|
325 | + } |
|
286 | 326 | print "</td>"; |
287 | 327 | |
288 | 328 | // Statut |
@@ -295,8 +335,7 @@ discard block |
||
295 | 335 | print "</table><br>"; |
296 | 336 | |
297 | 337 | $db->free($resql); |
298 | - } |
|
299 | - else |
|
338 | + } else |
|
300 | 339 | { |
301 | 340 | dol_print_error($db); |
302 | 341 | } |
@@ -321,11 +360,17 @@ discard block |
||
321 | 360 | $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a LEFT JOIN "; |
322 | 361 | $sql.= " ".MAIN_DB_PREFIX."c_actioncomm as c ON c.id = a.fk_action "; |
323 | 362 | $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; |
324 | - if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; |
|
363 | + if (!$user->rights->societe->client->voir && !$socid) { |
|
364 | + $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; |
|
365 | + } |
|
325 | 366 | $sql.= " WHERE a.entity = ".$conf->entity; |
326 | 367 | $sql.= " AND (a.percent >= 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; |
327 | - if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; |
|
328 | - if ($socid) $sql.= " AND s.rowid = ".$socid; |
|
368 | + if (!$user->rights->societe->client->voir && !$socid) { |
|
369 | + $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; |
|
370 | + } |
|
371 | + if ($socid) { |
|
372 | + $sql.= " AND s.rowid = ".$socid; |
|
373 | + } |
|
329 | 374 | $sql .= " ORDER BY a.datep2 DESC"; |
330 | 375 | $sql .= $db->plimit($max, 0); |
331 | 376 | |
@@ -383,8 +428,7 @@ discard block |
||
383 | 428 | print "</table><br>"; |
384 | 429 | |
385 | 430 | $db->free($resql); |
386 | - } |
|
387 | - else |
|
431 | + } else |
|
388 | 432 | { |
389 | 433 | dol_print_error($db); |
390 | 434 | } |
@@ -471,7 +515,9 @@ discard block |
||
471 | 515 | $listofresourcelinked = $resource->getElementResources($object->element, $object->id); |
472 | 516 | $nbResources=count($listofresourcelinked); |
473 | 517 | $head[$h][1] = $langs->trans("Resources"); |
474 | - if ($nbResources > 0) $head[$h][1].= ' <span class="badge">'.($nbResources).'</span>'; |
|
518 | + if ($nbResources > 0) { |
|
519 | + $head[$h][1].= ' <span class="badge">'.($nbResources).'</span>'; |
|
520 | + } |
|
475 | 521 | $head[$h][2] = 'resources'; |
476 | 522 | $h++; |
477 | 523 | } |
@@ -484,7 +530,9 @@ discard block |
||
484 | 530 | $nbLinks=Link::count($db, $object->element, $object->id); |
485 | 531 | $head[$h][0] = DOL_URL_ROOT.'/comm/action/document.php?id='.$object->id; |
486 | 532 | $head[$h][1] = $langs->trans("Documents"); |
487 | - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
533 | + if (($nbFiles+$nbLinks) > 0) { |
|
534 | + $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
535 | + } |
|
488 | 536 | $head[$h][2] = 'documents'; |
489 | 537 | $h++; |
490 | 538 |
@@ -35,33 +35,33 @@ discard block |
||
35 | 35 | */ |
36 | 36 | function facture_prepare_head($object) |
37 | 37 | { |
38 | - global $db, $langs, $conf; |
|
39 | - |
|
40 | - $h = 0; |
|
41 | - $head = array(); |
|
42 | - |
|
43 | - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/card.php?facid='.$object->id; |
|
44 | - $head[$h][1] = $langs->trans('Card'); |
|
45 | - $head[$h][2] = 'compta'; |
|
46 | - $h++; |
|
47 | - |
|
48 | - if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) |
|
49 | - { |
|
50 | - $nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external')); |
|
51 | - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?facid='.$object->id; |
|
52 | - $head[$h][1] = $langs->trans('ContactsAddresses'); |
|
53 | - if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>'; |
|
54 | - $head[$h][2] = 'contact'; |
|
55 | - $h++; |
|
56 | - } |
|
57 | - |
|
58 | - //if ($fac->mode_reglement_code == 'PRE') |
|
59 | - if (! empty($conf->prelevement->enabled)) |
|
60 | - { |
|
61 | - $nbStandingOrders=0; |
|
62 | - $sql = "SELECT COUNT(pfd.rowid) as nb"; |
|
63 | - $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; |
|
64 | - $sql .= " WHERE pfd.fk_facture = ".$object->id; |
|
38 | + global $db, $langs, $conf; |
|
39 | + |
|
40 | + $h = 0; |
|
41 | + $head = array(); |
|
42 | + |
|
43 | + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/card.php?facid='.$object->id; |
|
44 | + $head[$h][1] = $langs->trans('Card'); |
|
45 | + $head[$h][2] = 'compta'; |
|
46 | + $h++; |
|
47 | + |
|
48 | + if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) |
|
49 | + { |
|
50 | + $nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external')); |
|
51 | + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?facid='.$object->id; |
|
52 | + $head[$h][1] = $langs->trans('ContactsAddresses'); |
|
53 | + if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>'; |
|
54 | + $head[$h][2] = 'contact'; |
|
55 | + $h++; |
|
56 | + } |
|
57 | + |
|
58 | + //if ($fac->mode_reglement_code == 'PRE') |
|
59 | + if (! empty($conf->prelevement->enabled)) |
|
60 | + { |
|
61 | + $nbStandingOrders=0; |
|
62 | + $sql = "SELECT COUNT(pfd.rowid) as nb"; |
|
63 | + $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; |
|
64 | + $sql .= " WHERE pfd.fk_facture = ".$object->id; |
|
65 | 65 | $resql=$db->query($sql); |
66 | 66 | if ($resql) |
67 | 67 | { |
@@ -69,12 +69,12 @@ discard block |
||
69 | 69 | if ($obj) $nbStandingOrders = $obj->nb; |
70 | 70 | } |
71 | 71 | else dol_print_error($db); |
72 | - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$object->id; |
|
73 | - $head[$h][1] = $langs->trans('StandingOrders'); |
|
74 | - if ($nbStandingOrders > 0) $head[$h][1].= ' <span class="badge">'.$nbStandingOrders.'</span>'; |
|
75 | - $head[$h][2] = 'standingorders'; |
|
76 | - $h++; |
|
77 | - } |
|
72 | + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$object->id; |
|
73 | + $head[$h][1] = $langs->trans('StandingOrders'); |
|
74 | + if ($nbStandingOrders > 0) $head[$h][1].= ' <span class="badge">'.$nbStandingOrders.'</span>'; |
|
75 | + $head[$h][2] = 'standingorders'; |
|
76 | + $h++; |
|
77 | + } |
|
78 | 78 | |
79 | 79 | // Show more tabs from modules |
80 | 80 | // Entries must be declared in modules descriptor with line |
@@ -84,35 +84,35 @@ discard block |
||
84 | 84 | |
85 | 85 | if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) |
86 | 86 | { |
87 | - $nbNote = 0; |
|
87 | + $nbNote = 0; |
|
88 | 88 | if(!empty($object->note_private)) $nbNote++; |
89 | - if(!empty($object->note_public)) $nbNote++; |
|
90 | - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$object->id; |
|
91 | - $head[$h][1] = $langs->trans('Notes'); |
|
92 | - if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
93 | - $head[$h][2] = 'note'; |
|
94 | - $h++; |
|
89 | + if(!empty($object->note_public)) $nbNote++; |
|
90 | + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$object->id; |
|
91 | + $head[$h][1] = $langs->trans('Notes'); |
|
92 | + if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
93 | + $head[$h][2] = 'note'; |
|
94 | + $h++; |
|
95 | 95 | } |
96 | 96 | |
97 | - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
97 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
98 | 98 | require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; |
99 | - $upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref); |
|
100 | - $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$')); |
|
99 | + $upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref); |
|
100 | + $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$')); |
|
101 | 101 | $nbLinks=Link::count($db, $object->element, $object->id); |
102 | - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/document.php?facid='.$object->id; |
|
103 | - $head[$h][1] = $langs->trans('Documents'); |
|
104 | - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
105 | - $head[$h][2] = 'documents'; |
|
106 | - $h++; |
|
102 | + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/document.php?facid='.$object->id; |
|
103 | + $head[$h][1] = $langs->trans('Documents'); |
|
104 | + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
105 | + $head[$h][2] = 'documents'; |
|
106 | + $h++; |
|
107 | 107 | |
108 | - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/info.php?facid='.$object->id; |
|
109 | - $head[$h][1] = $langs->trans('Info'); |
|
110 | - $head[$h][2] = 'info'; |
|
111 | - $h++; |
|
108 | + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/info.php?facid='.$object->id; |
|
109 | + $head[$h][1] = $langs->trans('Info'); |
|
110 | + $head[$h][2] = 'info'; |
|
111 | + $h++; |
|
112 | 112 | |
113 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice','remove'); |
|
113 | + complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice','remove'); |
|
114 | 114 | |
115 | - return $head; |
|
115 | + return $head; |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
@@ -122,50 +122,50 @@ discard block |
||
122 | 122 | */ |
123 | 123 | function invoice_admin_prepare_head() |
124 | 124 | { |
125 | - global $langs, $conf, $user; |
|
126 | - |
|
127 | - $h = 0; |
|
128 | - $head = array(); |
|
129 | - |
|
130 | - $head[$h][0] = DOL_URL_ROOT.'/admin/facture.php'; |
|
131 | - $head[$h][1] = $langs->trans("Miscellaneous"); |
|
132 | - $head[$h][2] = 'general'; |
|
133 | - $h++; |
|
134 | - |
|
135 | - $head[$h][0] = DOL_URL_ROOT.'/admin/payment.php'; |
|
136 | - $head[$h][1] = $langs->trans("Payments"); |
|
137 | - $head[$h][2] = 'payment'; |
|
138 | - $h++; |
|
139 | - |
|
140 | - // Show more tabs from modules |
|
141 | - // Entries must be declared in modules descriptor with line |
|
142 | - // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
|
143 | - // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab |
|
144 | - complete_head_from_modules($conf,$langs,null,$head,$h,'invoice_admin'); |
|
145 | - |
|
146 | - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_cust_extrafields.php'; |
|
147 | - $head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoices"); |
|
148 | - $head[$h][2] = 'attributes'; |
|
149 | - $h++; |
|
150 | - |
|
151 | - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_cust_extrafields.php'; |
|
152 | - $head[$h][1] = $langs->trans("ExtraFieldsLines"); |
|
153 | - $head[$h][2] = 'attributeslines'; |
|
154 | - $h++; |
|
155 | - |
|
156 | - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_rec_cust_extrafields.php'; |
|
157 | - $head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoicesRec"); |
|
158 | - $head[$h][2] = 'attributesrec'; |
|
159 | - $h++; |
|
160 | - |
|
161 | - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_rec_cust_extrafields.php'; |
|
162 | - $head[$h][1] = $langs->trans("ExtraFieldsLinesRec"); |
|
163 | - $head[$h][2] = 'attributeslinesrec'; |
|
164 | - $h++; |
|
165 | - |
|
166 | - complete_head_from_modules($conf,$langs,null,$head,$h,'invoice_admin','remove'); |
|
167 | - |
|
168 | - return $head; |
|
125 | + global $langs, $conf, $user; |
|
126 | + |
|
127 | + $h = 0; |
|
128 | + $head = array(); |
|
129 | + |
|
130 | + $head[$h][0] = DOL_URL_ROOT.'/admin/facture.php'; |
|
131 | + $head[$h][1] = $langs->trans("Miscellaneous"); |
|
132 | + $head[$h][2] = 'general'; |
|
133 | + $h++; |
|
134 | + |
|
135 | + $head[$h][0] = DOL_URL_ROOT.'/admin/payment.php'; |
|
136 | + $head[$h][1] = $langs->trans("Payments"); |
|
137 | + $head[$h][2] = 'payment'; |
|
138 | + $h++; |
|
139 | + |
|
140 | + // Show more tabs from modules |
|
141 | + // Entries must be declared in modules descriptor with line |
|
142 | + // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
|
143 | + // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab |
|
144 | + complete_head_from_modules($conf,$langs,null,$head,$h,'invoice_admin'); |
|
145 | + |
|
146 | + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_cust_extrafields.php'; |
|
147 | + $head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoices"); |
|
148 | + $head[$h][2] = 'attributes'; |
|
149 | + $h++; |
|
150 | + |
|
151 | + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_cust_extrafields.php'; |
|
152 | + $head[$h][1] = $langs->trans("ExtraFieldsLines"); |
|
153 | + $head[$h][2] = 'attributeslines'; |
|
154 | + $h++; |
|
155 | + |
|
156 | + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_rec_cust_extrafields.php'; |
|
157 | + $head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoicesRec"); |
|
158 | + $head[$h][2] = 'attributesrec'; |
|
159 | + $h++; |
|
160 | + |
|
161 | + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_rec_cust_extrafields.php'; |
|
162 | + $head[$h][1] = $langs->trans("ExtraFieldsLinesRec"); |
|
163 | + $head[$h][2] = 'attributeslinesrec'; |
|
164 | + $h++; |
|
165 | + |
|
166 | + complete_head_from_modules($conf,$langs,null,$head,$h,'invoice_admin','remove'); |
|
167 | + |
|
168 | + return $head; |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | |
@@ -177,15 +177,15 @@ discard block |
||
177 | 177 | */ |
178 | 178 | function invoice_rec_prepare_head($object) |
179 | 179 | { |
180 | - global $db, $langs, $conf; |
|
180 | + global $db, $langs, $conf; |
|
181 | 181 | |
182 | - $h = 0; |
|
183 | - $head = array(); |
|
182 | + $h = 0; |
|
183 | + $head = array(); |
|
184 | 184 | |
185 | - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/fiche-rec.php?id='.$object->id; |
|
186 | - $head[$h][1] = $langs->trans("CardBill"); |
|
187 | - $head[$h][2] = 'card'; |
|
188 | - $h++; |
|
185 | + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/fiche-rec.php?id='.$object->id; |
|
186 | + $head[$h][1] = $langs->trans("CardBill"); |
|
187 | + $head[$h][2] = 'card'; |
|
188 | + $h++; |
|
189 | 189 | |
190 | 190 | // Show more tabs from modules |
191 | 191 | // Entries must be declared in modules descriptor with line |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | // $this->tabs = array('entity:-tabname); to remove a tab |
194 | 194 | complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice-rec'); |
195 | 195 | |
196 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice-rec','remove'); |
|
196 | + complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice-rec','remove'); |
|
197 | 197 | |
198 | - return $head; |
|
198 | + return $head; |
|
199 | 199 | } |
@@ -47,31 +47,31 @@ discard block |
||
47 | 47 | |
48 | 48 | if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) |
49 | 49 | { |
50 | - $nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external')); |
|
50 | + $nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external')); |
|
51 | 51 | $head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?facid='.$object->id; |
52 | 52 | $head[$h][1] = $langs->trans('ContactsAddresses'); |
53 | - if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>'; |
|
53 | + if ($nbContact > 0) $head[$h][1] .= ' <span class="badge">'.$nbContact.'</span>'; |
|
54 | 54 | $head[$h][2] = 'contact'; |
55 | 55 | $h++; |
56 | 56 | } |
57 | 57 | |
58 | 58 | //if ($fac->mode_reglement_code == 'PRE') |
59 | - if (! empty($conf->prelevement->enabled)) |
|
59 | + if (!empty($conf->prelevement->enabled)) |
|
60 | 60 | { |
61 | - $nbStandingOrders=0; |
|
61 | + $nbStandingOrders = 0; |
|
62 | 62 | $sql = "SELECT COUNT(pfd.rowid) as nb"; |
63 | 63 | $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; |
64 | 64 | $sql .= " WHERE pfd.fk_facture = ".$object->id; |
65 | - $resql=$db->query($sql); |
|
65 | + $resql = $db->query($sql); |
|
66 | 66 | if ($resql) |
67 | 67 | { |
68 | - $obj=$db->fetch_object($resql); |
|
68 | + $obj = $db->fetch_object($resql); |
|
69 | 69 | if ($obj) $nbStandingOrders = $obj->nb; |
70 | 70 | } |
71 | 71 | else dol_print_error($db); |
72 | 72 | $head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$object->id; |
73 | 73 | $head[$h][1] = $langs->trans('StandingOrders'); |
74 | - if ($nbStandingOrders > 0) $head[$h][1].= ' <span class="badge">'.$nbStandingOrders.'</span>'; |
|
74 | + if ($nbStandingOrders > 0) $head[$h][1] .= ' <span class="badge">'.$nbStandingOrders.'</span>'; |
|
75 | 75 | $head[$h][2] = 'standingorders'; |
76 | 76 | $h++; |
77 | 77 | } |
@@ -80,28 +80,28 @@ discard block |
||
80 | 80 | // Entries must be declared in modules descriptor with line |
81 | 81 | // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
82 | 82 | // $this->tabs = array('entity:-tabname); to remove a tab |
83 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice'); |
|
83 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'invoice'); |
|
84 | 84 | |
85 | 85 | if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) |
86 | 86 | { |
87 | 87 | $nbNote = 0; |
88 | - if(!empty($object->note_private)) $nbNote++; |
|
89 | - if(!empty($object->note_public)) $nbNote++; |
|
88 | + if (!empty($object->note_private)) $nbNote++; |
|
89 | + if (!empty($object->note_public)) $nbNote++; |
|
90 | 90 | $head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$object->id; |
91 | 91 | $head[$h][1] = $langs->trans('Notes'); |
92 | - if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
92 | + if ($nbNote > 0) $head[$h][1] .= ' <span class="badge">'.$nbNote.'</span>'; |
|
93 | 93 | $head[$h][2] = 'note'; |
94 | 94 | $h++; |
95 | 95 | } |
96 | 96 | |
97 | 97 | require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
98 | 98 | require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; |
99 | - $upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref); |
|
100 | - $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$')); |
|
101 | - $nbLinks=Link::count($db, $object->element, $object->id); |
|
99 | + $upload_dir = $conf->facture->dir_output."/".dol_sanitizeFileName($object->ref); |
|
100 | + $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); |
|
101 | + $nbLinks = Link::count($db, $object->element, $object->id); |
|
102 | 102 | $head[$h][0] = DOL_URL_ROOT.'/compta/facture/document.php?facid='.$object->id; |
103 | 103 | $head[$h][1] = $langs->trans('Documents'); |
104 | - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
104 | + if (($nbFiles + $nbLinks) > 0) $head[$h][1] .= ' <span class="badge">'.($nbFiles + $nbLinks).'</span>'; |
|
105 | 105 | $head[$h][2] = 'documents'; |
106 | 106 | $h++; |
107 | 107 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $head[$h][2] = 'info'; |
111 | 111 | $h++; |
112 | 112 | |
113 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice','remove'); |
|
113 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'invoice', 'remove'); |
|
114 | 114 | |
115 | 115 | return $head; |
116 | 116 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | // Entries must be declared in modules descriptor with line |
142 | 142 | // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
143 | 143 | // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab |
144 | - complete_head_from_modules($conf,$langs,null,$head,$h,'invoice_admin'); |
|
144 | + complete_head_from_modules($conf, $langs, null, $head, $h, 'invoice_admin'); |
|
145 | 145 | |
146 | 146 | $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_cust_extrafields.php'; |
147 | 147 | $head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoices"); |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $head[$h][2] = 'attributeslinesrec'; |
164 | 164 | $h++; |
165 | 165 | |
166 | - complete_head_from_modules($conf,$langs,null,$head,$h,'invoice_admin','remove'); |
|
166 | + complete_head_from_modules($conf, $langs, null, $head, $h, 'invoice_admin', 'remove'); |
|
167 | 167 | |
168 | 168 | return $head; |
169 | 169 | } |
@@ -191,9 +191,9 @@ discard block |
||
191 | 191 | // Entries must be declared in modules descriptor with line |
192 | 192 | // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
193 | 193 | // $this->tabs = array('entity:-tabname); to remove a tab |
194 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice-rec'); |
|
194 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'invoice-rec'); |
|
195 | 195 | |
196 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice-rec','remove'); |
|
196 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'invoice-rec', 'remove'); |
|
197 | 197 | |
198 | 198 | return $head; |
199 | 199 | } |
@@ -50,7 +50,9 @@ discard block |
||
50 | 50 | $nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external')); |
51 | 51 | $head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?facid='.$object->id; |
52 | 52 | $head[$h][1] = $langs->trans('ContactsAddresses'); |
53 | - if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>'; |
|
53 | + if ($nbContact > 0) { |
|
54 | + $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>'; |
|
55 | + } |
|
54 | 56 | $head[$h][2] = 'contact'; |
55 | 57 | $h++; |
56 | 58 | } |
@@ -66,12 +68,17 @@ discard block |
||
66 | 68 | if ($resql) |
67 | 69 | { |
68 | 70 | $obj=$db->fetch_object($resql); |
69 | - if ($obj) $nbStandingOrders = $obj->nb; |
|
71 | + if ($obj) { |
|
72 | + $nbStandingOrders = $obj->nb; |
|
73 | + } |
|
74 | + } else { |
|
75 | + dol_print_error($db); |
|
70 | 76 | } |
71 | - else dol_print_error($db); |
|
72 | 77 | $head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$object->id; |
73 | 78 | $head[$h][1] = $langs->trans('StandingOrders'); |
74 | - if ($nbStandingOrders > 0) $head[$h][1].= ' <span class="badge">'.$nbStandingOrders.'</span>'; |
|
79 | + if ($nbStandingOrders > 0) { |
|
80 | + $head[$h][1].= ' <span class="badge">'.$nbStandingOrders.'</span>'; |
|
81 | + } |
|
75 | 82 | $head[$h][2] = 'standingorders'; |
76 | 83 | $h++; |
77 | 84 | } |
@@ -85,11 +92,17 @@ discard block |
||
85 | 92 | if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) |
86 | 93 | { |
87 | 94 | $nbNote = 0; |
88 | - if(!empty($object->note_private)) $nbNote++; |
|
89 | - if(!empty($object->note_public)) $nbNote++; |
|
95 | + if(!empty($object->note_private)) { |
|
96 | + $nbNote++; |
|
97 | + } |
|
98 | + if(!empty($object->note_public)) { |
|
99 | + $nbNote++; |
|
100 | + } |
|
90 | 101 | $head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$object->id; |
91 | 102 | $head[$h][1] = $langs->trans('Notes'); |
92 | - if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
103 | + if ($nbNote > 0) { |
|
104 | + $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
105 | + } |
|
93 | 106 | $head[$h][2] = 'note'; |
94 | 107 | $h++; |
95 | 108 | } |
@@ -101,7 +114,9 @@ discard block |
||
101 | 114 | $nbLinks=Link::count($db, $object->element, $object->id); |
102 | 115 | $head[$h][0] = DOL_URL_ROOT.'/compta/facture/document.php?facid='.$object->id; |
103 | 116 | $head[$h][1] = $langs->trans('Documents'); |
104 | - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
117 | + if (($nbFiles+$nbLinks) > 0) { |
|
118 | + $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
119 | + } |
|
105 | 120 | $head[$h][2] = 'documents'; |
106 | 121 | $h++; |
107 | 122 |
@@ -30,30 +30,30 @@ discard block |
||
30 | 30 | */ |
31 | 31 | function establishment_prepare_head($object) |
32 | 32 | { |
33 | - global $langs, $conf; |
|
33 | + global $langs, $conf; |
|
34 | 34 | |
35 | - $h = 0; |
|
36 | - $head = array(); |
|
35 | + $h = 0; |
|
36 | + $head = array(); |
|
37 | 37 | |
38 | - $head[$h][0] = DOL_URL_ROOT.'/hrm/establishment/card.php?id=' . $object->id; |
|
39 | - $head[$h][1] = $langs->trans("Card"); |
|
40 | - $head[$h][2] = 'card'; |
|
41 | - $h++; |
|
38 | + $head[$h][0] = DOL_URL_ROOT.'/hrm/establishment/card.php?id=' . $object->id; |
|
39 | + $head[$h][1] = $langs->trans("Card"); |
|
40 | + $head[$h][2] = 'card'; |
|
41 | + $h++; |
|
42 | 42 | |
43 | - // Show more tabs from modules |
|
44 | - // Entries must be declared in modules descriptor with line |
|
43 | + // Show more tabs from modules |
|
44 | + // Entries must be declared in modules descriptor with line |
|
45 | 45 | // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
46 | 46 | // $this->tabs = array('entity:-tabname); to remove a tab |
47 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'establishment'); |
|
47 | + complete_head_from_modules($conf,$langs,$object,$head,$h,'establishment'); |
|
48 | 48 | |
49 | - $head[$h][0] = DOL_URL_ROOT.'/hrm/establishment/info.php?id=' . $object->id; |
|
50 | - $head[$h][1] = $langs->trans("Info"); |
|
51 | - $head[$h][2] = 'info'; |
|
52 | - $h++; |
|
49 | + $head[$h][0] = DOL_URL_ROOT.'/hrm/establishment/info.php?id=' . $object->id; |
|
50 | + $head[$h][1] = $langs->trans("Info"); |
|
51 | + $head[$h][2] = 'info'; |
|
52 | + $h++; |
|
53 | 53 | |
54 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'establishment','remove'); |
|
54 | + complete_head_from_modules($conf,$langs,$object,$head,$h,'establishment','remove'); |
|
55 | 55 | |
56 | - return $head; |
|
56 | + return $head; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -68,12 +68,12 @@ discard block |
||
68 | 68 | $h = 0; |
69 | 69 | $head = array(); |
70 | 70 | |
71 | - $head[$h][0] = DOL_URL_ROOT.'/hrm/admin/admin_hrm.php'; |
|
71 | + $head[$h][0] = DOL_URL_ROOT.'/hrm/admin/admin_hrm.php'; |
|
72 | 72 | $head[$h][1] = $langs->trans("Parameters"); |
73 | 73 | $head[$h][2] = 'parameters'; |
74 | 74 | $h++; |
75 | 75 | |
76 | - $head[$h][0] = DOL_URL_ROOT.'/hrm/admin/admin_establishment.php'; |
|
76 | + $head[$h][0] = DOL_URL_ROOT.'/hrm/admin/admin_establishment.php'; |
|
77 | 77 | $head[$h][1] = $langs->trans("Establishments"); |
78 | 78 | $head[$h][2] = 'establishments'; |
79 | 79 | $h++; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $h = 0; |
36 | 36 | $head = array(); |
37 | 37 | |
38 | - $head[$h][0] = DOL_URL_ROOT.'/hrm/establishment/card.php?id=' . $object->id; |
|
38 | + $head[$h][0] = DOL_URL_ROOT.'/hrm/establishment/card.php?id='.$object->id; |
|
39 | 39 | $head[$h][1] = $langs->trans("Card"); |
40 | 40 | $head[$h][2] = 'card'; |
41 | 41 | $h++; |
@@ -44,14 +44,14 @@ discard block |
||
44 | 44 | // Entries must be declared in modules descriptor with line |
45 | 45 | // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
46 | 46 | // $this->tabs = array('entity:-tabname); to remove a tab |
47 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'establishment'); |
|
47 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'establishment'); |
|
48 | 48 | |
49 | - $head[$h][0] = DOL_URL_ROOT.'/hrm/establishment/info.php?id=' . $object->id; |
|
49 | + $head[$h][0] = DOL_URL_ROOT.'/hrm/establishment/info.php?id='.$object->id; |
|
50 | 50 | $head[$h][1] = $langs->trans("Info"); |
51 | 51 | $head[$h][2] = 'info'; |
52 | 52 | $h++; |
53 | 53 | |
54 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'establishment','remove'); |
|
54 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'establishment', 'remove'); |
|
55 | 55 | |
56 | 56 | return $head; |
57 | 57 | } |
@@ -82,9 +82,9 @@ discard block |
||
82 | 82 | // Entries must be declared in modules descriptor with line |
83 | 83 | // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
84 | 84 | // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab |
85 | - complete_head_from_modules($conf,$langs,'',$head,$h,'hrm_admin'); |
|
85 | + complete_head_from_modules($conf, $langs, '', $head, $h, 'hrm_admin'); |
|
86 | 86 | |
87 | - complete_head_from_modules($conf,$langs,'',$head,$h,'hrm_admin','remove'); |
|
87 | + complete_head_from_modules($conf, $langs, '', $head, $h, 'hrm_admin', 'remove'); |
|
88 | 88 | |
89 | 89 | return $head; |
90 | 90 | } |
@@ -28,15 +28,15 @@ discard block |
||
28 | 28 | function payment_prepare_head(Paiement $object) |
29 | 29 | { |
30 | 30 | |
31 | - global $langs, $conf; |
|
31 | + global $langs, $conf; |
|
32 | 32 | |
33 | - $h = 0; |
|
34 | - $head = array(); |
|
33 | + $h = 0; |
|
34 | + $head = array(); |
|
35 | 35 | |
36 | - $head[$h][0] = DOL_URL_ROOT.'/compta/paiement/card.php?id='.$object->id; |
|
37 | - $head[$h][1] = $langs->trans("Card"); |
|
38 | - $head[$h][2] = 'payment'; |
|
39 | - $h++; |
|
36 | + $head[$h][0] = DOL_URL_ROOT.'/compta/paiement/card.php?id='.$object->id; |
|
37 | + $head[$h][1] = $langs->trans("Card"); |
|
38 | + $head[$h][2] = 'payment'; |
|
39 | + $h++; |
|
40 | 40 | |
41 | 41 | // Show more tabs from modules |
42 | 42 | // Entries must be declared in modules descriptor with line |
@@ -44,14 +44,14 @@ discard block |
||
44 | 44 | // $this->tabs = array('entity:-tabname); to remove a tab |
45 | 45 | complete_head_from_modules($conf,$langs,$object,$head,$h,'payment'); |
46 | 46 | |
47 | - $head[$h][0] = DOL_URL_ROOT.'/compta/paiement/info.php?id='.$object->id; |
|
48 | - $head[$h][1] = $langs->trans("Info"); |
|
49 | - $head[$h][2] = 'info'; |
|
50 | - $h++; |
|
47 | + $head[$h][0] = DOL_URL_ROOT.'/compta/paiement/info.php?id='.$object->id; |
|
48 | + $head[$h][1] = $langs->trans("Info"); |
|
49 | + $head[$h][2] = 'info'; |
|
50 | + $h++; |
|
51 | 51 | |
52 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'payment', 'remove'); |
|
52 | + complete_head_from_modules($conf,$langs,$object,$head,$h,'payment', 'remove'); |
|
53 | 53 | |
54 | - return $head; |
|
54 | + return $head; |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -63,15 +63,15 @@ discard block |
||
63 | 63 | */ |
64 | 64 | function payment_supplier_prepare_head(Paiement $object) |
65 | 65 | { |
66 | - global $langs, $conf; |
|
66 | + global $langs, $conf; |
|
67 | 67 | |
68 | - $h = 0; |
|
69 | - $head = array(); |
|
68 | + $h = 0; |
|
69 | + $head = array(); |
|
70 | 70 | |
71 | - $head[$h][0] = DOL_URL_ROOT.'/fourn/paiement/card.php?id='.$object->id; |
|
72 | - $head[$h][1] = $langs->trans("Card"); |
|
73 | - $head[$h][2] = 'payment'; |
|
74 | - $h++; |
|
71 | + $head[$h][0] = DOL_URL_ROOT.'/fourn/paiement/card.php?id='.$object->id; |
|
72 | + $head[$h][1] = $langs->trans("Card"); |
|
73 | + $head[$h][2] = 'payment'; |
|
74 | + $h++; |
|
75 | 75 | |
76 | 76 | // Show more tabs from modules |
77 | 77 | // Entries must be declared in modules descriptor with line |
@@ -79,14 +79,14 @@ discard block |
||
79 | 79 | // $this->tabs = array('entity:-tabname); to remove a tab |
80 | 80 | complete_head_from_modules($conf,$langs,$object,$head,$h,'payment_supplier'); |
81 | 81 | |
82 | - $head[$h][0] = DOL_URL_ROOT.'/fourn/paiement/info.php?id='.$object->id; |
|
83 | - $head[$h][1] = $langs->trans('Info'); |
|
84 | - $head[$h][2] = 'info'; |
|
85 | - $h++; |
|
82 | + $head[$h][0] = DOL_URL_ROOT.'/fourn/paiement/info.php?id='.$object->id; |
|
83 | + $head[$h][1] = $langs->trans('Info'); |
|
84 | + $head[$h][2] = 'info'; |
|
85 | + $h++; |
|
86 | 86 | |
87 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'payment_supplier', 'remove'); |
|
87 | + complete_head_from_modules($conf,$langs,$object,$head,$h,'payment_supplier', 'remove'); |
|
88 | 88 | |
89 | - return $head; |
|
89 | + return $head; |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
@@ -97,23 +97,23 @@ discard block |
||
97 | 97 | */ |
98 | 98 | function getValidOnlinePaymentMethods($paymentmethod='') |
99 | 99 | { |
100 | - global $conf; |
|
101 | - |
|
102 | - $validpaymentmethod=array(); |
|
103 | - |
|
104 | - if ((empty($paymentmethod) || $paymentmethod == 'paypal') && ! empty($conf->paypal->enabled)) |
|
105 | - { |
|
106 | - $validpaymentmethod['paypal']='valid'; |
|
107 | - } |
|
108 | - if ((empty($paymentmethod) || $paymentmethod == 'paybox') && ! empty($conf->paybox->enabled)) |
|
109 | - { |
|
110 | - $validpaymentmethod['paybox']='valid'; |
|
111 | - } |
|
112 | - if ((empty($paymentmethod) || $paymentmethod == 'stripe') && ! empty($conf->stripe->enabled)) |
|
113 | - { |
|
114 | - $validpaymentmethod['stripe']='valid'; |
|
115 | - } |
|
116 | - return $validpaymentmethod; |
|
100 | + global $conf; |
|
101 | + |
|
102 | + $validpaymentmethod=array(); |
|
103 | + |
|
104 | + if ((empty($paymentmethod) || $paymentmethod == 'paypal') && ! empty($conf->paypal->enabled)) |
|
105 | + { |
|
106 | + $validpaymentmethod['paypal']='valid'; |
|
107 | + } |
|
108 | + if ((empty($paymentmethod) || $paymentmethod == 'paybox') && ! empty($conf->paybox->enabled)) |
|
109 | + { |
|
110 | + $validpaymentmethod['paybox']='valid'; |
|
111 | + } |
|
112 | + if ((empty($paymentmethod) || $paymentmethod == 'stripe') && ! empty($conf->stripe->enabled)) |
|
113 | + { |
|
114 | + $validpaymentmethod['stripe']='valid'; |
|
115 | + } |
|
116 | + return $validpaymentmethod; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
@@ -125,18 +125,18 @@ discard block |
||
125 | 125 | */ |
126 | 126 | function showOnlinePaymentUrl($type,$ref) |
127 | 127 | { |
128 | - global $conf, $langs; |
|
128 | + global $conf, $langs; |
|
129 | 129 | |
130 | - // Load translation files required by the page |
|
130 | + // Load translation files required by the page |
|
131 | 131 | $langs->loadLangs(array('payment', 'paybox')); |
132 | 132 | |
133 | - $servicename='Online'; |
|
133 | + $servicename='Online'; |
|
134 | 134 | |
135 | - $out = img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePayment",$servicename).'<br>'; |
|
136 | - $url = getOnlinePaymentUrl(0,$type,$ref); |
|
137 | - $out.= '<input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$url.'">'; |
|
138 | - $out.= ajax_autoselect("onlinepaymenturl", 0); |
|
139 | - return $out; |
|
135 | + $out = img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePayment",$servicename).'<br>'; |
|
136 | + $url = getOnlinePaymentUrl(0,$type,$ref); |
|
137 | + $out.= '<input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$url.'">'; |
|
138 | + $out.= ajax_autoselect("onlinepaymenturl", 0); |
|
139 | + return $out; |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | /** |
@@ -151,115 +151,115 @@ discard block |
||
151 | 151 | */ |
152 | 152 | function getOnlinePaymentUrl($mode, $type, $ref='', $amount='9.99', $freetag='your_free_tag') |
153 | 153 | { |
154 | - global $conf; |
|
155 | - |
|
156 | - $ref=str_replace(' ','',$ref); |
|
157 | - $out=''; |
|
158 | - |
|
159 | - if ($type == 'free') |
|
160 | - { |
|
161 | - $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?amount='.($mode?'<font color="#666666">':'').$amount.($mode?'</font>':'').'&tag='.($mode?'<font color="#666666">':'').$freetag.($mode?'</font>':''); |
|
162 | - if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
|
163 | - { |
|
164 | - if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
165 | - else $out.='&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); |
|
166 | - } |
|
167 | - } |
|
168 | - elseif ($type == 'order') |
|
169 | - { |
|
170 | - $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=order&ref='.($mode?'<font color="#666666">':''); |
|
171 | - if ($mode == 1) $out.='order_ref'; |
|
172 | - if ($mode == 0) $out.=urlencode($ref); |
|
173 | - $out.=($mode?'</font>':''); |
|
174 | - if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
|
175 | - { |
|
176 | - if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
177 | - else |
|
178 | - { |
|
179 | - $out.='&securekey='.($mode?'<font color="#666666">':''); |
|
180 | - if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + order_ref)"; |
|
181 | - if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); |
|
182 | - $out.=($mode?'</font>':''); |
|
183 | - } |
|
184 | - } |
|
185 | - } |
|
186 | - elseif ($type == 'invoice') |
|
187 | - { |
|
188 | - $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=invoice&ref='.($mode?'<font color="#666666">':''); |
|
189 | - if ($mode == 1) $out.='invoice_ref'; |
|
190 | - if ($mode == 0) $out.=urlencode($ref); |
|
191 | - $out.=($mode?'</font>':''); |
|
192 | - if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
|
193 | - { |
|
194 | - if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
195 | - else |
|
196 | - { |
|
197 | - $out.='&securekey='.($mode?'<font color="#666666">':''); |
|
198 | - if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + invoice_ref)"; |
|
199 | - if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); |
|
200 | - $out.=($mode?'</font>':''); |
|
201 | - } |
|
202 | - } |
|
203 | - } |
|
204 | - elseif ($type == 'contractline') |
|
205 | - { |
|
206 | - $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=contractline&ref='.($mode?'<font color="#666666">':''); |
|
207 | - if ($mode == 1) $out.='contractline_ref'; |
|
208 | - if ($mode == 0) $out.=urlencode($ref); |
|
209 | - $out.=($mode?'</font>':''); |
|
210 | - if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
|
211 | - { |
|
212 | - if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
213 | - else |
|
214 | - { |
|
215 | - $out.='&securekey='.($mode?'<font color="#666666">':''); |
|
216 | - if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + contractline_ref)"; |
|
217 | - if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); |
|
218 | - $out.=($mode?'</font>':''); |
|
219 | - } |
|
220 | - } |
|
221 | - } |
|
222 | - elseif ($type == 'member' || $type == 'membersubscription') |
|
223 | - { |
|
224 | - $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=membersubscription&ref='.($mode?'<font color="#666666">':''); |
|
225 | - if ($mode == 1) $out.='member_ref'; |
|
226 | - if ($mode == 0) $out.=urlencode($ref); |
|
227 | - $out.=($mode?'</font>':''); |
|
228 | - if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
|
229 | - { |
|
230 | - if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
231 | - else |
|
232 | - { |
|
233 | - $out.='&securekey='.($mode?'<font color="#666666">':''); |
|
234 | - if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + member_ref)"; |
|
235 | - if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); |
|
236 | - $out.=($mode?'</font>':''); |
|
237 | - } |
|
238 | - } |
|
239 | - } |
|
240 | - if ($type == 'donation') |
|
241 | - { |
|
242 | - $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=donation&ref='.($mode?'<font color="#666666">':''); |
|
243 | - if ($mode == 1) $out.='donation_ref'; |
|
244 | - if ($mode == 0) $out.=urlencode($ref); |
|
245 | - $out.=($mode?'</font>':''); |
|
246 | - if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
|
247 | - { |
|
248 | - if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
249 | - else |
|
250 | - { |
|
251 | - $out.='&securekey='.($mode?'<font color="#666666">':''); |
|
252 | - if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + donation_ref)"; |
|
253 | - if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); |
|
254 | - $out.=($mode?'</font>':''); |
|
255 | - } |
|
256 | - } |
|
257 | - } |
|
258 | - |
|
259 | - // For multicompany |
|
260 | - if (! empty($out) && ! empty($conf->multicompany->enabled)) $out.="&entity=".$conf->entity; // Check the entity because we may have the same reference in several entities |
|
261 | - |
|
262 | - return $out; |
|
154 | + global $conf; |
|
155 | + |
|
156 | + $ref=str_replace(' ','',$ref); |
|
157 | + $out=''; |
|
158 | + |
|
159 | + if ($type == 'free') |
|
160 | + { |
|
161 | + $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?amount='.($mode?'<font color="#666666">':'').$amount.($mode?'</font>':'').'&tag='.($mode?'<font color="#666666">':'').$freetag.($mode?'</font>':''); |
|
162 | + if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
|
163 | + { |
|
164 | + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
165 | + else $out.='&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); |
|
166 | + } |
|
167 | + } |
|
168 | + elseif ($type == 'order') |
|
169 | + { |
|
170 | + $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=order&ref='.($mode?'<font color="#666666">':''); |
|
171 | + if ($mode == 1) $out.='order_ref'; |
|
172 | + if ($mode == 0) $out.=urlencode($ref); |
|
173 | + $out.=($mode?'</font>':''); |
|
174 | + if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
|
175 | + { |
|
176 | + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
177 | + else |
|
178 | + { |
|
179 | + $out.='&securekey='.($mode?'<font color="#666666">':''); |
|
180 | + if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + order_ref)"; |
|
181 | + if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); |
|
182 | + $out.=($mode?'</font>':''); |
|
183 | + } |
|
184 | + } |
|
185 | + } |
|
186 | + elseif ($type == 'invoice') |
|
187 | + { |
|
188 | + $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=invoice&ref='.($mode?'<font color="#666666">':''); |
|
189 | + if ($mode == 1) $out.='invoice_ref'; |
|
190 | + if ($mode == 0) $out.=urlencode($ref); |
|
191 | + $out.=($mode?'</font>':''); |
|
192 | + if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
|
193 | + { |
|
194 | + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
195 | + else |
|
196 | + { |
|
197 | + $out.='&securekey='.($mode?'<font color="#666666">':''); |
|
198 | + if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + invoice_ref)"; |
|
199 | + if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); |
|
200 | + $out.=($mode?'</font>':''); |
|
201 | + } |
|
202 | + } |
|
203 | + } |
|
204 | + elseif ($type == 'contractline') |
|
205 | + { |
|
206 | + $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=contractline&ref='.($mode?'<font color="#666666">':''); |
|
207 | + if ($mode == 1) $out.='contractline_ref'; |
|
208 | + if ($mode == 0) $out.=urlencode($ref); |
|
209 | + $out.=($mode?'</font>':''); |
|
210 | + if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
|
211 | + { |
|
212 | + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
213 | + else |
|
214 | + { |
|
215 | + $out.='&securekey='.($mode?'<font color="#666666">':''); |
|
216 | + if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + contractline_ref)"; |
|
217 | + if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); |
|
218 | + $out.=($mode?'</font>':''); |
|
219 | + } |
|
220 | + } |
|
221 | + } |
|
222 | + elseif ($type == 'member' || $type == 'membersubscription') |
|
223 | + { |
|
224 | + $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=membersubscription&ref='.($mode?'<font color="#666666">':''); |
|
225 | + if ($mode == 1) $out.='member_ref'; |
|
226 | + if ($mode == 0) $out.=urlencode($ref); |
|
227 | + $out.=($mode?'</font>':''); |
|
228 | + if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
|
229 | + { |
|
230 | + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
231 | + else |
|
232 | + { |
|
233 | + $out.='&securekey='.($mode?'<font color="#666666">':''); |
|
234 | + if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + member_ref)"; |
|
235 | + if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); |
|
236 | + $out.=($mode?'</font>':''); |
|
237 | + } |
|
238 | + } |
|
239 | + } |
|
240 | + if ($type == 'donation') |
|
241 | + { |
|
242 | + $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=donation&ref='.($mode?'<font color="#666666">':''); |
|
243 | + if ($mode == 1) $out.='donation_ref'; |
|
244 | + if ($mode == 0) $out.=urlencode($ref); |
|
245 | + $out.=($mode?'</font>':''); |
|
246 | + if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
|
247 | + { |
|
248 | + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
249 | + else |
|
250 | + { |
|
251 | + $out.='&securekey='.($mode?'<font color="#666666">':''); |
|
252 | + if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + donation_ref)"; |
|
253 | + if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); |
|
254 | + $out.=($mode?'</font>':''); |
|
255 | + } |
|
256 | + } |
|
257 | + } |
|
258 | + |
|
259 | + // For multicompany |
|
260 | + if (! empty($out) && ! empty($conf->multicompany->enabled)) $out.="&entity=".$conf->entity; // Check the entity because we may have the same reference in several entities |
|
261 | + |
|
262 | + return $out; |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | |
@@ -331,20 +331,20 @@ discard block |
||
331 | 331 | print '<div class="center">'."\n"; |
332 | 332 | if ($addformmessage) |
333 | 333 | { |
334 | - print '<!-- object = '.$object->element.' -->'; |
|
335 | - print '<br>'; |
|
336 | - |
|
337 | - $parammessageform='ONLINE_PAYMENT_MESSAGE_FORM_'.$suffix; |
|
338 | - if (! empty($conf->global->$parammessageform)) print $langs->transnoentities($conf->global->$parammessageform); |
|
339 | - elseif (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_FORM)) print $langs->transnoentities($conf->global->ONLINE_PAYMENT_MESSAGE_FORM); |
|
340 | - |
|
341 | - // Add other message if VAT exists |
|
342 | - if ($object->total_vat != 0 || $object->total_tva != 0) |
|
343 | - { |
|
344 | - $parammessageform='ONLINE_PAYMENT_MESSAGE_FORMIFVAT_'.$suffix; |
|
345 | - if (! empty($conf->global->$parammessageform)) print $langs->transnoentities($conf->global->$parammessageform); |
|
346 | - elseif (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_FORMIFVAT)) print $langs->transnoentities($conf->global->ONLINE_PAYMENT_MESSAGE_FORMIFVAT); |
|
347 | - } |
|
334 | + print '<!-- object = '.$object->element.' -->'; |
|
335 | + print '<br>'; |
|
336 | + |
|
337 | + $parammessageform='ONLINE_PAYMENT_MESSAGE_FORM_'.$suffix; |
|
338 | + if (! empty($conf->global->$parammessageform)) print $langs->transnoentities($conf->global->$parammessageform); |
|
339 | + elseif (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_FORM)) print $langs->transnoentities($conf->global->ONLINE_PAYMENT_MESSAGE_FORM); |
|
340 | + |
|
341 | + // Add other message if VAT exists |
|
342 | + if ($object->total_vat != 0 || $object->total_tva != 0) |
|
343 | + { |
|
344 | + $parammessageform='ONLINE_PAYMENT_MESSAGE_FORMIFVAT_'.$suffix; |
|
345 | + if (! empty($conf->global->$parammessageform)) print $langs->transnoentities($conf->global->$parammessageform); |
|
346 | + elseif (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_FORMIFVAT)) print $langs->transnoentities($conf->global->ONLINE_PAYMENT_MESSAGE_FORMIFVAT); |
|
347 | + } |
|
348 | 348 | } |
349 | 349 | |
350 | 350 | print '<font style="font-size: 10px;"><br><hr>'."\n"; |
@@ -42,14 +42,14 @@ discard block |
||
42 | 42 | // Entries must be declared in modules descriptor with line |
43 | 43 | // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
44 | 44 | // $this->tabs = array('entity:-tabname); to remove a tab |
45 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'payment'); |
|
45 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'payment'); |
|
46 | 46 | |
47 | 47 | $head[$h][0] = DOL_URL_ROOT.'/compta/paiement/info.php?id='.$object->id; |
48 | 48 | $head[$h][1] = $langs->trans("Info"); |
49 | 49 | $head[$h][2] = 'info'; |
50 | 50 | $h++; |
51 | 51 | |
52 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'payment', 'remove'); |
|
52 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'payment', 'remove'); |
|
53 | 53 | |
54 | 54 | return $head; |
55 | 55 | } |
@@ -77,14 +77,14 @@ discard block |
||
77 | 77 | // Entries must be declared in modules descriptor with line |
78 | 78 | // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
79 | 79 | // $this->tabs = array('entity:-tabname); to remove a tab |
80 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'payment_supplier'); |
|
80 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'payment_supplier'); |
|
81 | 81 | |
82 | 82 | $head[$h][0] = DOL_URL_ROOT.'/fourn/paiement/info.php?id='.$object->id; |
83 | 83 | $head[$h][1] = $langs->trans('Info'); |
84 | 84 | $head[$h][2] = 'info'; |
85 | 85 | $h++; |
86 | 86 | |
87 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'payment_supplier', 'remove'); |
|
87 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'payment_supplier', 'remove'); |
|
88 | 88 | |
89 | 89 | return $head; |
90 | 90 | } |
@@ -95,23 +95,23 @@ discard block |
||
95 | 95 | * @param string $paymentmethod Filter on this payment method (''=none, 'paypal', ...) |
96 | 96 | * @return array Array of valid payment method |
97 | 97 | */ |
98 | -function getValidOnlinePaymentMethods($paymentmethod='') |
|
98 | +function getValidOnlinePaymentMethods($paymentmethod = '') |
|
99 | 99 | { |
100 | 100 | global $conf; |
101 | 101 | |
102 | - $validpaymentmethod=array(); |
|
102 | + $validpaymentmethod = array(); |
|
103 | 103 | |
104 | - if ((empty($paymentmethod) || $paymentmethod == 'paypal') && ! empty($conf->paypal->enabled)) |
|
104 | + if ((empty($paymentmethod) || $paymentmethod == 'paypal') && !empty($conf->paypal->enabled)) |
|
105 | 105 | { |
106 | - $validpaymentmethod['paypal']='valid'; |
|
106 | + $validpaymentmethod['paypal'] = 'valid'; |
|
107 | 107 | } |
108 | - if ((empty($paymentmethod) || $paymentmethod == 'paybox') && ! empty($conf->paybox->enabled)) |
|
108 | + if ((empty($paymentmethod) || $paymentmethod == 'paybox') && !empty($conf->paybox->enabled)) |
|
109 | 109 | { |
110 | - $validpaymentmethod['paybox']='valid'; |
|
110 | + $validpaymentmethod['paybox'] = 'valid'; |
|
111 | 111 | } |
112 | - if ((empty($paymentmethod) || $paymentmethod == 'stripe') && ! empty($conf->stripe->enabled)) |
|
112 | + if ((empty($paymentmethod) || $paymentmethod == 'stripe') && !empty($conf->stripe->enabled)) |
|
113 | 113 | { |
114 | - $validpaymentmethod['stripe']='valid'; |
|
114 | + $validpaymentmethod['stripe'] = 'valid'; |
|
115 | 115 | } |
116 | 116 | return $validpaymentmethod; |
117 | 117 | } |
@@ -123,19 +123,19 @@ discard block |
||
123 | 123 | * @param string $ref Ref of object |
124 | 124 | * @return string Url string |
125 | 125 | */ |
126 | -function showOnlinePaymentUrl($type,$ref) |
|
126 | +function showOnlinePaymentUrl($type, $ref) |
|
127 | 127 | { |
128 | 128 | global $conf, $langs; |
129 | 129 | |
130 | 130 | // Load translation files required by the page |
131 | 131 | $langs->loadLangs(array('payment', 'paybox')); |
132 | 132 | |
133 | - $servicename='Online'; |
|
133 | + $servicename = 'Online'; |
|
134 | 134 | |
135 | - $out = img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePayment",$servicename).'<br>'; |
|
136 | - $url = getOnlinePaymentUrl(0,$type,$ref); |
|
137 | - $out.= '<input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$url.'">'; |
|
138 | - $out.= ajax_autoselect("onlinepaymenturl", 0); |
|
135 | + $out = img_picto('', 'object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePayment", $servicename).'<br>'; |
|
136 | + $url = getOnlinePaymentUrl(0, $type, $ref); |
|
137 | + $out .= '<input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$url.'">'; |
|
138 | + $out .= ajax_autoselect("onlinepaymenturl", 0); |
|
139 | 139 | return $out; |
140 | 140 | } |
141 | 141 | |
@@ -149,115 +149,115 @@ discard block |
||
149 | 149 | * @param string $freetag Free tag |
150 | 150 | * @return string Url string |
151 | 151 | */ |
152 | -function getOnlinePaymentUrl($mode, $type, $ref='', $amount='9.99', $freetag='your_free_tag') |
|
152 | +function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag = 'your_free_tag') |
|
153 | 153 | { |
154 | 154 | global $conf; |
155 | 155 | |
156 | - $ref=str_replace(' ','',$ref); |
|
157 | - $out=''; |
|
156 | + $ref = str_replace(' ', '', $ref); |
|
157 | + $out = ''; |
|
158 | 158 | |
159 | 159 | if ($type == 'free') |
160 | 160 | { |
161 | - $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?amount='.($mode?'<font color="#666666">':'').$amount.($mode?'</font>':'').'&tag='.($mode?'<font color="#666666">':'').$freetag.($mode?'</font>':''); |
|
162 | - if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
|
161 | + $out = DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?amount='.($mode ? '<font color="#666666">' : '').$amount.($mode ? '</font>' : '').'&tag='.($mode ? '<font color="#666666">' : '').$freetag.($mode ? '</font>' : ''); |
|
162 | + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
|
163 | 163 | { |
164 | - if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
165 | - else $out.='&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); |
|
164 | + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
165 | + else $out .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); |
|
166 | 166 | } |
167 | 167 | } |
168 | 168 | elseif ($type == 'order') |
169 | 169 | { |
170 | - $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=order&ref='.($mode?'<font color="#666666">':''); |
|
171 | - if ($mode == 1) $out.='order_ref'; |
|
172 | - if ($mode == 0) $out.=urlencode($ref); |
|
173 | - $out.=($mode?'</font>':''); |
|
174 | - if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
|
170 | + $out = DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=order&ref='.($mode ? '<font color="#666666">' : ''); |
|
171 | + if ($mode == 1) $out .= 'order_ref'; |
|
172 | + if ($mode == 0) $out .= urlencode($ref); |
|
173 | + $out .= ($mode ? '</font>' : ''); |
|
174 | + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
|
175 | 175 | { |
176 | - if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
176 | + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
177 | 177 | else |
178 | 178 | { |
179 | - $out.='&securekey='.($mode?'<font color="#666666">':''); |
|
180 | - if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + order_ref)"; |
|
181 | - if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); |
|
182 | - $out.=($mode?'</font>':''); |
|
179 | + $out .= '&securekey='.($mode ? '<font color="#666666">' : ''); |
|
180 | + if ($mode == 1) $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + order_ref)"; |
|
181 | + if ($mode == 0) $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2); |
|
182 | + $out .= ($mode ? '</font>' : ''); |
|
183 | 183 | } |
184 | 184 | } |
185 | 185 | } |
186 | 186 | elseif ($type == 'invoice') |
187 | 187 | { |
188 | - $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=invoice&ref='.($mode?'<font color="#666666">':''); |
|
189 | - if ($mode == 1) $out.='invoice_ref'; |
|
190 | - if ($mode == 0) $out.=urlencode($ref); |
|
191 | - $out.=($mode?'</font>':''); |
|
192 | - if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
|
188 | + $out = DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=invoice&ref='.($mode ? '<font color="#666666">' : ''); |
|
189 | + if ($mode == 1) $out .= 'invoice_ref'; |
|
190 | + if ($mode == 0) $out .= urlencode($ref); |
|
191 | + $out .= ($mode ? '</font>' : ''); |
|
192 | + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
|
193 | 193 | { |
194 | - if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
194 | + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
195 | 195 | else |
196 | 196 | { |
197 | - $out.='&securekey='.($mode?'<font color="#666666">':''); |
|
198 | - if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + invoice_ref)"; |
|
199 | - if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); |
|
200 | - $out.=($mode?'</font>':''); |
|
197 | + $out .= '&securekey='.($mode ? '<font color="#666666">' : ''); |
|
198 | + if ($mode == 1) $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + invoice_ref)"; |
|
199 | + if ($mode == 0) $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2); |
|
200 | + $out .= ($mode ? '</font>' : ''); |
|
201 | 201 | } |
202 | 202 | } |
203 | 203 | } |
204 | 204 | elseif ($type == 'contractline') |
205 | 205 | { |
206 | - $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=contractline&ref='.($mode?'<font color="#666666">':''); |
|
207 | - if ($mode == 1) $out.='contractline_ref'; |
|
208 | - if ($mode == 0) $out.=urlencode($ref); |
|
209 | - $out.=($mode?'</font>':''); |
|
210 | - if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
|
206 | + $out = DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=contractline&ref='.($mode ? '<font color="#666666">' : ''); |
|
207 | + if ($mode == 1) $out .= 'contractline_ref'; |
|
208 | + if ($mode == 0) $out .= urlencode($ref); |
|
209 | + $out .= ($mode ? '</font>' : ''); |
|
210 | + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
|
211 | 211 | { |
212 | - if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
212 | + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
213 | 213 | else |
214 | 214 | { |
215 | - $out.='&securekey='.($mode?'<font color="#666666">':''); |
|
216 | - if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + contractline_ref)"; |
|
217 | - if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); |
|
218 | - $out.=($mode?'</font>':''); |
|
215 | + $out .= '&securekey='.($mode ? '<font color="#666666">' : ''); |
|
216 | + if ($mode == 1) $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + contractline_ref)"; |
|
217 | + if ($mode == 0) $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2); |
|
218 | + $out .= ($mode ? '</font>' : ''); |
|
219 | 219 | } |
220 | 220 | } |
221 | 221 | } |
222 | 222 | elseif ($type == 'member' || $type == 'membersubscription') |
223 | 223 | { |
224 | - $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=membersubscription&ref='.($mode?'<font color="#666666">':''); |
|
225 | - if ($mode == 1) $out.='member_ref'; |
|
226 | - if ($mode == 0) $out.=urlencode($ref); |
|
227 | - $out.=($mode?'</font>':''); |
|
228 | - if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
|
224 | + $out = DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=membersubscription&ref='.($mode ? '<font color="#666666">' : ''); |
|
225 | + if ($mode == 1) $out .= 'member_ref'; |
|
226 | + if ($mode == 0) $out .= urlencode($ref); |
|
227 | + $out .= ($mode ? '</font>' : ''); |
|
228 | + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
|
229 | 229 | { |
230 | - if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
230 | + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
231 | 231 | else |
232 | 232 | { |
233 | - $out.='&securekey='.($mode?'<font color="#666666">':''); |
|
234 | - if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + member_ref)"; |
|
235 | - if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); |
|
236 | - $out.=($mode?'</font>':''); |
|
233 | + $out .= '&securekey='.($mode ? '<font color="#666666">' : ''); |
|
234 | + if ($mode == 1) $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + member_ref)"; |
|
235 | + if ($mode == 0) $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2); |
|
236 | + $out .= ($mode ? '</font>' : ''); |
|
237 | 237 | } |
238 | 238 | } |
239 | 239 | } |
240 | 240 | if ($type == 'donation') |
241 | 241 | { |
242 | - $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=donation&ref='.($mode?'<font color="#666666">':''); |
|
243 | - if ($mode == 1) $out.='donation_ref'; |
|
244 | - if ($mode == 0) $out.=urlencode($ref); |
|
245 | - $out.=($mode?'</font>':''); |
|
246 | - if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
|
242 | + $out = DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=donation&ref='.($mode ? '<font color="#666666">' : ''); |
|
243 | + if ($mode == 1) $out .= 'donation_ref'; |
|
244 | + if ($mode == 0) $out .= urlencode($ref); |
|
245 | + $out .= ($mode ? '</font>' : ''); |
|
246 | + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
|
247 | 247 | { |
248 | - if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
248 | + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
249 | 249 | else |
250 | 250 | { |
251 | - $out.='&securekey='.($mode?'<font color="#666666">':''); |
|
252 | - if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + donation_ref)"; |
|
253 | - if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); |
|
254 | - $out.=($mode?'</font>':''); |
|
251 | + $out .= '&securekey='.($mode ? '<font color="#666666">' : ''); |
|
252 | + if ($mode == 1) $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + donation_ref)"; |
|
253 | + if ($mode == 0) $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2); |
|
254 | + $out .= ($mode ? '</font>' : ''); |
|
255 | 255 | } |
256 | 256 | } |
257 | 257 | } |
258 | 258 | |
259 | 259 | // For multicompany |
260 | - if (! empty($out) && ! empty($conf->multicompany->enabled)) $out.="&entity=".$conf->entity; // Check the entity because we may have the same reference in several entities |
|
260 | + if (!empty($out) && !empty($conf->multicompany->enabled)) $out .= "&entity=".$conf->entity; // Check the entity because we may have the same reference in several entities |
|
261 | 261 | |
262 | 262 | return $out; |
263 | 263 | } |
@@ -274,56 +274,56 @@ discard block |
||
274 | 274 | * @param Object $object Object related to payment |
275 | 275 | * @return void |
276 | 276 | */ |
277 | -function htmlPrintOnlinePaymentFooter($fromcompany, $langs, $addformmessage=0, $suffix='', $object=null) |
|
277 | +function htmlPrintOnlinePaymentFooter($fromcompany, $langs, $addformmessage = 0, $suffix = '', $object = null) |
|
278 | 278 | { |
279 | 279 | global $conf; |
280 | 280 | |
281 | 281 | // Juridical status |
282 | - $line1=""; |
|
282 | + $line1 = ""; |
|
283 | 283 | if ($fromcompany->forme_juridique_code) |
284 | 284 | { |
285 | - $line1.=($line1?" - ":"").getFormeJuridiqueLabel($fromcompany->forme_juridique_code); |
|
285 | + $line1 .= ($line1 ? " - " : "").getFormeJuridiqueLabel($fromcompany->forme_juridique_code); |
|
286 | 286 | } |
287 | 287 | // Capital |
288 | 288 | if ($fromcompany->capital) |
289 | 289 | { |
290 | - $line1.=($line1?" - ":"").$langs->transnoentities("CapitalOf",$fromcompany->capital)." ".$langs->transnoentities("Currency".$conf->currency); |
|
290 | + $line1 .= ($line1 ? " - " : "").$langs->transnoentities("CapitalOf", $fromcompany->capital)." ".$langs->transnoentities("Currency".$conf->currency); |
|
291 | 291 | } |
292 | 292 | // Prof Id 1 |
293 | - if ($fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || ! $fromcompany->idprof2)) |
|
293 | + if ($fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || !$fromcompany->idprof2)) |
|
294 | 294 | { |
295 | - $field=$langs->transcountrynoentities("ProfId1",$fromcompany->country_code); |
|
296 | - if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1]; |
|
297 | - $line1.=($line1?" - ":"").$field.": ".$fromcompany->idprof1; |
|
295 | + $field = $langs->transcountrynoentities("ProfId1", $fromcompany->country_code); |
|
296 | + if (preg_match('/\((.*)\)/i', $field, $reg)) $field = $reg[1]; |
|
297 | + $line1 .= ($line1 ? " - " : "").$field.": ".$fromcompany->idprof1; |
|
298 | 298 | } |
299 | 299 | // Prof Id 2 |
300 | 300 | if ($fromcompany->idprof2) |
301 | 301 | { |
302 | - $field=$langs->transcountrynoentities("ProfId2",$fromcompany->country_code); |
|
303 | - if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1]; |
|
304 | - $line1.=($line1?" - ":"").$field.": ".$fromcompany->idprof2; |
|
302 | + $field = $langs->transcountrynoentities("ProfId2", $fromcompany->country_code); |
|
303 | + if (preg_match('/\((.*)\)/i', $field, $reg)) $field = $reg[1]; |
|
304 | + $line1 .= ($line1 ? " - " : "").$field.": ".$fromcompany->idprof2; |
|
305 | 305 | } |
306 | 306 | |
307 | 307 | // Second line of company infos |
308 | - $line2=""; |
|
308 | + $line2 = ""; |
|
309 | 309 | // Prof Id 3 |
310 | 310 | if ($fromcompany->idprof3) |
311 | 311 | { |
312 | - $field=$langs->transcountrynoentities("ProfId3",$fromcompany->country_code); |
|
313 | - if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1]; |
|
314 | - $line2.=($line2?" - ":"").$field.": ".$fromcompany->idprof3; |
|
312 | + $field = $langs->transcountrynoentities("ProfId3", $fromcompany->country_code); |
|
313 | + if (preg_match('/\((.*)\)/i', $field, $reg)) $field = $reg[1]; |
|
314 | + $line2 .= ($line2 ? " - " : "").$field.": ".$fromcompany->idprof3; |
|
315 | 315 | } |
316 | 316 | // Prof Id 4 |
317 | 317 | if ($fromcompany->idprof4) |
318 | 318 | { |
319 | - $field=$langs->transcountrynoentities("ProfId4",$fromcompany->country_code); |
|
320 | - if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1]; |
|
321 | - $line2.=($line2?" - ":"").$field.": ".$fromcompany->idprof4; |
|
319 | + $field = $langs->transcountrynoentities("ProfId4", $fromcompany->country_code); |
|
320 | + if (preg_match('/\((.*)\)/i', $field, $reg)) $field = $reg[1]; |
|
321 | + $line2 .= ($line2 ? " - " : "").$field.": ".$fromcompany->idprof4; |
|
322 | 322 | } |
323 | 323 | // IntraCommunautary VAT |
324 | 324 | if ($fromcompany->tva_intra != '') |
325 | 325 | { |
326 | - $line2.=($line2?" - ":"").$langs->transnoentities("VATIntraShort").": ".$fromcompany->tva_intra; |
|
326 | + $line2 .= ($line2 ? " - " : "").$langs->transnoentities("VATIntraShort").": ".$fromcompany->tva_intra; |
|
327 | 327 | } |
328 | 328 | |
329 | 329 | print '<br>'; |
@@ -334,16 +334,16 @@ discard block |
||
334 | 334 | print '<!-- object = '.$object->element.' -->'; |
335 | 335 | print '<br>'; |
336 | 336 | |
337 | - $parammessageform='ONLINE_PAYMENT_MESSAGE_FORM_'.$suffix; |
|
338 | - if (! empty($conf->global->$parammessageform)) print $langs->transnoentities($conf->global->$parammessageform); |
|
339 | - elseif (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_FORM)) print $langs->transnoentities($conf->global->ONLINE_PAYMENT_MESSAGE_FORM); |
|
337 | + $parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORM_'.$suffix; |
|
338 | + if (!empty($conf->global->$parammessageform)) print $langs->transnoentities($conf->global->$parammessageform); |
|
339 | + elseif (!empty($conf->global->ONLINE_PAYMENT_MESSAGE_FORM)) print $langs->transnoentities($conf->global->ONLINE_PAYMENT_MESSAGE_FORM); |
|
340 | 340 | |
341 | 341 | // Add other message if VAT exists |
342 | 342 | if ($object->total_vat != 0 || $object->total_tva != 0) |
343 | 343 | { |
344 | - $parammessageform='ONLINE_PAYMENT_MESSAGE_FORMIFVAT_'.$suffix; |
|
345 | - if (! empty($conf->global->$parammessageform)) print $langs->transnoentities($conf->global->$parammessageform); |
|
346 | - elseif (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_FORMIFVAT)) print $langs->transnoentities($conf->global->ONLINE_PAYMENT_MESSAGE_FORMIFVAT); |
|
344 | + $parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORMIFVAT_'.$suffix; |
|
345 | + if (!empty($conf->global->$parammessageform)) print $langs->transnoentities($conf->global->$parammessageform); |
|
346 | + elseif (!empty($conf->global->ONLINE_PAYMENT_MESSAGE_FORMIFVAT)) print $langs->transnoentities($conf->global->ONLINE_PAYMENT_MESSAGE_FORMIFVAT); |
|
347 | 347 | } |
348 | 348 | } |
349 | 349 |
@@ -161,78 +161,113 @@ discard block |
||
161 | 161 | $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?amount='.($mode?'<font color="#666666">':'').$amount.($mode?'</font>':'').'&tag='.($mode?'<font color="#666666">':'').$freetag.($mode?'</font>':''); |
162 | 162 | if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
163 | 163 | { |
164 | - if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
165 | - else $out.='&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); |
|
164 | + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { |
|
165 | + $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
166 | + } else { |
|
167 | + $out.='&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); |
|
168 | + } |
|
166 | 169 | } |
167 | - } |
|
168 | - elseif ($type == 'order') |
|
170 | + } elseif ($type == 'order') |
|
169 | 171 | { |
170 | 172 | $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=order&ref='.($mode?'<font color="#666666">':''); |
171 | - if ($mode == 1) $out.='order_ref'; |
|
172 | - if ($mode == 0) $out.=urlencode($ref); |
|
173 | + if ($mode == 1) { |
|
174 | + $out.='order_ref'; |
|
175 | + } |
|
176 | + if ($mode == 0) { |
|
177 | + $out.=urlencode($ref); |
|
178 | + } |
|
173 | 179 | $out.=($mode?'</font>':''); |
174 | 180 | if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
175 | 181 | { |
176 | - if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
177 | - else |
|
182 | + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { |
|
183 | + $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
184 | + } else |
|
178 | 185 | { |
179 | 186 | $out.='&securekey='.($mode?'<font color="#666666">':''); |
180 | - if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + order_ref)"; |
|
181 | - if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); |
|
187 | + if ($mode == 1) { |
|
188 | + $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + order_ref)"; |
|
189 | + } |
|
190 | + if ($mode == 0) { |
|
191 | + $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); |
|
192 | + } |
|
182 | 193 | $out.=($mode?'</font>':''); |
183 | 194 | } |
184 | 195 | } |
185 | - } |
|
186 | - elseif ($type == 'invoice') |
|
196 | + } elseif ($type == 'invoice') |
|
187 | 197 | { |
188 | 198 | $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=invoice&ref='.($mode?'<font color="#666666">':''); |
189 | - if ($mode == 1) $out.='invoice_ref'; |
|
190 | - if ($mode == 0) $out.=urlencode($ref); |
|
199 | + if ($mode == 1) { |
|
200 | + $out.='invoice_ref'; |
|
201 | + } |
|
202 | + if ($mode == 0) { |
|
203 | + $out.=urlencode($ref); |
|
204 | + } |
|
191 | 205 | $out.=($mode?'</font>':''); |
192 | 206 | if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
193 | 207 | { |
194 | - if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
195 | - else |
|
208 | + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { |
|
209 | + $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
210 | + } else |
|
196 | 211 | { |
197 | 212 | $out.='&securekey='.($mode?'<font color="#666666">':''); |
198 | - if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + invoice_ref)"; |
|
199 | - if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); |
|
213 | + if ($mode == 1) { |
|
214 | + $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + invoice_ref)"; |
|
215 | + } |
|
216 | + if ($mode == 0) { |
|
217 | + $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); |
|
218 | + } |
|
200 | 219 | $out.=($mode?'</font>':''); |
201 | 220 | } |
202 | 221 | } |
203 | - } |
|
204 | - elseif ($type == 'contractline') |
|
222 | + } elseif ($type == 'contractline') |
|
205 | 223 | { |
206 | 224 | $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=contractline&ref='.($mode?'<font color="#666666">':''); |
207 | - if ($mode == 1) $out.='contractline_ref'; |
|
208 | - if ($mode == 0) $out.=urlencode($ref); |
|
225 | + if ($mode == 1) { |
|
226 | + $out.='contractline_ref'; |
|
227 | + } |
|
228 | + if ($mode == 0) { |
|
229 | + $out.=urlencode($ref); |
|
230 | + } |
|
209 | 231 | $out.=($mode?'</font>':''); |
210 | 232 | if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
211 | 233 | { |
212 | - if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
213 | - else |
|
234 | + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { |
|
235 | + $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
236 | + } else |
|
214 | 237 | { |
215 | 238 | $out.='&securekey='.($mode?'<font color="#666666">':''); |
216 | - if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + contractline_ref)"; |
|
217 | - if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); |
|
239 | + if ($mode == 1) { |
|
240 | + $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + contractline_ref)"; |
|
241 | + } |
|
242 | + if ($mode == 0) { |
|
243 | + $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); |
|
244 | + } |
|
218 | 245 | $out.=($mode?'</font>':''); |
219 | 246 | } |
220 | 247 | } |
221 | - } |
|
222 | - elseif ($type == 'member' || $type == 'membersubscription') |
|
248 | + } elseif ($type == 'member' || $type == 'membersubscription') |
|
223 | 249 | { |
224 | 250 | $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=membersubscription&ref='.($mode?'<font color="#666666">':''); |
225 | - if ($mode == 1) $out.='member_ref'; |
|
226 | - if ($mode == 0) $out.=urlencode($ref); |
|
251 | + if ($mode == 1) { |
|
252 | + $out.='member_ref'; |
|
253 | + } |
|
254 | + if ($mode == 0) { |
|
255 | + $out.=urlencode($ref); |
|
256 | + } |
|
227 | 257 | $out.=($mode?'</font>':''); |
228 | 258 | if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
229 | 259 | { |
230 | - if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
231 | - else |
|
260 | + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { |
|
261 | + $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
262 | + } else |
|
232 | 263 | { |
233 | 264 | $out.='&securekey='.($mode?'<font color="#666666">':''); |
234 | - if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + member_ref)"; |
|
235 | - if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); |
|
265 | + if ($mode == 1) { |
|
266 | + $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + member_ref)"; |
|
267 | + } |
|
268 | + if ($mode == 0) { |
|
269 | + $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); |
|
270 | + } |
|
236 | 271 | $out.=($mode?'</font>':''); |
237 | 272 | } |
238 | 273 | } |
@@ -240,24 +275,36 @@ discard block |
||
240 | 275 | if ($type == 'donation') |
241 | 276 | { |
242 | 277 | $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=donation&ref='.($mode?'<font color="#666666">':''); |
243 | - if ($mode == 1) $out.='donation_ref'; |
|
244 | - if ($mode == 0) $out.=urlencode($ref); |
|
278 | + if ($mode == 1) { |
|
279 | + $out.='donation_ref'; |
|
280 | + } |
|
281 | + if ($mode == 0) { |
|
282 | + $out.=urlencode($ref); |
|
283 | + } |
|
245 | 284 | $out.=($mode?'</font>':''); |
246 | 285 | if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) |
247 | 286 | { |
248 | - if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
249 | - else |
|
287 | + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { |
|
288 | + $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; |
|
289 | + } else |
|
250 | 290 | { |
251 | 291 | $out.='&securekey='.($mode?'<font color="#666666">':''); |
252 | - if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + donation_ref)"; |
|
253 | - if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); |
|
292 | + if ($mode == 1) { |
|
293 | + $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + donation_ref)"; |
|
294 | + } |
|
295 | + if ($mode == 0) { |
|
296 | + $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); |
|
297 | + } |
|
254 | 298 | $out.=($mode?'</font>':''); |
255 | 299 | } |
256 | 300 | } |
257 | 301 | } |
258 | 302 | |
259 | 303 | // For multicompany |
260 | - if (! empty($out) && ! empty($conf->multicompany->enabled)) $out.="&entity=".$conf->entity; // Check the entity because we may have the same reference in several entities |
|
304 | + if (! empty($out) && ! empty($conf->multicompany->enabled)) { |
|
305 | + $out.="&entity=".$conf->entity; |
|
306 | + } |
|
307 | + // Check the entity because we may have the same reference in several entities |
|
261 | 308 | |
262 | 309 | return $out; |
263 | 310 | } |
@@ -293,14 +340,18 @@ discard block |
||
293 | 340 | if ($fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || ! $fromcompany->idprof2)) |
294 | 341 | { |
295 | 342 | $field=$langs->transcountrynoentities("ProfId1",$fromcompany->country_code); |
296 | - if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1]; |
|
343 | + if (preg_match('/\((.*)\)/i',$field,$reg)) { |
|
344 | + $field=$reg[1]; |
|
345 | + } |
|
297 | 346 | $line1.=($line1?" - ":"").$field.": ".$fromcompany->idprof1; |
298 | 347 | } |
299 | 348 | // Prof Id 2 |
300 | 349 | if ($fromcompany->idprof2) |
301 | 350 | { |
302 | 351 | $field=$langs->transcountrynoentities("ProfId2",$fromcompany->country_code); |
303 | - if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1]; |
|
352 | + if (preg_match('/\((.*)\)/i',$field,$reg)) { |
|
353 | + $field=$reg[1]; |
|
354 | + } |
|
304 | 355 | $line1.=($line1?" - ":"").$field.": ".$fromcompany->idprof2; |
305 | 356 | } |
306 | 357 | |
@@ -310,14 +361,18 @@ discard block |
||
310 | 361 | if ($fromcompany->idprof3) |
311 | 362 | { |
312 | 363 | $field=$langs->transcountrynoentities("ProfId3",$fromcompany->country_code); |
313 | - if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1]; |
|
364 | + if (preg_match('/\((.*)\)/i',$field,$reg)) { |
|
365 | + $field=$reg[1]; |
|
366 | + } |
|
314 | 367 | $line2.=($line2?" - ":"").$field.": ".$fromcompany->idprof3; |
315 | 368 | } |
316 | 369 | // Prof Id 4 |
317 | 370 | if ($fromcompany->idprof4) |
318 | 371 | { |
319 | 372 | $field=$langs->transcountrynoentities("ProfId4",$fromcompany->country_code); |
320 | - if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1]; |
|
373 | + if (preg_match('/\((.*)\)/i',$field,$reg)) { |
|
374 | + $field=$reg[1]; |
|
375 | + } |
|
321 | 376 | $line2.=($line2?" - ":"").$field.": ".$fromcompany->idprof4; |
322 | 377 | } |
323 | 378 | // IntraCommunautary VAT |
@@ -335,23 +390,32 @@ discard block |
||
335 | 390 | print '<br>'; |
336 | 391 | |
337 | 392 | $parammessageform='ONLINE_PAYMENT_MESSAGE_FORM_'.$suffix; |
338 | - if (! empty($conf->global->$parammessageform)) print $langs->transnoentities($conf->global->$parammessageform); |
|
339 | - elseif (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_FORM)) print $langs->transnoentities($conf->global->ONLINE_PAYMENT_MESSAGE_FORM); |
|
393 | + if (! empty($conf->global->$parammessageform)) { |
|
394 | + print $langs->transnoentities($conf->global->$parammessageform); |
|
395 | + } elseif (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_FORM)) { |
|
396 | + print $langs->transnoentities($conf->global->ONLINE_PAYMENT_MESSAGE_FORM); |
|
397 | + } |
|
340 | 398 | |
341 | 399 | // Add other message if VAT exists |
342 | 400 | if ($object->total_vat != 0 || $object->total_tva != 0) |
343 | 401 | { |
344 | 402 | $parammessageform='ONLINE_PAYMENT_MESSAGE_FORMIFVAT_'.$suffix; |
345 | - if (! empty($conf->global->$parammessageform)) print $langs->transnoentities($conf->global->$parammessageform); |
|
346 | - elseif (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_FORMIFVAT)) print $langs->transnoentities($conf->global->ONLINE_PAYMENT_MESSAGE_FORMIFVAT); |
|
403 | + if (! empty($conf->global->$parammessageform)) { |
|
404 | + print $langs->transnoentities($conf->global->$parammessageform); |
|
405 | + } elseif (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_FORMIFVAT)) { |
|
406 | + print $langs->transnoentities($conf->global->ONLINE_PAYMENT_MESSAGE_FORMIFVAT); |
|
407 | + } |
|
347 | 408 | } |
348 | 409 | } |
349 | 410 | |
350 | 411 | print '<font style="font-size: 10px;"><br><hr>'."\n"; |
351 | 412 | print $fromcompany->name.'<br>'; |
352 | 413 | print $line1; |
353 | - if (strlen($line1.$line2) > 50) print '<br>'; |
|
354 | - else print ' - '; |
|
414 | + if (strlen($line1.$line2) > 50) { |
|
415 | + print '<br>'; |
|
416 | + } else { |
|
417 | + print ' - '; |
|
418 | + } |
|
355 | 419 | print $line2; |
356 | 420 | print '</font></div>'."\n"; |
357 | 421 | } |
@@ -28,41 +28,41 @@ discard block |
||
28 | 28 | */ |
29 | 29 | function asset_admin_prepare_head() |
30 | 30 | { |
31 | - global $langs, $conf; |
|
31 | + global $langs, $conf; |
|
32 | 32 | |
33 | - $langs->load("assets"); |
|
33 | + $langs->load("assets"); |
|
34 | 34 | |
35 | - $h = 0; |
|
36 | - $head = array(); |
|
35 | + $h = 0; |
|
36 | + $head = array(); |
|
37 | 37 | |
38 | - $head[$h][0] = DOL_URL_ROOT . '/asset/admin/setup.php'; |
|
39 | - $head[$h][1] = $langs->trans("Settings"); |
|
40 | - $head[$h][2] = 'settings'; |
|
41 | - $h++; |
|
38 | + $head[$h][0] = DOL_URL_ROOT . '/asset/admin/setup.php'; |
|
39 | + $head[$h][1] = $langs->trans("Settings"); |
|
40 | + $head[$h][2] = 'settings'; |
|
41 | + $h++; |
|
42 | 42 | |
43 | - // Show more tabs from modules |
|
44 | - // Entries must be declared in modules descriptor with line |
|
45 | - //$this->tabs = array( |
|
46 | - // 'entity:+tabname:Title:@assets:/asset/mypage.php?id=__ID__' |
|
47 | - //); // to add new tab |
|
48 | - //$this->tabs = array( |
|
49 | - // 'entity:-tabname:Title:@assets:/asset/mypage.php?id=__ID__' |
|
50 | - //); // to remove a tab |
|
51 | - complete_head_from_modules($conf, $langs, $object, $head, $h, 'assets_admin'); |
|
43 | + // Show more tabs from modules |
|
44 | + // Entries must be declared in modules descriptor with line |
|
45 | + //$this->tabs = array( |
|
46 | + // 'entity:+tabname:Title:@assets:/asset/mypage.php?id=__ID__' |
|
47 | + //); // to add new tab |
|
48 | + //$this->tabs = array( |
|
49 | + // 'entity:-tabname:Title:@assets:/asset/mypage.php?id=__ID__' |
|
50 | + //); // to remove a tab |
|
51 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'assets_admin'); |
|
52 | 52 | |
53 | - $head[$h][0] = DOL_URL_ROOT . '/asset/admin/assets_extrafields.php'; |
|
54 | - $head[$h][1] = $langs->trans("ExtraFields"); |
|
55 | - $head[$h][2] = 'attributes'; |
|
56 | - $h++; |
|
53 | + $head[$h][0] = DOL_URL_ROOT . '/asset/admin/assets_extrafields.php'; |
|
54 | + $head[$h][1] = $langs->trans("ExtraFields"); |
|
55 | + $head[$h][2] = 'attributes'; |
|
56 | + $h++; |
|
57 | 57 | |
58 | - $head[$h][0] = DOL_URL_ROOT . '/asset/admin/assets_type_extrafields.php'; |
|
59 | - $head[$h][1] = $langs->trans("ExtraFieldsAssetsType"); |
|
60 | - $head[$h][2] = 'attributes_type'; |
|
61 | - $h++; |
|
58 | + $head[$h][0] = DOL_URL_ROOT . '/asset/admin/assets_type_extrafields.php'; |
|
59 | + $head[$h][1] = $langs->trans("ExtraFieldsAssetsType"); |
|
60 | + $head[$h][2] = 'attributes_type'; |
|
61 | + $h++; |
|
62 | 62 | |
63 | - complete_head_from_modules($conf, $langs, $object, $head, $h, 'assets_admin', 'remove'); |
|
63 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'assets_admin', 'remove'); |
|
64 | 64 | |
65 | - return $head; |
|
65 | + return $head; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -72,56 +72,56 @@ discard block |
||
72 | 72 | */ |
73 | 73 | function asset_prepare_head() |
74 | 74 | { |
75 | - global $langs, $conf; |
|
76 | - |
|
77 | - $langs->load("assets"); |
|
78 | - |
|
79 | - $h = 0; |
|
80 | - $head = array(); |
|
81 | - |
|
82 | - $head[$h][0] = DOL_URL_ROOT . '/asset/card.php'; |
|
83 | - $head[$h][1] = $langs->trans("Card"); |
|
84 | - $head[$h][2] = 'card'; |
|
85 | - $h++; |
|
86 | - |
|
87 | - // Show more tabs from modules |
|
88 | - // Entries must be declared in modules descriptor with line |
|
89 | - //$this->tabs = array( |
|
90 | - // 'entity:+tabname:Title:@assets:/assets/mypage.php?id=__ID__' |
|
91 | - //); // to add new tab |
|
92 | - //$this->tabs = array( |
|
93 | - // 'entity:-tabname:Title:@assets:/assets/mypage.php?id=__ID__' |
|
94 | - //); // to remove a tab |
|
95 | - complete_head_from_modules($conf, $langs, $object, $head, $h, 'assets'); |
|
96 | - |
|
97 | - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
98 | - require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; |
|
99 | - $upload_dir = $conf->assets->dir_output . '/' . get_exdir($filename,2,0,1,$object,'assets'). '/'. dol_sanitizeFileName($object->ref); |
|
100 | - $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$')); |
|
101 | - $nbLinks=Link::count($db, $object->element, $object->id); |
|
102 | - $head[$h][0] = DOL_URL_ROOT.'/asset/document.php?id='.$object->id; |
|
103 | - $head[$h][1] = $langs->trans('Documents'); |
|
104 | - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
105 | - $head[$h][2] = 'documents'; |
|
106 | - $h++; |
|
107 | - |
|
108 | - $nbNote = 0; |
|
109 | - if(!empty($object->note_private)) $nbNote++; |
|
110 | - if(!empty($object->note_public)) $nbNote++; |
|
111 | - $head[$h][0] = DOL_URL_ROOT.'/asset/note.php?id='.$object->id; |
|
112 | - $head[$h][1] = $langs->trans("Notes"); |
|
113 | - if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
114 | - $head[$h][2] = 'note'; |
|
115 | - $h++; |
|
116 | - |
|
117 | - $head[$h][0] = DOL_URL_ROOT . '/asset/info.php?id=' . $object->id; |
|
118 | - $head[$h][1] = $langs->trans("Info"); |
|
119 | - $head[$h][2] = 'info'; |
|
120 | - $h++; |
|
121 | - |
|
122 | - complete_head_from_modules($conf, $langs, $object, $head, $h, 'asset', 'remove'); |
|
123 | - |
|
124 | - return $head; |
|
75 | + global $langs, $conf; |
|
76 | + |
|
77 | + $langs->load("assets"); |
|
78 | + |
|
79 | + $h = 0; |
|
80 | + $head = array(); |
|
81 | + |
|
82 | + $head[$h][0] = DOL_URL_ROOT . '/asset/card.php'; |
|
83 | + $head[$h][1] = $langs->trans("Card"); |
|
84 | + $head[$h][2] = 'card'; |
|
85 | + $h++; |
|
86 | + |
|
87 | + // Show more tabs from modules |
|
88 | + // Entries must be declared in modules descriptor with line |
|
89 | + //$this->tabs = array( |
|
90 | + // 'entity:+tabname:Title:@assets:/assets/mypage.php?id=__ID__' |
|
91 | + //); // to add new tab |
|
92 | + //$this->tabs = array( |
|
93 | + // 'entity:-tabname:Title:@assets:/assets/mypage.php?id=__ID__' |
|
94 | + //); // to remove a tab |
|
95 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'assets'); |
|
96 | + |
|
97 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
98 | + require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; |
|
99 | + $upload_dir = $conf->assets->dir_output . '/' . get_exdir($filename,2,0,1,$object,'assets'). '/'. dol_sanitizeFileName($object->ref); |
|
100 | + $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$')); |
|
101 | + $nbLinks=Link::count($db, $object->element, $object->id); |
|
102 | + $head[$h][0] = DOL_URL_ROOT.'/asset/document.php?id='.$object->id; |
|
103 | + $head[$h][1] = $langs->trans('Documents'); |
|
104 | + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
105 | + $head[$h][2] = 'documents'; |
|
106 | + $h++; |
|
107 | + |
|
108 | + $nbNote = 0; |
|
109 | + if(!empty($object->note_private)) $nbNote++; |
|
110 | + if(!empty($object->note_public)) $nbNote++; |
|
111 | + $head[$h][0] = DOL_URL_ROOT.'/asset/note.php?id='.$object->id; |
|
112 | + $head[$h][1] = $langs->trans("Notes"); |
|
113 | + if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
114 | + $head[$h][2] = 'note'; |
|
115 | + $h++; |
|
116 | + |
|
117 | + $head[$h][0] = DOL_URL_ROOT . '/asset/info.php?id=' . $object->id; |
|
118 | + $head[$h][1] = $langs->trans("Info"); |
|
119 | + $head[$h][2] = 'info'; |
|
120 | + $h++; |
|
121 | + |
|
122 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'asset', 'remove'); |
|
123 | + |
|
124 | + return $head; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
@@ -132,23 +132,23 @@ discard block |
||
132 | 132 | */ |
133 | 133 | function asset_type_prepare_head(AssetType $object) |
134 | 134 | { |
135 | - global $langs, $conf, $user; |
|
135 | + global $langs, $conf, $user; |
|
136 | 136 | |
137 | - $h=0; |
|
138 | - $head = array(); |
|
137 | + $h=0; |
|
138 | + $head = array(); |
|
139 | 139 | |
140 | - $head[$h][0] = DOL_URL_ROOT.'/asset/type.php?rowid='.$object->id; |
|
141 | - $head[$h][1] = $langs->trans("Card"); |
|
142 | - $head[$h][2] = 'card'; |
|
143 | - $h++; |
|
140 | + $head[$h][0] = DOL_URL_ROOT.'/asset/type.php?rowid='.$object->id; |
|
141 | + $head[$h][1] = $langs->trans("Card"); |
|
142 | + $head[$h][2] = 'card'; |
|
143 | + $h++; |
|
144 | 144 | |
145 | - // Show more tabs from modules |
|
146 | - // Entries must be declared in modules descriptor with line |
|
147 | - // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
|
148 | - // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab |
|
149 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'assettype'); |
|
145 | + // Show more tabs from modules |
|
146 | + // Entries must be declared in modules descriptor with line |
|
147 | + // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
|
148 | + // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab |
|
149 | + complete_head_from_modules($conf,$langs,$object,$head,$h,'assettype'); |
|
150 | 150 | |
151 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'assettype','remove'); |
|
151 | + complete_head_from_modules($conf,$langs,$object,$head,$h,'assettype','remove'); |
|
152 | 152 | |
153 | - return $head; |
|
153 | + return $head; |
|
154 | 154 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $h = 0; |
36 | 36 | $head = array(); |
37 | 37 | |
38 | - $head[$h][0] = DOL_URL_ROOT . '/asset/admin/setup.php'; |
|
38 | + $head[$h][0] = DOL_URL_ROOT.'/asset/admin/setup.php'; |
|
39 | 39 | $head[$h][1] = $langs->trans("Settings"); |
40 | 40 | $head[$h][2] = 'settings'; |
41 | 41 | $h++; |
@@ -50,12 +50,12 @@ discard block |
||
50 | 50 | //); // to remove a tab |
51 | 51 | complete_head_from_modules($conf, $langs, $object, $head, $h, 'assets_admin'); |
52 | 52 | |
53 | - $head[$h][0] = DOL_URL_ROOT . '/asset/admin/assets_extrafields.php'; |
|
53 | + $head[$h][0] = DOL_URL_ROOT.'/asset/admin/assets_extrafields.php'; |
|
54 | 54 | $head[$h][1] = $langs->trans("ExtraFields"); |
55 | 55 | $head[$h][2] = 'attributes'; |
56 | 56 | $h++; |
57 | 57 | |
58 | - $head[$h][0] = DOL_URL_ROOT . '/asset/admin/assets_type_extrafields.php'; |
|
58 | + $head[$h][0] = DOL_URL_ROOT.'/asset/admin/assets_type_extrafields.php'; |
|
59 | 59 | $head[$h][1] = $langs->trans("ExtraFieldsAssetsType"); |
60 | 60 | $head[$h][2] = 'attributes_type'; |
61 | 61 | $h++; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $h = 0; |
80 | 80 | $head = array(); |
81 | 81 | |
82 | - $head[$h][0] = DOL_URL_ROOT . '/asset/card.php'; |
|
82 | + $head[$h][0] = DOL_URL_ROOT.'/asset/card.php'; |
|
83 | 83 | $head[$h][1] = $langs->trans("Card"); |
84 | 84 | $head[$h][2] = 'card'; |
85 | 85 | $h++; |
@@ -96,25 +96,25 @@ discard block |
||
96 | 96 | |
97 | 97 | require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
98 | 98 | require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; |
99 | - $upload_dir = $conf->assets->dir_output . '/' . get_exdir($filename,2,0,1,$object,'assets'). '/'. dol_sanitizeFileName($object->ref); |
|
100 | - $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$')); |
|
101 | - $nbLinks=Link::count($db, $object->element, $object->id); |
|
99 | + $upload_dir = $conf->assets->dir_output.'/'.get_exdir($filename, 2, 0, 1, $object, 'assets').'/'.dol_sanitizeFileName($object->ref); |
|
100 | + $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); |
|
101 | + $nbLinks = Link::count($db, $object->element, $object->id); |
|
102 | 102 | $head[$h][0] = DOL_URL_ROOT.'/asset/document.php?id='.$object->id; |
103 | 103 | $head[$h][1] = $langs->trans('Documents'); |
104 | - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
104 | + if (($nbFiles + $nbLinks) > 0) $head[$h][1] .= ' <span class="badge">'.($nbFiles + $nbLinks).'</span>'; |
|
105 | 105 | $head[$h][2] = 'documents'; |
106 | 106 | $h++; |
107 | 107 | |
108 | 108 | $nbNote = 0; |
109 | - if(!empty($object->note_private)) $nbNote++; |
|
110 | - if(!empty($object->note_public)) $nbNote++; |
|
109 | + if (!empty($object->note_private)) $nbNote++; |
|
110 | + if (!empty($object->note_public)) $nbNote++; |
|
111 | 111 | $head[$h][0] = DOL_URL_ROOT.'/asset/note.php?id='.$object->id; |
112 | 112 | $head[$h][1] = $langs->trans("Notes"); |
113 | - if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
113 | + if ($nbNote > 0) $head[$h][1] .= ' <span class="badge">'.$nbNote.'</span>'; |
|
114 | 114 | $head[$h][2] = 'note'; |
115 | 115 | $h++; |
116 | 116 | |
117 | - $head[$h][0] = DOL_URL_ROOT . '/asset/info.php?id=' . $object->id; |
|
117 | + $head[$h][0] = DOL_URL_ROOT.'/asset/info.php?id='.$object->id; |
|
118 | 118 | $head[$h][1] = $langs->trans("Info"); |
119 | 119 | $head[$h][2] = 'info'; |
120 | 120 | $h++; |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | { |
135 | 135 | global $langs, $conf, $user; |
136 | 136 | |
137 | - $h=0; |
|
137 | + $h = 0; |
|
138 | 138 | $head = array(); |
139 | 139 | |
140 | 140 | $head[$h][0] = DOL_URL_ROOT.'/asset/type.php?rowid='.$object->id; |
@@ -146,9 +146,9 @@ discard block |
||
146 | 146 | // Entries must be declared in modules descriptor with line |
147 | 147 | // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
148 | 148 | // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab |
149 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'assettype'); |
|
149 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'assettype'); |
|
150 | 150 | |
151 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'assettype','remove'); |
|
151 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'assettype', 'remove'); |
|
152 | 152 | |
153 | 153 | return $head; |
154 | 154 | } |
@@ -101,16 +101,24 @@ |
||
101 | 101 | $nbLinks=Link::count($db, $object->element, $object->id); |
102 | 102 | $head[$h][0] = DOL_URL_ROOT.'/asset/document.php?id='.$object->id; |
103 | 103 | $head[$h][1] = $langs->trans('Documents'); |
104 | - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
104 | + if (($nbFiles+$nbLinks) > 0) { |
|
105 | + $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
106 | + } |
|
105 | 107 | $head[$h][2] = 'documents'; |
106 | 108 | $h++; |
107 | 109 | |
108 | 110 | $nbNote = 0; |
109 | - if(!empty($object->note_private)) $nbNote++; |
|
110 | - if(!empty($object->note_public)) $nbNote++; |
|
111 | + if(!empty($object->note_private)) { |
|
112 | + $nbNote++; |
|
113 | + } |
|
114 | + if(!empty($object->note_public)) { |
|
115 | + $nbNote++; |
|
116 | + } |
|
111 | 117 | $head[$h][0] = DOL_URL_ROOT.'/asset/note.php?id='.$object->id; |
112 | 118 | $head[$h][1] = $langs->trans("Notes"); |
113 | - if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
119 | + if ($nbNote > 0) { |
|
120 | + $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
121 | + } |
|
114 | 122 | $head[$h][2] = 'note'; |
115 | 123 | $h++; |
116 | 124 |
@@ -36,10 +36,10 @@ discard block |
||
36 | 36 | $tab = 0; |
37 | 37 | $head = array(); |
38 | 38 | |
39 | - $head[$tab][0] = DOL_URL_ROOT.'/compta/tva/card.php?id='.$object->id; |
|
40 | - $head[$tab][1] = $langs->trans('Card'); |
|
41 | - $head[$tab][2] = 'card'; |
|
42 | - $tab++; |
|
39 | + $head[$tab][0] = DOL_URL_ROOT.'/compta/tva/card.php?id='.$object->id; |
|
40 | + $head[$tab][1] = $langs->trans('Card'); |
|
41 | + $head[$tab][2] = 'card'; |
|
42 | + $tab++; |
|
43 | 43 | |
44 | 44 | // Show more tabs from modules |
45 | 45 | // Entries must be declared in modules descriptor with line |
@@ -47,16 +47,16 @@ discard block |
||
47 | 47 | // $this->tabs = array('entity:-tabname); to remove a tab |
48 | 48 | complete_head_from_modules($conf, $langs, $object, $head, $tab,'vat'); |
49 | 49 | |
50 | - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
50 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
51 | 51 | require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; |
52 | - $upload_dir = $conf->tax->dir_output . "/" . dol_sanitizeFileName($object->ref); |
|
53 | - $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$')); |
|
52 | + $upload_dir = $conf->tax->dir_output . "/" . dol_sanitizeFileName($object->ref); |
|
53 | + $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$')); |
|
54 | 54 | $nbLinks=Link::count($db, $object->element, $object->id); |
55 | - $head[$tab][0] = DOL_URL_ROOT.'/compta/tva/document.php?id='.$object->id; |
|
56 | - $head[$tab][1] = $langs->trans("Documents"); |
|
57 | - if (($nbFiles+$nbLinks) > 0) $head[$tab][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
58 | - $head[$tab][2] = 'documents'; |
|
59 | - $tab++; |
|
55 | + $head[$tab][0] = DOL_URL_ROOT.'/compta/tva/document.php?id='.$object->id; |
|
56 | + $head[$tab][1] = $langs->trans("Documents"); |
|
57 | + if (($nbFiles+$nbLinks) > 0) $head[$tab][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
58 | + $head[$tab][2] = 'documents'; |
|
59 | + $tab++; |
|
60 | 60 | |
61 | 61 | $head[$tab][0] = DOL_URL_ROOT.'/compta/tva/info.php?id='.$object->id; |
62 | 62 | $head[$tab][1] = $langs->trans("Info"); |
@@ -45,16 +45,16 @@ discard block |
||
45 | 45 | // Entries must be declared in modules descriptor with line |
46 | 46 | // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
47 | 47 | // $this->tabs = array('entity:-tabname); to remove a tab |
48 | - complete_head_from_modules($conf, $langs, $object, $head, $tab,'vat'); |
|
48 | + complete_head_from_modules($conf, $langs, $object, $head, $tab, 'vat'); |
|
49 | 49 | |
50 | 50 | require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
51 | 51 | require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; |
52 | - $upload_dir = $conf->tax->dir_output . "/" . dol_sanitizeFileName($object->ref); |
|
53 | - $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$')); |
|
54 | - $nbLinks=Link::count($db, $object->element, $object->id); |
|
52 | + $upload_dir = $conf->tax->dir_output."/".dol_sanitizeFileName($object->ref); |
|
53 | + $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); |
|
54 | + $nbLinks = Link::count($db, $object->element, $object->id); |
|
55 | 55 | $head[$tab][0] = DOL_URL_ROOT.'/compta/tva/document.php?id='.$object->id; |
56 | 56 | $head[$tab][1] = $langs->trans("Documents"); |
57 | - if (($nbFiles+$nbLinks) > 0) $head[$tab][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
57 | + if (($nbFiles + $nbLinks) > 0) $head[$tab][1] .= ' <span class="badge">'.($nbFiles + $nbLinks).'</span>'; |
|
58 | 58 | $head[$tab][2] = 'documents'; |
59 | 59 | $tab++; |
60 | 60 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $head[$tab][2] = 'info'; |
64 | 64 | $tab++; |
65 | 65 | |
66 | - complete_head_from_modules($conf,$langs,$object,$head,$tab,'vat','remove'); |
|
66 | + complete_head_from_modules($conf, $langs, $object, $head, $tab, 'vat', 'remove'); |
|
67 | 67 | |
68 | 68 | return $head; |
69 | 69 | } |
@@ -54,7 +54,9 @@ |
||
54 | 54 | $nbLinks=Link::count($db, $object->element, $object->id); |
55 | 55 | $head[$tab][0] = DOL_URL_ROOT.'/compta/tva/document.php?id='.$object->id; |
56 | 56 | $head[$tab][1] = $langs->trans("Documents"); |
57 | - if (($nbFiles+$nbLinks) > 0) $head[$tab][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
57 | + if (($nbFiles+$nbLinks) > 0) { |
|
58 | + $head[$tab][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
59 | + } |
|
58 | 60 | $head[$tab][2] = 'documents'; |
59 | 61 | $tab++; |
60 | 62 |
@@ -28,30 +28,30 @@ discard block |
||
28 | 28 | */ |
29 | 29 | function donation_admin_prepare_head() |
30 | 30 | { |
31 | - global $langs, $conf; |
|
31 | + global $langs, $conf; |
|
32 | 32 | |
33 | - $h = 0; |
|
34 | - $head = array(); |
|
33 | + $h = 0; |
|
34 | + $head = array(); |
|
35 | 35 | |
36 | - $head[$h][0] = DOL_URL_ROOT . '/don/admin/donation.php'; |
|
37 | - $head[$h][1] = $langs->trans("Miscellaneous"); |
|
38 | - $head[$h][2] = 'general'; |
|
39 | - $h ++; |
|
36 | + $head[$h][0] = DOL_URL_ROOT . '/don/admin/donation.php'; |
|
37 | + $head[$h][1] = $langs->trans("Miscellaneous"); |
|
38 | + $head[$h][2] = 'general'; |
|
39 | + $h ++; |
|
40 | 40 | |
41 | - // Show more tabs from modules |
|
42 | - // Entries must be declared in modules descriptor with line |
|
43 | - // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
|
44 | - // $this->tabs = array('entity:-tabname); to remove a tab |
|
45 | - complete_head_from_modules($conf, $langs, null, $head, $h, 'donation_admin'); |
|
41 | + // Show more tabs from modules |
|
42 | + // Entries must be declared in modules descriptor with line |
|
43 | + // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
|
44 | + // $this->tabs = array('entity:-tabname); to remove a tab |
|
45 | + complete_head_from_modules($conf, $langs, null, $head, $h, 'donation_admin'); |
|
46 | 46 | |
47 | - $head[$h][0] = DOL_URL_ROOT . '/don/admin/donation_extrafields.php'; |
|
48 | - $head[$h][1] = $langs->trans("ExtraFields"); |
|
47 | + $head[$h][0] = DOL_URL_ROOT . '/don/admin/donation_extrafields.php'; |
|
48 | + $head[$h][1] = $langs->trans("ExtraFields"); |
|
49 | 49 | $head[$h][2] = 'attributes'; |
50 | - $h++; |
|
50 | + $h++; |
|
51 | 51 | |
52 | - complete_head_from_modules($conf, $langs, null, $head, $h, 'donation_admin', 'remove'); |
|
52 | + complete_head_from_modules($conf, $langs, null, $head, $h, 'donation_admin', 'remove'); |
|
53 | 53 | |
54 | - return $head; |
|
54 | + return $head; |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -62,48 +62,48 @@ discard block |
||
62 | 62 | */ |
63 | 63 | function donation_prepare_head($object) |
64 | 64 | { |
65 | - global $db, $langs, $conf; |
|
65 | + global $db, $langs, $conf; |
|
66 | 66 | |
67 | - $h = 0; |
|
68 | - $head = array(); |
|
67 | + $h = 0; |
|
68 | + $head = array(); |
|
69 | 69 | |
70 | - $head[$h][0] = DOL_URL_ROOT . '/don/card.php?id=' . $object->id; |
|
71 | - $head[$h][1] = $langs->trans("Card"); |
|
72 | - $head[$h][2] = 'card'; |
|
73 | - $h ++; |
|
70 | + $head[$h][0] = DOL_URL_ROOT . '/don/card.php?id=' . $object->id; |
|
71 | + $head[$h][1] = $langs->trans("Card"); |
|
72 | + $head[$h][2] = 'card'; |
|
73 | + $h ++; |
|
74 | 74 | |
75 | - // Show more tabs from modules |
|
76 | - // Entries must be declared in modules descriptor with line |
|
77 | - // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
|
78 | - // $this->tabs = array('entity:-tabname); to remove a tab |
|
79 | - complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation'); |
|
75 | + // Show more tabs from modules |
|
76 | + // Entries must be declared in modules descriptor with line |
|
77 | + // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
|
78 | + // $this->tabs = array('entity:-tabname); to remove a tab |
|
79 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation'); |
|
80 | 80 | |
81 | - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
81 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
82 | 82 | require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; |
83 | - $upload_dir = $conf->don->dir_output . '/' . get_exdir($filename,2,0,1,$object,'donation'). '/'. dol_sanitizeFileName($object->ref); |
|
84 | - $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$')); |
|
83 | + $upload_dir = $conf->don->dir_output . '/' . get_exdir($filename,2,0,1,$object,'donation'). '/'. dol_sanitizeFileName($object->ref); |
|
84 | + $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$')); |
|
85 | 85 | $nbLinks=Link::count($db, $object->element, $object->id); |
86 | - $head[$h][0] = DOL_URL_ROOT.'/don/document.php?id='.$object->id; |
|
87 | - $head[$h][1] = $langs->trans('Documents'); |
|
88 | - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
89 | - $head[$h][2] = 'documents'; |
|
90 | - $h++; |
|
86 | + $head[$h][0] = DOL_URL_ROOT.'/don/document.php?id='.$object->id; |
|
87 | + $head[$h][1] = $langs->trans('Documents'); |
|
88 | + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
89 | + $head[$h][2] = 'documents'; |
|
90 | + $h++; |
|
91 | 91 | |
92 | - $nbNote = 0; |
|
93 | - if(!empty($object->note_private)) $nbNote++; |
|
94 | - if(!empty($object->note_public)) $nbNote++; |
|
95 | - $head[$h][0] = DOL_URL_ROOT.'/don/note.php?id='.$object->id; |
|
96 | - $head[$h][1] = $langs->trans("Notes"); |
|
97 | - if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
98 | - $head[$h][2] = 'note'; |
|
99 | - $h++; |
|
92 | + $nbNote = 0; |
|
93 | + if(!empty($object->note_private)) $nbNote++; |
|
94 | + if(!empty($object->note_public)) $nbNote++; |
|
95 | + $head[$h][0] = DOL_URL_ROOT.'/don/note.php?id='.$object->id; |
|
96 | + $head[$h][1] = $langs->trans("Notes"); |
|
97 | + if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
98 | + $head[$h][2] = 'note'; |
|
99 | + $h++; |
|
100 | 100 | |
101 | - $head[$h][0] = DOL_URL_ROOT . '/don/info.php?id=' . $object->id; |
|
102 | - $head[$h][1] = $langs->trans("Info"); |
|
103 | - $head[$h][2] = 'info'; |
|
104 | - $h++; |
|
101 | + $head[$h][0] = DOL_URL_ROOT . '/don/info.php?id=' . $object->id; |
|
102 | + $head[$h][1] = $langs->trans("Info"); |
|
103 | + $head[$h][2] = 'info'; |
|
104 | + $h++; |
|
105 | 105 | |
106 | - complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation', 'remove'); |
|
106 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation', 'remove'); |
|
107 | 107 | |
108 | - return $head; |
|
108 | + return $head; |
|
109 | 109 | } |
@@ -33,10 +33,10 @@ discard block |
||
33 | 33 | $h = 0; |
34 | 34 | $head = array(); |
35 | 35 | |
36 | - $head[$h][0] = DOL_URL_ROOT . '/don/admin/donation.php'; |
|
36 | + $head[$h][0] = DOL_URL_ROOT.'/don/admin/donation.php'; |
|
37 | 37 | $head[$h][1] = $langs->trans("Miscellaneous"); |
38 | 38 | $head[$h][2] = 'general'; |
39 | - $h ++; |
|
39 | + $h++; |
|
40 | 40 | |
41 | 41 | // Show more tabs from modules |
42 | 42 | // Entries must be declared in modules descriptor with line |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | // $this->tabs = array('entity:-tabname); to remove a tab |
45 | 45 | complete_head_from_modules($conf, $langs, null, $head, $h, 'donation_admin'); |
46 | 46 | |
47 | - $head[$h][0] = DOL_URL_ROOT . '/don/admin/donation_extrafields.php'; |
|
47 | + $head[$h][0] = DOL_URL_ROOT.'/don/admin/donation_extrafields.php'; |
|
48 | 48 | $head[$h][1] = $langs->trans("ExtraFields"); |
49 | 49 | $head[$h][2] = 'attributes'; |
50 | 50 | $h++; |
@@ -67,10 +67,10 @@ discard block |
||
67 | 67 | $h = 0; |
68 | 68 | $head = array(); |
69 | 69 | |
70 | - $head[$h][0] = DOL_URL_ROOT . '/don/card.php?id=' . $object->id; |
|
70 | + $head[$h][0] = DOL_URL_ROOT.'/don/card.php?id='.$object->id; |
|
71 | 71 | $head[$h][1] = $langs->trans("Card"); |
72 | 72 | $head[$h][2] = 'card'; |
73 | - $h ++; |
|
73 | + $h++; |
|
74 | 74 | |
75 | 75 | // Show more tabs from modules |
76 | 76 | // Entries must be declared in modules descriptor with line |
@@ -80,25 +80,25 @@ discard block |
||
80 | 80 | |
81 | 81 | require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
82 | 82 | require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; |
83 | - $upload_dir = $conf->don->dir_output . '/' . get_exdir($filename,2,0,1,$object,'donation'). '/'. dol_sanitizeFileName($object->ref); |
|
84 | - $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$')); |
|
85 | - $nbLinks=Link::count($db, $object->element, $object->id); |
|
83 | + $upload_dir = $conf->don->dir_output.'/'.get_exdir($filename, 2, 0, 1, $object, 'donation').'/'.dol_sanitizeFileName($object->ref); |
|
84 | + $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); |
|
85 | + $nbLinks = Link::count($db, $object->element, $object->id); |
|
86 | 86 | $head[$h][0] = DOL_URL_ROOT.'/don/document.php?id='.$object->id; |
87 | 87 | $head[$h][1] = $langs->trans('Documents'); |
88 | - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
88 | + if (($nbFiles + $nbLinks) > 0) $head[$h][1] .= ' <span class="badge">'.($nbFiles + $nbLinks).'</span>'; |
|
89 | 89 | $head[$h][2] = 'documents'; |
90 | 90 | $h++; |
91 | 91 | |
92 | 92 | $nbNote = 0; |
93 | - if(!empty($object->note_private)) $nbNote++; |
|
94 | - if(!empty($object->note_public)) $nbNote++; |
|
93 | + if (!empty($object->note_private)) $nbNote++; |
|
94 | + if (!empty($object->note_public)) $nbNote++; |
|
95 | 95 | $head[$h][0] = DOL_URL_ROOT.'/don/note.php?id='.$object->id; |
96 | 96 | $head[$h][1] = $langs->trans("Notes"); |
97 | - if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
97 | + if ($nbNote > 0) $head[$h][1] .= ' <span class="badge">'.$nbNote.'</span>'; |
|
98 | 98 | $head[$h][2] = 'note'; |
99 | 99 | $h++; |
100 | 100 | |
101 | - $head[$h][0] = DOL_URL_ROOT . '/don/info.php?id=' . $object->id; |
|
101 | + $head[$h][0] = DOL_URL_ROOT.'/don/info.php?id='.$object->id; |
|
102 | 102 | $head[$h][1] = $langs->trans("Info"); |
103 | 103 | $head[$h][2] = 'info'; |
104 | 104 | $h++; |
@@ -85,16 +85,24 @@ |
||
85 | 85 | $nbLinks=Link::count($db, $object->element, $object->id); |
86 | 86 | $head[$h][0] = DOL_URL_ROOT.'/don/document.php?id='.$object->id; |
87 | 87 | $head[$h][1] = $langs->trans('Documents'); |
88 | - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
88 | + if (($nbFiles+$nbLinks) > 0) { |
|
89 | + $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
90 | + } |
|
89 | 91 | $head[$h][2] = 'documents'; |
90 | 92 | $h++; |
91 | 93 | |
92 | 94 | $nbNote = 0; |
93 | - if(!empty($object->note_private)) $nbNote++; |
|
94 | - if(!empty($object->note_public)) $nbNote++; |
|
95 | + if(!empty($object->note_private)) { |
|
96 | + $nbNote++; |
|
97 | + } |
|
98 | + if(!empty($object->note_public)) { |
|
99 | + $nbNote++; |
|
100 | + } |
|
95 | 101 | $head[$h][0] = DOL_URL_ROOT.'/don/note.php?id='.$object->id; |
96 | 102 | $head[$h][1] = $langs->trans("Notes"); |
97 | - if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
103 | + if ($nbNote > 0) { |
|
104 | + $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
105 | + } |
|
98 | 106 | $head[$h][2] = 'note'; |
99 | 107 | $h++; |
100 | 108 |
@@ -29,33 +29,33 @@ |
||
29 | 29 | */ |
30 | 30 | function trip_prepare_head(Deplacement $object) |
31 | 31 | { |
32 | - global $langs, $conf; |
|
32 | + global $langs, $conf; |
|
33 | 33 | |
34 | - $h = 0; |
|
35 | - $head = array(); |
|
34 | + $h = 0; |
|
35 | + $head = array(); |
|
36 | 36 | |
37 | - $head[$h][0] = DOL_URL_ROOT . '/compta/deplacement/card.php?id=' . $object->id; |
|
38 | - $head[$h][1] = $langs->trans("Card"); |
|
39 | - $head[$h][2] = 'card'; |
|
40 | - $h++; |
|
37 | + $head[$h][0] = DOL_URL_ROOT . '/compta/deplacement/card.php?id=' . $object->id; |
|
38 | + $head[$h][1] = $langs->trans("Card"); |
|
39 | + $head[$h][2] = 'card'; |
|
40 | + $h++; |
|
41 | 41 | |
42 | - // Show more tabs from modules |
|
43 | - // Entries must be declared in modules descriptor with line |
|
42 | + // Show more tabs from modules |
|
43 | + // Entries must be declared in modules descriptor with line |
|
44 | 44 | // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
45 | 45 | // $this->tabs = array('entity:-tabname); to remove a tab |
46 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'trip'); |
|
46 | + complete_head_from_modules($conf,$langs,$object,$head,$h,'trip'); |
|
47 | 47 | |
48 | - $head[$h][0] = DOL_URL_ROOT.'/compta/deplacement/document.php?id='.$object->id; |
|
49 | - $head[$h][1] = $langs->trans("Documents"); |
|
50 | - $head[$h][2] = 'documents'; |
|
51 | - $h++; |
|
48 | + $head[$h][0] = DOL_URL_ROOT.'/compta/deplacement/document.php?id='.$object->id; |
|
49 | + $head[$h][1] = $langs->trans("Documents"); |
|
50 | + $head[$h][2] = 'documents'; |
|
51 | + $h++; |
|
52 | 52 | |
53 | - $head[$h][0] = DOL_URL_ROOT . '/compta/deplacement/info.php?id=' . $object->id; |
|
54 | - $head[$h][1] = $langs->trans("Info"); |
|
55 | - $head[$h][2] = 'info'; |
|
56 | - $h++; |
|
53 | + $head[$h][0] = DOL_URL_ROOT . '/compta/deplacement/info.php?id=' . $object->id; |
|
54 | + $head[$h][1] = $langs->trans("Info"); |
|
55 | + $head[$h][2] = 'info'; |
|
56 | + $h++; |
|
57 | 57 | |
58 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'trip','remove'); |
|
58 | + complete_head_from_modules($conf,$langs,$object,$head,$h,'trip','remove'); |
|
59 | 59 | |
60 | - return $head; |
|
60 | + return $head; |
|
61 | 61 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $h = 0; |
35 | 35 | $head = array(); |
36 | 36 | |
37 | - $head[$h][0] = DOL_URL_ROOT . '/compta/deplacement/card.php?id=' . $object->id; |
|
37 | + $head[$h][0] = DOL_URL_ROOT.'/compta/deplacement/card.php?id='.$object->id; |
|
38 | 38 | $head[$h][1] = $langs->trans("Card"); |
39 | 39 | $head[$h][2] = 'card'; |
40 | 40 | $h++; |
@@ -43,19 +43,19 @@ discard block |
||
43 | 43 | // Entries must be declared in modules descriptor with line |
44 | 44 | // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab |
45 | 45 | // $this->tabs = array('entity:-tabname); to remove a tab |
46 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'trip'); |
|
46 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'trip'); |
|
47 | 47 | |
48 | 48 | $head[$h][0] = DOL_URL_ROOT.'/compta/deplacement/document.php?id='.$object->id; |
49 | 49 | $head[$h][1] = $langs->trans("Documents"); |
50 | 50 | $head[$h][2] = 'documents'; |
51 | 51 | $h++; |
52 | 52 | |
53 | - $head[$h][0] = DOL_URL_ROOT . '/compta/deplacement/info.php?id=' . $object->id; |
|
53 | + $head[$h][0] = DOL_URL_ROOT.'/compta/deplacement/info.php?id='.$object->id; |
|
54 | 54 | $head[$h][1] = $langs->trans("Info"); |
55 | 55 | $head[$h][2] = 'info'; |
56 | 56 | $h++; |
57 | 57 | |
58 | - complete_head_from_modules($conf,$langs,$object,$head,$h,'trip','remove'); |
|
58 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'trip', 'remove'); |
|
59 | 59 | |
60 | 60 | return $head; |
61 | 61 | } |