@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | |
204 | 204 | if (getDolGlobalString('EVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE')) { |
205 | 205 | print '<div class="backimagepubliceventorganizationsubscription">'; |
206 | - print '<img id="idEVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE" src="' . getDolGlobalString('EVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE').'">'; |
|
206 | + print '<img id="idEVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE" src="'.getDolGlobalString('EVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE').'">'; |
|
207 | 207 | print '</div>'; |
208 | 208 | } |
209 | 209 | |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | } |
242 | 242 | |
243 | 243 | // Action called when page is submitted |
244 | -if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conference->status == 2 || !empty($project->id) && $project->status == Project::STATUS_VALIDATED)) { // Test on permission not required. Check are done on securitykey and mitigation |
|
244 | +if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conference->status == 2 || !empty($project->id) && $project->status == Project::STATUS_VALIDATED)) { // Test on permission not required. Check are done on securitykey and mitigation |
|
245 | 245 | $error = 0; |
246 | 246 | |
247 | 247 | $urlback = ''; |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | |
350 | 350 | // If the registration has already been paid for this attendee |
351 | 351 | if (!empty($confattendee->date_subscription) && !empty($confattendee->amount)) { |
352 | - $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, 'master'); |
|
352 | + $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY').'conferenceorbooth'.$id, 'master'); |
|
353 | 353 | $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.((int) $id).'&securekey='.urlencode($securekeyurl); |
354 | 354 | |
355 | 355 | $mesg = $langs->trans("RegistrationAndPaymentWereAlreadyRecorded", $email); |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | |
364 | 364 | $resultfetchthirdparty = 0; |
365 | 365 | |
366 | - $genericcompanyname = $langs->trans('EventParticipant').' '.($emailcompany ? $emailcompany : $email); // Keep this label simple so we can retrieve same thirdparty for another event |
|
366 | + $genericcompanyname = $langs->trans('EventParticipant').' '.($emailcompany ? $emailcompany : $email); // Keep this label simple so we can retrieve same thirdparty for another event |
|
367 | 367 | |
368 | 368 | // Getting the thirdparty or creating it |
369 | 369 | $thirdparty = new Societe($db); |
@@ -619,7 +619,7 @@ discard block |
||
619 | 619 | $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.urlencode((string) ($sourcetouse)).'&ref='.urlencode((string) ($reftouse)); |
620 | 620 | if (getDolGlobalString('PAYMENT_SECURITY_TOKEN')) { |
621 | 621 | if (getDolGlobalString('PAYMENT_SECURITY_TOKEN_UNIQUE')) { |
622 | - $redirection .= '&securekey='.dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $sourcetouse . $reftouse, '2'); // Use the source in the hash to avoid duplicates if the references are identical |
|
622 | + $redirection .= '&securekey='.dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN').$sourcetouse.$reftouse, '2'); // Use the source in the hash to avoid duplicates if the references are identical |
|
623 | 623 | } else { |
624 | 624 | $redirection .= '&securekey='.urlencode(getDolGlobalString('PAYMENT_SECURITY_TOKEN')); |
625 | 625 | } |
@@ -680,7 +680,7 @@ discard block |
||
680 | 680 | dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); |
681 | 681 | } |
682 | 682 | |
683 | - $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, '2'); |
|
683 | + $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY').'conferenceorbooth'.$id, '2'); |
|
684 | 684 | $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.((int) $id).'&securekey='.urlencode($securekeyurl); |
685 | 685 | |
686 | 686 | header("Location: ".$redirection); |
@@ -714,7 +714,7 @@ discard block |
||
714 | 714 | print '<span class="opacitymedium">'.$langs->trans("EvntOrgWelcomeMessage").'</span>'; |
715 | 715 | print '<br>'; |
716 | 716 | // Title |
717 | -print '<span class="eventlabel large">'.dol_escape_htmltag($project->title . ' '. $conference->label).'</span><br>'; |
|
717 | +print '<span class="eventlabel large">'.dol_escape_htmltag($project->title.' '.$conference->label).'</span><br>'; |
|
718 | 718 | print '</div>'; |
719 | 719 | |
720 | 720 | // Help text |
@@ -772,7 +772,7 @@ discard block |
||
772 | 772 | print ' - '; |
773 | 773 | print dol_print_date($project->date_end); |
774 | 774 | }*/ |
775 | - $maxattendees = $project->max_attendees; // Max attendeed for the project/event |
|
775 | + $maxattendees = $project->max_attendees; // Max attendeed for the project/event |
|
776 | 776 | } |
777 | 777 | |
778 | 778 | if ($maxattendees && $currentnbofattendees >= $maxattendees) { |
@@ -788,14 +788,14 @@ discard block |
||
788 | 788 | if ((!empty($conference->id) && $conference->status == ConferenceOrBooth::STATUS_CONFIRMED) || (!empty($project->id) && $project->status == Project::STATUS_VALIDATED)) { |
789 | 789 | if (empty($maxattendees) || $currentnbofattendees < $maxattendees) { |
790 | 790 | // Print form |
791 | - print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="newmember">' . "\n"; |
|
792 | - print '<input type="hidden" name="token" value="' . newToken() . '" / >'; |
|
793 | - print '<input type="hidden" name="entity" value="' . $entity . '" />'; |
|
791 | + print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="newmember">'."\n"; |
|
792 | + print '<input type="hidden" name="token" value="'.newToken().'" / >'; |
|
793 | + print '<input type="hidden" name="entity" value="'.$entity.'" />'; |
|
794 | 794 | print '<input type="hidden" name="action" value="add" />'; |
795 | - print '<input type="hidden" name="type" value="' . $type . '" />'; |
|
796 | - print '<input type="hidden" name="id" value="' . $conference->id . '" />'; |
|
797 | - print '<input type="hidden" name="fk_project" value="' . $project->id . '" />'; |
|
798 | - print '<input type="hidden" name="securekey" value="' . $securekeyreceived . '" />'; |
|
795 | + print '<input type="hidden" name="type" value="'.$type.'" />'; |
|
796 | + print '<input type="hidden" name="id" value="'.$conference->id.'" />'; |
|
797 | + print '<input type="hidden" name="fk_project" value="'.$project->id.'" />'; |
|
798 | + print '<input type="hidden" name="securekey" value="'.$securekeyreceived.'" />'; |
|
799 | 799 | |
800 | 800 | print '<br>'; |
801 | 801 | print '<br>'; |
@@ -815,24 +815,24 @@ discard block |
||
815 | 815 | }); |
816 | 816 | </script>'; |
817 | 817 | |
818 | - print '<table class="border" summary="form to subscribe" id="tablesubscribe">' . "\n"; |
|
818 | + print '<table class="border" summary="form to subscribe" id="tablesubscribe">'."\n"; |
|
819 | 819 | |
820 | 820 | // Firstname |
821 | 821 | print '<tr><td><span class="fieldrequired">'; |
822 | - print $langs->trans("Firstname") . '</span></td><td>'; |
|
822 | + print $langs->trans("Firstname").'</span></td><td>'; |
|
823 | 823 | print img_picto('', 'user', 'class="pictofixedwidth"'); |
824 | - print '<input type="text" name="firstname" maxlength="255" class="minwidth200 maxwidth300" value="' . dol_escape_htmltag($firstname) . '" required autofocus></td></tr>' . "\n"; |
|
824 | + print '<input type="text" name="firstname" maxlength="255" class="minwidth200 maxwidth300" value="'.dol_escape_htmltag($firstname).'" required autofocus></td></tr>'."\n"; |
|
825 | 825 | |
826 | 826 | // Lastname |
827 | 827 | print '<tr><td><span class="fieldrequired">'; |
828 | - print $langs->trans("Lastname") . '</span></td><td>'; |
|
828 | + print $langs->trans("Lastname").'</span></td><td>'; |
|
829 | 829 | print img_picto('', 'user', 'class="pictofixedwidth"'); |
830 | - print '<input type="text" name="lastname" maxlength="255" class="minwidth200 maxwidth300" value="' . dol_escape_htmltag($lastname) . '" required></td></tr>' . "\n"; |
|
830 | + print '<input type="text" name="lastname" maxlength="255" class="minwidth200 maxwidth300" value="'.dol_escape_htmltag($lastname).'" required></td></tr>'."\n"; |
|
831 | 831 | |
832 | 832 | |
833 | - print '<tr><td><span class="fieldrequired">' . $langs->trans("EmailAttendee") . '</span></td><td>'; |
|
833 | + print '<tr><td><span class="fieldrequired">'.$langs->trans("EmailAttendee").'</span></td><td>'; |
|
834 | 834 | print img_picto('', 'email', 'class="pictofixedwidth"'); |
835 | - print '<input type="text" name="email" maxlength="255" class="minwidth200 widthcentpercentminusx maxwidth300" value="' . dol_escape_htmltag(GETPOST('email')) . '" required></td></tr>' . "\n"; |
|
835 | + print '<input type="text" name="email" maxlength="255" class="minwidth200 widthcentpercentminusx maxwidth300" value="'.dol_escape_htmltag(GETPOST('email')).'" required></td></tr>'."\n"; |
|
836 | 836 | |
837 | 837 | // Company |
838 | 838 | print '<tr id="trcompany" class="trcompany"><td>'; |
@@ -845,21 +845,21 @@ discard block |
||
845 | 845 | } |
846 | 846 | print '</td><td>'; |
847 | 847 | print img_picto('', 'company', 'class="pictofixedwidth"'); |
848 | - print '<input type="text" name="societe" class="minwidth200 widthcentpercentminusx maxwidth300" value="' . dol_escape_htmltag(GETPOST('societe')) . '"'.(empty((float) $project->price_registration) ? '' : ' required').'></td></tr>' . "\n"; |
|
848 | + print '<input type="text" name="societe" class="minwidth200 widthcentpercentminusx maxwidth300" value="'.dol_escape_htmltag(GETPOST('societe')).'"'.(empty((float) $project->price_registration) ? '' : ' required').'></td></tr>'."\n"; |
|
849 | 849 | |
850 | 850 | // Email company for invoice |
851 | 851 | if ($project->price_registration) { |
852 | - print '<tr><td>' . $form->textwithpicto($langs->trans("EmailCompany"), $langs->trans("EmailCompanyForInvoice")) . '</td><td>'; |
|
852 | + print '<tr><td>'.$form->textwithpicto($langs->trans("EmailCompany"), $langs->trans("EmailCompanyForInvoice")).'</td><td>'; |
|
853 | 853 | print img_picto('', 'email', 'class="pictofixedwidth"'); |
854 | - print '<input type="text" name="emailcompany" maxlength="255" class="minwidth200 widthcentpercentminusx maxwidth300" value="' . dol_escape_htmltag(GETPOST('emailcompany')) . '"></td></tr>' . "\n"; |
|
854 | + print '<input type="text" name="emailcompany" maxlength="255" class="minwidth200 widthcentpercentminusx maxwidth300" value="'.dol_escape_htmltag(GETPOST('emailcompany')).'"></td></tr>'."\n"; |
|
855 | 855 | } |
856 | 856 | |
857 | 857 | // Address |
858 | - print '<tr><td>' . $langs->trans("Address") . '</td><td>' . "\n"; |
|
859 | - print '<textarea name="address" id="address" wrap="soft" class="centpercent" rows="' . ROWS_2 . '">' . dol_escape_htmltag(GETPOST('address', 'restricthtml'), 0, 1) . '</textarea></td></tr>' . "\n"; |
|
858 | + print '<tr><td>'.$langs->trans("Address").'</td><td>'."\n"; |
|
859 | + print '<textarea name="address" id="address" wrap="soft" class="centpercent" rows="'.ROWS_2.'">'.dol_escape_htmltag(GETPOST('address', 'restricthtml'), 0, 1).'</textarea></td></tr>'."\n"; |
|
860 | 860 | |
861 | 861 | // Zip / Town |
862 | - print '<tr><td>' . $langs->trans('Zip') . ' / ' . $langs->trans('Town') . '</td><td>'; |
|
862 | + print '<tr><td>'.$langs->trans('Zip').' / '.$langs->trans('Town').'</td><td>'; |
|
863 | 863 | print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); |
864 | 864 | print ' / '; |
865 | 865 | print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); |
@@ -888,7 +888,7 @@ discard block |
||
888 | 888 | print '</td></tr>'; |
889 | 889 | // State |
890 | 890 | if (!getDolGlobalString('SOCIETE_DISABLE_STATE')) { |
891 | - print '<tr><td>' . $langs->trans('State') . '</td><td>'; |
|
891 | + print '<tr><td>'.$langs->trans('State').'</td><td>'; |
|
892 | 892 | if ($country_code) { |
893 | 893 | print img_picto('', 'state', 'class="pictofixedwidth"'); |
894 | 894 | print $formcompany->select_state(GETPOST("state_id"), $country_code); |
@@ -899,17 +899,17 @@ discard block |
||
899 | 899 | } |
900 | 900 | |
901 | 901 | if ($project->price_registration) { |
902 | - print '<tr><td>' . $langs->trans('Price') . '</td><td>'; |
|
902 | + print '<tr><td>'.$langs->trans('Price').'</td><td>'; |
|
903 | 903 | print '<span class="amount price-registration">'.price($project->price_registration, 1, $langs, 1, -1, -1, $conf->currency).'</span>'; |
904 | 904 | print '</td></tr>'; |
905 | 905 | } |
906 | 906 | |
907 | 907 | // Other attributes |
908 | - $parameters['tpl_context'] = 'public'; // define template context to public |
|
908 | + $parameters['tpl_context'] = 'public'; // define template context to public |
|
909 | 909 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; |
910 | 910 | |
911 | 911 | $notetoshow = $note_public; |
912 | - print '<tr><td>' . $langs->trans('Note') . '</td><td>'; |
|
912 | + print '<tr><td>'.$langs->trans('Note').'</td><td>'; |
|
913 | 913 | if (getDolGlobalString('EVENTORGANIZATION_DEFAULT_NOTE_ON_REGISTRATION')) { |
914 | 914 | $notetoshow = str_replace('\n', "\n", getDolGlobalString('EVENTORGANIZATION_DEFAULT_NOTE_ON_REGISTRATION')); |
915 | 915 | } |
@@ -924,9 +924,9 @@ discard block |
||
924 | 924 | |
925 | 925 | // Save |
926 | 926 | print '<div class="center">'; |
927 | - print '<input type="submit" value="' . $langs->trans("Submit") . '" id="submitsave" class="button">'; |
|
927 | + print '<input type="submit" value="'.$langs->trans("Submit").'" id="submitsave" class="button">'; |
|
928 | 928 | if (!empty($backtopage)) { |
929 | - print ' <input type="submit" value="' . $langs->trans("Cancel") . '" id="submitcancel" class="button button-cancel">'; |
|
929 | + print ' <input type="submit" value="'.$langs->trans("Cancel").'" id="submitcancel" class="button button-cancel">'; |
|
930 | 930 | } |
931 | 931 | print '</div>'; |
932 | 932 |
@@ -53,16 +53,16 @@ discard block |
||
53 | 53 | |
54 | 54 | // Load Dolibarr environment |
55 | 55 | require '../../main.inc.php'; |
56 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
57 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/payments.lib.php'; |
|
58 | -require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
59 | -require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent_type.class.php'; |
|
60 | -require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; |
|
61 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
62 | -require_once DOL_DOCUMENT_ROOT . '/core/class/cunits.class.php'; |
|
63 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
64 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formadmin.class.php'; |
|
65 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/public.lib.php'; |
|
56 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
57 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; |
|
58 | +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
59 | +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; |
|
60 | +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; |
|
61 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
62 | +require_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php'; |
|
63 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
64 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; |
|
65 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/public.lib.php'; |
|
66 | 66 | // Init vars |
67 | 67 | $backtopage = GETPOST('backtopage', 'alpha'); |
68 | 68 | $action = GETPOST('action', 'aZ09'); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | //permissions |
88 | 88 | |
89 | -$permissiontoadd = $user->hasRight('societe', 'creer'); |
|
89 | +$permissiontoadd = $user->hasRight('societe', 'creer'); |
|
90 | 90 | |
91 | 91 | // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context |
92 | 92 | $hookmanager->initHooks(array('publicnewmembercard', 'globalcard')); |
@@ -119,14 +119,14 @@ discard block |
||
119 | 119 | print '<body id="mainbody" class="publicnewmemberform">'; |
120 | 120 | |
121 | 121 | // Define urllogo |
122 | - $urllogo = DOL_URL_ROOT . '/theme/common/login_logo.png'; |
|
123 | - |
|
124 | - if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output . '/logos/thumbs/' . $mysoc->logo_small)) { |
|
125 | - $urllogo = DOL_URL_ROOT . '/viewimage.php?cache=1&modulepart=mycompany&file=' . urlencode('logos/thumbs/' . $mysoc->logo_small); |
|
126 | - } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output . '/logos/' . $mysoc->logo)) { |
|
127 | - $urllogo = DOL_URL_ROOT . '/viewimage.php?cache=1&modulepart=mycompany&file=' . urlencode('logos/' . $mysoc->logo); |
|
128 | - } elseif (is_readable(DOL_DOCUMENT_ROOT . '/theme/dolibarr_logo.svg')) { |
|
129 | - $urllogo = DOL_URL_ROOT . '/theme/dolibarr_logo.svg'; |
|
122 | + $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; |
|
123 | + |
|
124 | + if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { |
|
125 | + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); |
|
126 | + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { |
|
127 | + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); |
|
128 | + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { |
|
129 | + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | print '<header class="center">'; |
@@ -135,17 +135,17 @@ discard block |
||
135 | 135 | if ($urllogo) { |
136 | 136 | print '<div class="backgreypublicpayment">'; |
137 | 137 | print '<div class="logopublicpayment">'; |
138 | - print '<img id="dolpaymentlogo" src="' . $urllogo . '">'; |
|
138 | + print '<img id="dolpaymentlogo" src="'.$urllogo.'">'; |
|
139 | 139 | print '</div>'; |
140 | 140 | if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) { |
141 | - print '<div class="poweredbypublicpayment opacitymedium right"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">' . $langs->trans("PoweredBy") . '<br><img class="poweredbyimg" src="' . DOL_URL_ROOT . '/theme/dolibarr_logo.svg" width="80px"></a></div>'; |
|
141 | + print '<div class="poweredbypublicpayment opacitymedium right"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans("PoweredBy").'<br><img class="poweredbyimg" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>'; |
|
142 | 142 | } |
143 | 143 | print '</div>'; |
144 | 144 | } |
145 | 145 | |
146 | 146 | if (getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION')) { |
147 | 147 | print '<div class="backimagepublicregistration">'; |
148 | - print '<img id="idEVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE" src="' . getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION') . '">'; |
|
148 | + print '<img id="idEVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE" src="'.getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION').'">'; |
|
149 | 149 | print '</div>'; |
150 | 150 | } |
151 | 151 | |
@@ -170,8 +170,8 @@ discard block |
||
170 | 170 | printCommonFooter('public'); |
171 | 171 | |
172 | 172 | if (!empty($conf->use_javascript_ajax)) { |
173 | - print "\n" . '<!-- Includes JS Footer of Dolibarr -->' . "\n"; |
|
174 | - print '<script src="' . DOL_URL_ROOT . '/core/js/lib_foot.js.php?lang=' . $langs->defaultlang . (!empty($ext) ? '&' . $ext : '') . '"></script>' . "\n"; |
|
173 | + print "\n".'<!-- Includes JS Footer of Dolibarr -->'."\n"; |
|
174 | + print '<script src="'.DOL_URL_ROOT.'/core/js/lib_foot.js.php?lang='.$langs->defaultlang.(!empty($ext) ? '&'.$ext : '').'"></script>'."\n"; |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | print "</body>\n"; |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $ok = (array_key_exists($sessionkey, $_SESSION) && (strtolower($_SESSION[$sessionkey]) == strtolower(GETPOST('code')))); |
210 | 210 | if (!$ok) { |
211 | 211 | $error++; |
212 | - $errmsg .= $langs->trans("ErrorBadValueForCode") . "<br>\n"; |
|
212 | + $errmsg .= $langs->trans("ErrorBadValueForCode")."<br>\n"; |
|
213 | 213 | $action = ''; |
214 | 214 | } |
215 | 215 | } |
@@ -219,12 +219,12 @@ discard block |
||
219 | 219 | |
220 | 220 | $societe->name = GETPOST('name', 'alphanohtml'); |
221 | 221 | $societe->client = GETPOSTINT('client') ? GETPOSTINT('client') : $societe->client; |
222 | - $societe->address = GETPOST('address', 'alphanohtml'); |
|
223 | - $societe->country_id = GETPOSTINT('country_id'); |
|
222 | + $societe->address = GETPOST('address', 'alphanohtml'); |
|
223 | + $societe->country_id = GETPOSTINT('country_id'); |
|
224 | 224 | $societe->phone = GETPOST('phone', 'alpha'); |
225 | 225 | $societe->fax = GETPOST('fax', 'alpha'); |
226 | 226 | $societe->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)); |
227 | - $societe->client = 2 ; // our client is a prospect |
|
227 | + $societe->client = 2; // our client is a prospect |
|
228 | 228 | $societe->code_client = '-1'; |
229 | 229 | $societe->name_alias = GETPOST('name_alias', 'alphanohtml'); |
230 | 230 | $societe->note_private = GETPOST('note_private', 'alphanohtml'); |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | if (!$error) { |
250 | 250 | $result = $societe->create($user); |
251 | 251 | if ($result > 0) { |
252 | - require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; |
|
252 | + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; |
|
253 | 253 | $objectsoc = $societe; |
254 | 254 | |
255 | 255 | if (!empty($backtopage)) { |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | $urlback = getDolGlobalString('MEMBER_URL_REDIRECT_SUBSCRIPTION'); |
259 | 259 | // TODO Make replacement of __AMOUNT__, etc... |
260 | 260 | } else { |
261 | - $urlback = $_SERVER["PHP_SELF"] . "?action=added&token=" . newToken(); |
|
261 | + $urlback = $_SERVER["PHP_SELF"]."?action=added&token=".newToken(); |
|
262 | 262 | } |
263 | 263 | } else { |
264 | 264 | $error++; |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | if (!$error) { |
271 | 271 | $db->commit(); |
272 | 272 | |
273 | - header("Location: " . $urlback); |
|
273 | + header("Location: ".$urlback); |
|
274 | 274 | exit; |
275 | 275 | } else { |
276 | 276 | $db->rollback(); |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | llxHeaderVierge($langs->trans("ContactUs")); |
311 | 311 | |
312 | 312 | print '<br>'; |
313 | -print load_fiche_titre(img_picto('', 'member_nocolor', 'class="pictofixedwidth"') . ' ' . $langs->trans("ContactUs"), '', '', 0, '', 'center'); |
|
313 | +print load_fiche_titre(img_picto('', 'member_nocolor', 'class="pictofixedwidth"').' '.$langs->trans("ContactUs"), '', '', 0, '', 'center'); |
|
314 | 314 | |
315 | 315 | |
316 | 316 | print '<div align="center">'; |
@@ -318,9 +318,9 @@ discard block |
||
318 | 318 | |
319 | 319 | print '<div class="center subscriptionformhelptext opacitymedium justify">'; |
320 | 320 | if (getDolGlobalString('COMPANY_NEWFORM_TEXT')) { |
321 | - print $langs->trans(getDolGlobalString('COMPANY_NEWFORM_TEXT')) . "<br>\n"; |
|
321 | + print $langs->trans(getDolGlobalString('COMPANY_NEWFORM_TEXT'))."<br>\n"; |
|
322 | 322 | } else { |
323 | - print $langs->trans("ContactUsDesc", getDolGlobalString("MAIN_INFO_SOCIETE_MAIL")) . "<br>\n"; |
|
323 | + print $langs->trans("ContactUsDesc", getDolGlobalString("MAIN_INFO_SOCIETE_MAIL"))."<br>\n"; |
|
324 | 324 | } |
325 | 325 | print '</div>'; |
326 | 326 | |
@@ -328,13 +328,13 @@ discard block |
||
328 | 328 | dol_htmloutput_events(); |
329 | 329 | |
330 | 330 | // Print form |
331 | -print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="newprospect">' . "\n"; |
|
332 | -print '<input type="hidden" name="token" value="' . newToken() . '" / >'; |
|
333 | -print '<input type="hidden" name="entity" value="' . $entity . '" />'; |
|
331 | +print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="newprospect">'."\n"; |
|
332 | +print '<input type="hidden" name="token" value="'.newToken().'" / >'; |
|
333 | +print '<input type="hidden" name="entity" value="'.$entity.'" />'; |
|
334 | 334 | print '<input type="hidden" name="action" value="add" />'; |
335 | 335 | print '<br>'; |
336 | 336 | |
337 | -$messagemandatory = '<span class="">' . $langs->trans("FieldsWithAreMandatory", '*') . '</span>'; |
|
337 | +$messagemandatory = '<span class="">'.$langs->trans("FieldsWithAreMandatory", '*').'</span>'; |
|
338 | 338 | //print '<br><span class="opacitymedium">'.$langs->trans("FieldsWithAreMandatory", '*').'</span><br>'; |
339 | 339 | //print $langs->trans("FieldsWithIsForPublic",'**').'<br>'; |
340 | 340 | |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | </script>'; |
371 | 371 | |
372 | 372 | |
373 | -print '<table class="border" summary="form to subscribe" id="tablesubscribe">' . "\n"; |
|
373 | +print '<table class="border" summary="form to subscribe" id="tablesubscribe">'."\n"; |
|
374 | 374 | //Third party name |
375 | 375 | /* |
376 | 376 | if ($objectsoc->particulier || $private) { |
@@ -380,30 +380,30 @@ discard block |
||
380 | 380 | } |
381 | 381 | */ |
382 | 382 | print '<tr class="tr-field-thirdparty-name"><td class="titlefieldcreate">'; // text appreas left |
383 | -print '<input type="hidden" name="ThirdPartyName" value="' . $langs->trans('ThirdPartyName') . '">'; |
|
384 | -print '<span id="TypeName" class="fieldrequired" title="' .dol_escape_htmltag($langs->trans("FieldsWithAreMandatory", '*')) . '" >' . $form->editfieldkey('Company', 'name', '', $objectsoc, 0) . '<span class="star"> *</span></span>'; |
|
383 | +print '<input type="hidden" name="ThirdPartyName" value="'.$langs->trans('ThirdPartyName').'">'; |
|
384 | +print '<span id="TypeName" class="fieldrequired" title="'.dol_escape_htmltag($langs->trans("FieldsWithAreMandatory", '*')).'" >'.$form->editfieldkey('Company', 'name', '', $objectsoc, 0).'<span class="star"> *</span></span>'; |
|
385 | 385 | print '</td><td>'; // inline input |
386 | -print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="' . dol_escape_htmltag($objectsoc->name) . '" autofocus="autofocus">'; |
|
386 | +print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="'.dol_escape_htmltag($objectsoc->name).'" autofocus="autofocus">'; |
|
387 | 387 | // |
388 | 388 | |
389 | 389 | // Name and lastname |
390 | -print '<tr><td class="classfortooltip" title="' . dol_escape_htmltag($messagemandatory) . '">' . $langs->trans("Firstname") . ' <span class="star">*</span></td><td><input type="text" name="firstname" class="minwidth150" value="' . dol_escape_htmltag(GETPOST('firstname')) . '"></td></tr>' . "\n"; |
|
390 | +print '<tr><td class="classfortooltip" title="'.dol_escape_htmltag($messagemandatory).'">'.$langs->trans("Firstname").' <span class="star">*</span></td><td><input type="text" name="firstname" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('firstname')).'"></td></tr>'."\n"; |
|
391 | 391 | |
392 | -print '<tr><td class="classfortooltip" title="' . dol_escape_htmltag($messagemandatory) . '">' . $langs->trans("Lastname") . ' <span class="star">*</span></td><td><input type="text" name="lastname" class="minwidth150" value="' . dol_escape_htmltag(GETPOST('lastname')) . '"></td></tr>' . "\n"; |
|
392 | +print '<tr><td class="classfortooltip" title="'.dol_escape_htmltag($messagemandatory).'">'.$langs->trans("Lastname").' <span class="star">*</span></td><td><input type="text" name="lastname" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('lastname')).'"></td></tr>'."\n"; |
|
393 | 393 | |
394 | 394 | // Address |
395 | 395 | print '<tr><td class="tdtop">'; |
396 | 396 | print $form->editfieldkey('Address', 'address', '', $objectsoc, 0); |
397 | 397 | print '</td>'; |
398 | 398 | print '<td>'; |
399 | -print '<textarea name="address" id="address" class="quatrevingtpercent" rows="' . ROWS_2 . '" wrap="soft">'; |
|
399 | +print '<textarea name="address" id="address" class="quatrevingtpercent" rows="'.ROWS_2.'" wrap="soft">'; |
|
400 | 400 | print dol_escape_htmltag($objectsoc->address, 0, 1); |
401 | 401 | print '</textarea>'; |
402 | 402 | print $form->widgetForTranslation("address", $objectsoc, $permissiontoadd, 'textarea', 'alphanohtml', 'quatrevingtpercent'); |
403 | 403 | print '</td></tr>'; |
404 | 404 | |
405 | 405 | // Country |
406 | -print '<tr><td>' . $form->editfieldkey('Country', 'selectcountry_id', '', $objectsoc, 0) . '</td><td class="maxwidthonsmartphone">'; |
|
406 | +print '<tr><td>'.$form->editfieldkey('Country', 'selectcountry_id', '', $objectsoc, 0).'</td><td class="maxwidthonsmartphone">'; |
|
407 | 407 | print img_picto('', 'country', 'class="pictofixedwidth"'); |
408 | 408 | print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id') : $objectsoc->country_id), 'country_id', '', 0, 'minwidth300 maxwidth500 widthcentpercentminusx'); |
409 | 409 | if ($user->admin) { |
@@ -412,40 +412,40 @@ discard block |
||
412 | 412 | print '</td></tr>'; |
413 | 413 | |
414 | 414 | // Phone / Fax |
415 | -print '<tr><td>' . $form->editfieldkey('Phone', 'phone', '', $objectsoc, 0) . '</td>'; |
|
416 | -print '<td>' . img_picto('', 'object_phoning', 'class="pictofixedwidth"') . ' <input type="text" name="phone" id="phone" class="maxwidth200 widthcentpercentminusx" value="' . (GETPOSTISSET('phone') ? GETPOST('phone', 'alpha') : $objectsoc->phone) . '"></td>'; |
|
415 | +print '<tr><td>'.$form->editfieldkey('Phone', 'phone', '', $objectsoc, 0).'</td>'; |
|
416 | +print '<td>'.img_picto('', 'object_phoning', 'class="pictofixedwidth"').' <input type="text" name="phone" id="phone" class="maxwidth200 widthcentpercentminusx" value="'.(GETPOSTISSET('phone') ? GETPOST('phone', 'alpha') : $objectsoc->phone).'"></td>'; |
|
417 | 417 | print '</tr>'; |
418 | 418 | |
419 | 419 | print '<tr>'; |
420 | -print '<td>' . $form->editfieldkey('Fax', 'fax', '', $objectsoc, 0) . '</td>'; |
|
421 | -print '<td>' . img_picto('', 'object_phoning_fax', 'class="pictofixedwidth"') . ' <input type="text" name="fax" id="fax" class="maxwidth200 widthcentpercentminusx" value="' . (GETPOSTISSET('fax') ? GETPOST('fax', 'alpha') : $objectsoc->fax) . '"></td>'; |
|
420 | +print '<td>'.$form->editfieldkey('Fax', 'fax', '', $objectsoc, 0).'</td>'; |
|
421 | +print '<td>'.img_picto('', 'object_phoning_fax', 'class="pictofixedwidth"').' <input type="text" name="fax" id="fax" class="maxwidth200 widthcentpercentminusx" value="'.(GETPOSTISSET('fax') ? GETPOST('fax', 'alpha') : $objectsoc->fax).'"></td>'; |
|
422 | 422 | print '</tr>'; |
423 | 423 | |
424 | 424 | // Email / Web |
425 | -print '<tr><td>' . $form->editfieldkey('EMail', 'email', '', $objectsoc, 0, 'string', '', !getDolGlobalString('SOCIETE_EMAIL_MANDATORY') ? '' : $conf->global->SOCIETE_EMAIL_MANDATORY) . '</td>'; |
|
426 | -print '<td>' . img_picto('', 'object_email', 'class="pictofixedwidth"') . ' <input type="text" class="maxwidth200 widthcentpercentminusx" name="email" id="email" value="' . $objectsoc->email . '"></td>'; |
|
425 | +print '<tr><td>'.$form->editfieldkey('EMail', 'email', '', $objectsoc, 0, 'string', '', !getDolGlobalString('SOCIETE_EMAIL_MANDATORY') ? '' : $conf->global->SOCIETE_EMAIL_MANDATORY).'</td>'; |
|
426 | +print '<td>'.img_picto('', 'object_email', 'class="pictofixedwidth"').' <input type="text" class="maxwidth200 widthcentpercentminusx" name="email" id="email" value="'.$objectsoc->email.'"></td>'; |
|
427 | 427 | if (isModEnabled('mailing') && getDolGlobalString('THIRDPARTY_SUGGEST_ALSO_ADDRESS_CREATION')) { |
428 | 428 | if ($conf->browser->layout == 'phone') { |
429 | 429 | print '</tr><tr>'; |
430 | 430 | } |
431 | - print '<td class="individualline noemail">' . $form->editfieldkey($langs->trans('No_Email') . ' (' . $langs->trans('Contact') . ')', 'contact_no_email', '', $objectsoc, 0) . '</td>'; |
|
432 | - print '<td class="individualline" ' . (($conf->browser->layout == 'phone') || !isModEnabled('mailing') ? ' colspan="3"' : '') . '>' . $form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ? GETPOST("contact_no_email", 'alpha') : (empty($objectsoc->no_email) ? 0 : 1)), 1, false, 1) . '</td>'; |
|
431 | + print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email').' ('.$langs->trans('Contact').')', 'contact_no_email', '', $objectsoc, 0).'</td>'; |
|
432 | + print '<td class="individualline" '.(($conf->browser->layout == 'phone') || !isModEnabled('mailing') ? ' colspan="3"' : '').'>'.$form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ? GETPOST("contact_no_email", 'alpha') : (empty($objectsoc->no_email) ? 0 : 1)), 1, false, 1).'</td>'; |
|
433 | 433 | } |
434 | 434 | print '</tr>'; |
435 | 435 | |
436 | -print '<tr><td>' . $form->editfieldkey('Web', 'url', '', $objectsoc, 0) . '</td>'; |
|
437 | -print '<td>' . img_picto('', 'globe', 'class="pictofixedwidth"') . ' <input type="text" class="maxwidth500 widthcentpercentminusx" name="url" id="url" value="' . $objectsoc->url . '"></td></tr>'; |
|
436 | +print '<tr><td>'.$form->editfieldkey('Web', 'url', '', $objectsoc, 0).'</td>'; |
|
437 | +print '<td>'.img_picto('', 'globe', 'class="pictofixedwidth"').' <input type="text" class="maxwidth500 widthcentpercentminusx" name="url" id="url" value="'.$objectsoc->url.'"></td></tr>'; |
|
438 | 438 | |
439 | 439 | |
440 | 440 | // Comments |
441 | 441 | print '<tr>'; |
442 | -print '<td class="tdtop">' . $langs->trans("Comments") . '</td>'; |
|
443 | -print '<td class="tdtop"><textarea name="note_private" id="note_private" wrap="soft" class="quatrevingtpercent" rows="' . ROWS_3 . '">' . dol_escape_htmltag(GETPOST('note_private', 'restricthtml'), 0, 1) . '</textarea></td>'; |
|
444 | -print '</tr>' . "\n"; |
|
442 | +print '<td class="tdtop">'.$langs->trans("Comments").'</td>'; |
|
443 | +print '<td class="tdtop"><textarea name="note_private" id="note_private" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOST('note_private', 'restricthtml'), 0, 1).'</textarea></td>'; |
|
444 | +print '</tr>'."\n"; |
|
445 | 445 | |
446 | 446 | |
447 | 447 | // Other attributes |
448 | -$parameters['tpl_context'] = 'public'; // define template context to public |
|
448 | +$parameters['tpl_context'] = 'public'; // define template context to public |
|
449 | 449 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; |
450 | 450 | |
451 | 451 | |
@@ -453,14 +453,14 @@ discard block |
||
453 | 453 | |
454 | 454 | // Display Captcha code if is enabled |
455 | 455 | if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA')) { |
456 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/security2.lib.php'; |
|
457 | - print '<tr><td class="titlefield"><label for="email"><span class="fieldrequired">' . $langs->trans("SecurityCode") . '</span></label></td><td>'; |
|
456 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; |
|
457 | + print '<tr><td class="titlefield"><label for="email"><span class="fieldrequired">'.$langs->trans("SecurityCode").'</span></label></td><td>'; |
|
458 | 458 | print '<span class="span-icon-security inline-block">'; |
459 | - print '<input id="securitycode" placeholder="' . $langs->trans("SecurityCode") . '" class="flat input-icon-security width150" type="text" maxlength="5" name="code" tabindex="3" />'; |
|
459 | + print '<input id="securitycode" placeholder="'.$langs->trans("SecurityCode").'" class="flat input-icon-security width150" type="text" maxlength="5" name="code" tabindex="3" />'; |
|
460 | 460 | print '</span>'; |
461 | 461 | print '<span class="nowrap inline-block">'; |
462 | - print '<img class="inline-block valignmiddle" src="' . DOL_URL_ROOT . '/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />'; |
|
463 | - print '<a class="inline-block valignmiddle" href="' . $php_self . '" tabindex="4" data-role="button">' . img_picto($langs->trans("Refresh"), 'refresh', 'id="captcha_refresh_img"') . '</a>'; |
|
462 | + print '<img class="inline-block valignmiddle" src="'.DOL_URL_ROOT.'/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />'; |
|
463 | + print '<a class="inline-block valignmiddle" href="'.$php_self.'" tabindex="4" data-role="button">'.img_picto($langs->trans("Refresh"), 'refresh', 'id="captcha_refresh_img"').'</a>'; |
|
464 | 464 | print '</span>'; |
465 | 465 | print '</td></tr>'; |
466 | 466 | } |
@@ -471,9 +471,9 @@ discard block |
||
471 | 471 | |
472 | 472 | // Save / Submit |
473 | 473 | print '<div class="center">'; |
474 | -print '<input type="submit" value="' . $langs->trans("Send") . '" id="submitsave" class="button">'; |
|
474 | +print '<input type="submit" value="'.$langs->trans("Send").'" id="submitsave" class="button">'; |
|
475 | 475 | if (!empty($backtopage)) { |
476 | - print ' <input type="submit" value="' . $langs->trans("Cancel") . '" id="submitcancel" class="button button-cancel">'; |
|
476 | + print ' <input type="submit" value="'.$langs->trans("Cancel").'" id="submitcancel" class="button button-cancel">'; |
|
477 | 477 | } |
478 | 478 | print '</div>'; |
479 | 479 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | $id = GETPOSTINT('id'); // id of record |
50 | 50 | $mode = GETPOST('mode', 'aZ09'); // '' or '_tmp' |
51 | -$piece_num = GETPOSTINT("piece_num") ? GETPOSTINT("piece_num") : GETPOST('ref'); // id of transaction (several lines share the same transaction id) |
|
51 | +$piece_num = GETPOSTINT("piece_num") ? GETPOSTINT("piece_num") : GETPOST('ref'); // id of transaction (several lines share the same transaction id) |
|
52 | 52 | |
53 | 53 | $accountingaccount = new AccountingAccount($db); |
54 | 54 | $accountingjournal = new AccountingJournal($db); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | if (GETPOSTINT('doc_datemonth') && GETPOSTINT('doc_dateday') && GETPOSTINT('doc_dateyear')) { |
190 | 190 | $datedoc = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); |
191 | 191 | } else { |
192 | - $datedoc = (int) GETPOSTINT('doc_date'); // TODO Use instead the mode day-month-year |
|
192 | + $datedoc = (int) GETPOSTINT('doc_date'); // TODO Use instead the mode day-month-year |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | $object = new BookKeeping($db); |
@@ -668,7 +668,7 @@ discard block |
||
668 | 668 | // Due date (if invoice) |
669 | 669 | //if (in_array($object->doc_type, array('customer_invoice', 'supplier_invoice'))) { |
670 | 670 | print '<tr>'; |
671 | - print '<td class="titlefield">' . $form->textwithpicto($langs->trans('DateDue'), $langs->trans("IfTransactionHasDueDate")) . '</td>'; |
|
671 | + print '<td class="titlefield">'.$form->textwithpicto($langs->trans('DateDue'), $langs->trans("IfTransactionHasDueDate")).'</td>'; |
|
672 | 672 | print '<td>'; |
673 | 673 | print $object->date_lim_reglement ? dol_print_date($object->date_lim_reglement, 'day') : ' '; |
674 | 674 | print '</td>'; |
@@ -679,7 +679,7 @@ discard block |
||
679 | 679 | if ($mode != "_tmp") { |
680 | 680 | // Date document export |
681 | 681 | print '<tr>'; |
682 | - print '<td class="titlefield">' . $langs->trans("DateExport") . '</td>'; |
|
682 | + print '<td class="titlefield">'.$langs->trans("DateExport").'</td>'; |
|
683 | 683 | print '<td>'; |
684 | 684 | print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : ' '; |
685 | 685 | print '</td>'; |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | |
688 | 688 | // Date document validation |
689 | 689 | print '<tr>'; |
690 | - print '<td class="titlefield">' . $langs->trans("DateValidation") . '</td>'; |
|
690 | + print '<td class="titlefield">'.$langs->trans("DateValidation").'</td>'; |
|
691 | 691 | print '<td>'; |
692 | 692 | print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : ' '; |
693 | 693 | print '</td>'; |
@@ -696,7 +696,7 @@ discard block |
||
696 | 696 | // Id_import |
697 | 697 | if (!empty($object->import_key)) { |
698 | 698 | print '<tr>'; |
699 | - print '<td class="titlefield">' . $langs->trans("ImportId") . '</td>'; |
|
699 | + print '<td class="titlefield">'.$langs->trans("ImportId").'</td>'; |
|
700 | 700 | print '<td>'; |
701 | 701 | print $object->import_key; |
702 | 702 | print '</td>'; |
@@ -755,7 +755,7 @@ discard block |
||
755 | 755 | print dol_get_fiche_end(); |
756 | 756 | |
757 | 757 | |
758 | - $result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt |
|
758 | + $result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt |
|
759 | 759 | |
760 | 760 | if ($result < 0) { |
761 | 761 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -883,14 +883,14 @@ discard block |
||
883 | 883 | if (getDolGlobalString('ACCOUNTANCY_COMBO_FOR_AUX')) { |
884 | 884 | print $formaccounting->select_auxaccount('', 'subledger_account', 1, 'maxwidth250', '', 'subledger_label'); |
885 | 885 | } else { |
886 | - print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccount")) . '">'; |
|
886 | + print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">'; |
|
887 | 887 | } |
888 | - print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccountLabel")) . '">'; |
|
888 | + print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">'; |
|
889 | 889 | print '</td>'; |
890 | - print '<td><input type="text" class="minwidth200" name="label_operation" value="' . dol_escape_htmltag($label_operation) . '"/></td>'; |
|
890 | + print '<td><input type="text" class="minwidth200" name="label_operation" value="'.dol_escape_htmltag($label_operation).'"/></td>'; |
|
891 | 891 | print '<td class="right"><input type="text" class="right width50" name="debit" value=""/></td>'; |
892 | 892 | print '<td class="right"><input type="text" class="right width50" name="credit" value=""/></td>'; |
893 | - print '<td class="center"><input type="submit" class="button small" name="save" value="' . $langs->trans("Add") . '"></td>'; |
|
893 | + print '<td class="center"><input type="submit" class="button small" name="save" value="'.$langs->trans("Add").'"></td>'; |
|
894 | 894 | print "</tr>\n"; |
895 | 895 | } |
896 | 896 | } else { |
@@ -916,7 +916,7 @@ discard block |
||
916 | 916 | print '<td class="center nowraponall">'; |
917 | 917 | if ($permissiontoadd) { |
918 | 918 | if (empty($line->date_export) && empty($line->date_validation)) { |
919 | - print '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=update&id=' . $line->id . '&piece_num=' . ((int) $line->piece_num) . '&mode=' . urlencode((string) $mode) . '&token=' . urlencode(newToken()) . '">'; |
|
919 | + print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=update&id='.$line->id.'&piece_num='.((int) $line->piece_num).'&mode='.urlencode((string) $mode).'&token='.urlencode(newToken()).'">'; |
|
920 | 920 | print img_edit('', 0, 'class="marginrightonly"'); |
921 | 921 | print '</a> '; |
922 | 922 | } else { |
@@ -931,7 +931,7 @@ discard block |
||
931 | 931 | $actiontodelete = 'confirm_delete'; |
932 | 932 | } |
933 | 933 | |
934 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?action=' . $actiontodelete . '&id=' . $line->id . '&piece_num=' . ((int) $line->piece_num) . '&mode=' . urlencode((string) $mode) . '&token=' . urlencode(newToken()) . '">'; |
|
934 | + print '<a href="'.$_SERVER["PHP_SELF"].'?action='.$actiontodelete.'&id='.$line->id.'&piece_num='.((int) $line->piece_num).'&mode='.urlencode((string) $mode).'&token='.urlencode(newToken()).'">'; |
|
935 | 935 | print img_delete(); |
936 | 936 | print '</a>'; |
937 | 937 | } else { |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | if (empty($this->piece_num)) { |
369 | 369 | $sqlnum = "SELECT MAX(piece_num)+1 as maxpiecenum"; |
370 | 370 | $sqlnum .= " FROM ".MAIN_DB_PREFIX.$this->table_element; |
371 | - $sqlnum .= " WHERE entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
371 | + $sqlnum .= " WHERE entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
372 | 372 | |
373 | 373 | $resqlnum = $this->db->query($sqlnum); |
374 | 374 | if ($resqlnum) { |
@@ -550,7 +550,7 @@ discard block |
||
550 | 550 | //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); |
551 | 551 | |
552 | 552 | global $action; |
553 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
553 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
554 | 554 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
555 | 555 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
556 | 556 | if ($reshook > 0) { |
@@ -775,7 +775,7 @@ discard block |
||
775 | 775 | $sql .= " t.date_validated as date_validation"; |
776 | 776 | $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.$mode.' as t'; |
777 | 777 | $sql .= ' WHERE 1 = 1'; |
778 | - $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
778 | + $sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
779 | 779 | if (null !== $ref) { |
780 | 780 | $sql .= " AND t.rowid = ".((int) $ref); |
781 | 781 | } else { |
@@ -947,7 +947,7 @@ discard block |
||
947 | 947 | } |
948 | 948 | } |
949 | 949 | $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; |
950 | - $sql .= ' WHERE entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
950 | + $sql .= ' WHERE entity = '.((int) $conf->entity); // Do not use getEntity for accounting features |
|
951 | 951 | if (count($sqlwhere) > 0) { |
952 | 952 | $sql .= " AND ".implode(" ".$this->db->sanitize($filtermode)." ", $sqlwhere); |
953 | 953 | } |
@@ -1082,7 +1082,7 @@ discard block |
||
1082 | 1082 | $sql .= " t.date_validated as date_validation"; |
1083 | 1083 | $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; |
1084 | 1084 | |
1085 | - $sql .= ' WHERE t.entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
1085 | + $sql .= ' WHERE t.entity = '.((int) $conf->entity); // Do not use getEntity for accounting features |
|
1086 | 1086 | if ($showAlreadyExportMovements == 0) { |
1087 | 1087 | $sql .= " AND t.date_export IS NULL"; |
1088 | 1088 | } |
@@ -1250,7 +1250,7 @@ discard block |
||
1250 | 1250 | $sql .= " SUM(t.debit) as debit,"; |
1251 | 1251 | $sql .= " SUM(t.credit) as credit"; |
1252 | 1252 | $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; |
1253 | - $sql .= ' WHERE entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
1253 | + $sql .= ' WHERE entity = '.((int) $conf->entity); // Do not use getEntity for accounting features |
|
1254 | 1254 | |
1255 | 1255 | // Manage filter |
1256 | 1256 | if (is_array($filter)) { |
@@ -1678,7 +1678,7 @@ discard block |
||
1678 | 1678 | if (!empty($journal)) { |
1679 | 1679 | $sql .= " AND code_journal = '".$this->db->escape($journal)."'"; |
1680 | 1680 | } |
1681 | - $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
1681 | + $sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
1682 | 1682 | // Exclusion of validated entries at the time of deletion |
1683 | 1683 | $sql .= " AND date_validated IS NULL"; |
1684 | 1684 | $sql .= $sql_filter; |
@@ -1725,8 +1725,8 @@ discard block |
||
1725 | 1725 | $sql = "DELETE"; |
1726 | 1726 | $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode; |
1727 | 1727 | $sql .= " WHERE piece_num = ".(int) $piecenum; |
1728 | - $sql .= " AND date_validated IS NULL"; // For security, exclusion of validated entries at the time of deletion |
|
1729 | - $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
1728 | + $sql .= " AND date_validated IS NULL"; // For security, exclusion of validated entries at the time of deletion |
|
1729 | + $sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
1730 | 1730 | $sql .= $sql_filter; |
1731 | 1731 | |
1732 | 1732 | $resql = $this->db->query($sql); |
@@ -1854,7 +1854,7 @@ discard block |
||
1854 | 1854 | } |
1855 | 1855 | $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode; |
1856 | 1856 | $sql .= " WHERE piece_num = ".((int) $piecenum); |
1857 | - $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
1857 | + $sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
1858 | 1858 | |
1859 | 1859 | dol_syslog(__METHOD__, LOG_DEBUG); |
1860 | 1860 | $result = $this->db->query($sql); |
@@ -1895,7 +1895,7 @@ discard block |
||
1895 | 1895 | global $conf; |
1896 | 1896 | |
1897 | 1897 | $sql = "SELECT MAX(piece_num)+1 as max FROM ".MAIN_DB_PREFIX.$this->table_element.$mode; |
1898 | - $sql .= " WHERE entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
1898 | + $sql .= " WHERE entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
1899 | 1899 | |
1900 | 1900 | dol_syslog(get_class($this)."::getNextNumMvt", LOG_DEBUG); |
1901 | 1901 | |
@@ -1939,7 +1939,7 @@ discard block |
||
1939 | 1939 | } |
1940 | 1940 | $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode; |
1941 | 1941 | $sql .= " WHERE piece_num = ".((int) $piecenum); |
1942 | - $sql .= " AND entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
1942 | + $sql .= " AND entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
1943 | 1943 | |
1944 | 1944 | dol_syslog(__METHOD__, LOG_DEBUG); |
1945 | 1945 | $result = $this->db->query($sql); |
@@ -2004,7 +2004,7 @@ discard block |
||
2004 | 2004 | $sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, piece_num,"; |
2005 | 2005 | $sql .= " date_validated as date_validation"; |
2006 | 2006 | $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element; |
2007 | - $sql .= " WHERE entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
2007 | + $sql .= " WHERE entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
2008 | 2008 | |
2009 | 2009 | dol_syslog(get_class($this)."::export_bookkeeping", LOG_DEBUG); |
2010 | 2010 | |
@@ -2082,7 +2082,7 @@ discard block |
||
2082 | 2082 | |
2083 | 2083 | if (!$error) { |
2084 | 2084 | // Delete if there is an empty line |
2085 | - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity)." AND numero_compte IS NULL AND debit = 0 AND credit = 0"; |
|
2085 | + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity)." AND numero_compte IS NULL AND debit = 0 AND credit = 0"; |
|
2086 | 2086 | $resql = $this->db->query($sql); |
2087 | 2087 | if (!$resql) { |
2088 | 2088 | $error++; |
@@ -2100,7 +2100,7 @@ discard block |
||
2100 | 2100 | $sql .= ' doc_ref, fk_doc, fk_docdet, entity, thirdparty_code, subledger_account, subledger_label,'; |
2101 | 2101 | $sql .= ' numero_compte, label_compte, label_operation, debit, credit,'; |
2102 | 2102 | $sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, '.((int) $next_piecenum).", '".$this->db->idate($now)."'"; |
2103 | - $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND numero_compte IS NOT NULL AND entity = ' .((int) $conf->entity); |
|
2103 | + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND numero_compte IS NOT NULL AND entity = '.((int) $conf->entity); |
|
2104 | 2104 | $sql .= $sql_filter; |
2105 | 2105 | $resql = $this->db->query($sql); |
2106 | 2106 | if (!$resql) { |
@@ -2111,7 +2111,7 @@ discard block |
||
2111 | 2111 | } |
2112 | 2112 | |
2113 | 2113 | if (!$error) { |
2114 | - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity); |
|
2114 | + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity); |
|
2115 | 2115 | $resql = $this->db->query($sql); |
2116 | 2116 | if (!$resql) { |
2117 | 2117 | $error++; |
@@ -2121,7 +2121,7 @@ discard block |
||
2121 | 2121 | } |
2122 | 2122 | } elseif ($direction == 1) { |
2123 | 2123 | if (!$error) { |
2124 | - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity); |
|
2124 | + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity); |
|
2125 | 2125 | $resql = $this->db->query($sql); |
2126 | 2126 | if (!$resql) { |
2127 | 2127 | $error++; |
@@ -2139,7 +2139,7 @@ discard block |
||
2139 | 2139 | $sql .= ' doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,'; |
2140 | 2140 | $sql .= ' numero_compte, label_compte, label_operation, debit, credit,'; |
2141 | 2141 | $sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num'; |
2142 | - $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity); |
|
2142 | + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity); |
|
2143 | 2143 | $sql .= $sql_filter; |
2144 | 2144 | $resql = $this->db->query($sql); |
2145 | 2145 | if (!$resql) { |
@@ -2150,7 +2150,7 @@ discard block |
||
2150 | 2150 | } |
2151 | 2151 | |
2152 | 2152 | if (!$error) { |
2153 | - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity); |
|
2153 | + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = '.((int) $conf->entity); |
|
2154 | 2154 | $sql .= $sql_filter; |
2155 | 2155 | $resql = $this->db->query($sql); |
2156 | 2156 | if (!$resql) { |
@@ -2207,7 +2207,7 @@ discard block |
||
2207 | 2207 | $sql .= " AND aa.active = 1"; |
2208 | 2208 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; |
2209 | 2209 | $sql .= " AND asy.rowid = ".((int) $pcgver); |
2210 | - $sql .= " AND ab.entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
2210 | + $sql .= " AND ab.entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
2211 | 2211 | $sql .= " ORDER BY account_number ASC"; |
2212 | 2212 | |
2213 | 2213 | dol_syslog(get_class($this)."::select_account", LOG_DEBUG); |
@@ -2271,7 +2271,7 @@ discard block |
||
2271 | 2271 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as parent ON aa.account_parent = parent.rowid AND parent.active = 1"; |
2272 | 2272 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as root ON parent.account_parent = root.rowid AND root.active = 1"; |
2273 | 2273 | $sql .= " WHERE aa.account_number = '".$this->db->escape($account)."'"; |
2274 | - $sql .= " AND aa.entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
2274 | + $sql .= " AND aa.entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
2275 | 2275 | |
2276 | 2276 | dol_syslog(get_class($this)."::select_account", LOG_DEBUG); |
2277 | 2277 | $resql = $this->db->query($sql); |
@@ -2311,7 +2311,7 @@ discard block |
||
2311 | 2311 | $sql .= " AND asy.rowid = ".((int) $pcgver); |
2312 | 2312 | $sql .= " AND aa.active = 1"; |
2313 | 2313 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_accounting_category as cat ON aa.fk_accounting_category = cat.rowid"; |
2314 | - $sql .= " WHERE aa.entity = " . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
2314 | + $sql .= " WHERE aa.entity = ".((int) $conf->entity); // Do not use getEntity for accounting features |
|
2315 | 2315 | |
2316 | 2316 | dol_syslog(get_class($this)."::select_account", LOG_DEBUG); |
2317 | 2317 | $resql = $this->db->query($sql); |
@@ -2344,7 +2344,7 @@ discard block |
||
2344 | 2344 | global $conf; |
2345 | 2345 | |
2346 | 2346 | $alias = trim($alias); |
2347 | - $alias = !empty($alias) && strpos($alias, '.') < 0 ? $alias . "." : $alias; |
|
2347 | + $alias = !empty($alias) && strpos($alias, '.') < 0 ? $alias."." : $alias; |
|
2348 | 2348 | |
2349 | 2349 | if (!isset(self::$can_modify_bookkeeping_sql_cached[$alias]) || $force) { |
2350 | 2350 | $result = $this->loadFiscalPeriods($force, 'active'); |
@@ -2357,10 +2357,10 @@ discard block |
||
2357 | 2357 | $i = 0; |
2358 | 2358 | foreach ($conf->cache['active_fiscal_period_cached'] as $fiscal_period) { |
2359 | 2359 | $sql_list[$i] = "("; |
2360 | - $sql_list[$i] .= "'".$this->db->idate($fiscal_period['date_start']) . "' <= ".$this->db->sanitize($alias)."doc_date"; |
|
2360 | + $sql_list[$i] .= "'".$this->db->idate($fiscal_period['date_start'])."' <= ".$this->db->sanitize($alias)."doc_date"; |
|
2361 | 2361 | if (!empty($fiscal_period['date_end'])) { |
2362 | 2362 | $sql_list[$i] .= " AND "; |
2363 | - $sql_list[$i] .= $this->db->sanitize($alias)."doc_date <= '" . $this->db->idate($fiscal_period['date_end'])."'"; |
|
2363 | + $sql_list[$i] .= $this->db->sanitize($alias)."doc_date <= '".$this->db->idate($fiscal_period['date_end'])."'"; |
|
2364 | 2364 | } |
2365 | 2365 | $sql_list[$i] .= ")"; |
2366 | 2366 | $i++; |
@@ -2488,8 +2488,8 @@ discard block |
||
2488 | 2488 | if ($mode == 'active') { |
2489 | 2489 | if (!isset($conf->cache['active_fiscal_period_cached']) || $force) { |
2490 | 2490 | $sql = "SELECT date_start, date_end"; |
2491 | - $sql .= " FROM " . $this->db->prefix() . "accounting_fiscalyear"; |
|
2492 | - $sql .= " WHERE entity = " . ((int) $conf->entity); |
|
2491 | + $sql .= " FROM ".$this->db->prefix()."accounting_fiscalyear"; |
|
2492 | + $sql .= " WHERE entity = ".((int) $conf->entity); |
|
2493 | 2493 | $sql .= " AND statut = 0"; |
2494 | 2494 | |
2495 | 2495 | $resql = $this->db->query($sql); |
@@ -2511,8 +2511,8 @@ discard block |
||
2511 | 2511 | if ($mode == 'closed') { |
2512 | 2512 | if (!isset($conf->cache['closed_fiscal_period_cached']) || $force) { |
2513 | 2513 | $sql = "SELECT date_start, date_end"; |
2514 | - $sql .= " FROM " . $this->db->prefix() . "accounting_fiscalyear"; |
|
2515 | - $sql .= " WHERE entity = " . ((int) $conf->entity); |
|
2514 | + $sql .= " FROM ".$this->db->prefix()."accounting_fiscalyear"; |
|
2515 | + $sql .= " WHERE entity = ".((int) $conf->entity); |
|
2516 | 2516 | $sql .= " AND statut = 1"; |
2517 | 2517 | |
2518 | 2518 | $resql = $this->db->query($sql); |
@@ -2547,10 +2547,10 @@ discard block |
||
2547 | 2547 | $list = array(); |
2548 | 2548 | |
2549 | 2549 | $sql = "SELECT rowid, label, date_start, date_end, statut"; |
2550 | - $sql .= " FROM " . $this->db->prefix() . "accounting_fiscalyear"; |
|
2551 | - $sql .= " WHERE entity = " . ((int) $conf->entity); |
|
2550 | + $sql .= " FROM ".$this->db->prefix()."accounting_fiscalyear"; |
|
2551 | + $sql .= " WHERE entity = ".((int) $conf->entity); |
|
2552 | 2552 | if (!empty($filter)) { |
2553 | - $sql .= " AND (" . $this->db->sanitize($filter, 1, 1, 1) . ')'; |
|
2553 | + $sql .= " AND (".$this->db->sanitize($filter, 1, 1, 1).')'; |
|
2554 | 2554 | } |
2555 | 2555 | $sql .= $this->db->order('date_start', 'ASC'); |
2556 | 2556 | |
@@ -2587,13 +2587,13 @@ discard block |
||
2587 | 2587 | |
2588 | 2588 | $sql = "SELECT YEAR(b.doc_date) as year"; |
2589 | 2589 | for ($i = 1; $i <= 12; $i++) { |
2590 | - $sql .= ", SUM(".$this->db->ifsql("MONTH(b.doc_date) = ".((int) $i), "1", "0") . ") AS month".((int) $i); |
|
2590 | + $sql .= ", SUM(".$this->db->ifsql("MONTH(b.doc_date) = ".((int) $i), "1", "0").") AS month".((int) $i); |
|
2591 | 2591 | } |
2592 | 2592 | $sql .= ", COUNT(b.rowid) as total"; |
2593 | - $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as b"; |
|
2594 | - $sql .= " WHERE b.doc_date >= '" . $this->db->idate($date_start) . "'"; |
|
2595 | - $sql .= " AND b.doc_date <= '" . $this->db->idate($date_end) . "'"; |
|
2596 | - $sql .= " AND b.entity IN (" . getEntity('bookkeeping', 0) . ")"; // We don't share object for accountancy |
|
2593 | + $sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b"; |
|
2594 | + $sql .= " WHERE b.doc_date >= '".$this->db->idate($date_start)."'"; |
|
2595 | + $sql .= " AND b.doc_date <= '".$this->db->idate($date_end)."'"; |
|
2596 | + $sql .= " AND b.entity IN (".getEntity('bookkeeping', 0).")"; // We don't share object for accountancy |
|
2597 | 2597 | |
2598 | 2598 | // Get count for each month into the fiscal period |
2599 | 2599 | if (getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")) { |
@@ -2623,7 +2623,7 @@ discard block |
||
2623 | 2623 | 'total' => (int) $obj->total, |
2624 | 2624 | ); |
2625 | 2625 | for ($i = 1; $i <= 12; $i++) { |
2626 | - $year_list['count'][$i] = (int) $obj->{'month' . $i}; |
|
2626 | + $year_list['count'][$i] = (int) $obj->{'month'.$i}; |
|
2627 | 2627 | } |
2628 | 2628 | |
2629 | 2629 | $list[] = $year_list; |
@@ -2651,11 +2651,11 @@ discard block |
||
2651 | 2651 | $now = dol_now(); |
2652 | 2652 | |
2653 | 2653 | // Specify as export : update field date_validated on selected month/year |
2654 | - $sql = " UPDATE " . MAIN_DB_PREFIX . "accounting_bookkeeping"; |
|
2655 | - $sql .= " SET date_validated = '" . $this->db->idate($now) . "'"; |
|
2656 | - $sql .= " WHERE entity = " . ((int) $conf->entity); |
|
2657 | - $sql .= " AND DATE(doc_date) >= '" . $this->db->idate($date_start) . "'"; |
|
2658 | - $sql .= " AND DATE(doc_date) <= '" . $this->db->idate($date_end) . "'"; |
|
2654 | + $sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping"; |
|
2655 | + $sql .= " SET date_validated = '".$this->db->idate($now)."'"; |
|
2656 | + $sql .= " WHERE entity = ".((int) $conf->entity); |
|
2657 | + $sql .= " AND DATE(doc_date) >= '".$this->db->idate($date_start)."'"; |
|
2658 | + $sql .= " AND DATE(doc_date) <= '".$this->db->idate($date_end)."'"; |
|
2659 | 2659 | $sql .= " AND date_validated IS NULL"; |
2660 | 2660 | |
2661 | 2661 | dol_syslog(__METHOD__, LOG_DEBUG); |
@@ -2688,27 +2688,27 @@ discard block |
||
2688 | 2688 | |
2689 | 2689 | $pcg_type_filter = array(); |
2690 | 2690 | foreach ($accounting_groups_used_for_income_statement as $item) { |
2691 | - $pcg_type_filter[] = "'" . $this->db->escape($item) . "'"; |
|
2691 | + $pcg_type_filter[] = "'".$this->db->escape($item)."'"; |
|
2692 | 2692 | } |
2693 | 2693 | |
2694 | 2694 | $sql = 'SELECT'; |
2695 | 2695 | $sql .= " t.numero_compte,"; |
2696 | 2696 | $sql .= " aa.pcg_type,"; |
2697 | 2697 | $sql .= " (SUM(t.credit) - SUM(t.debit)) as accounting_result"; |
2698 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; |
|
2699 | - $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'accounting_account as aa ON aa.account_number = t.numero_compte'; |
|
2700 | - $sql .= ' WHERE t.entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
2701 | - $sql .= " AND aa.entity = " . ((int) $conf->entity); |
|
2702 | - $sql .= ' AND aa.fk_pcg_version IN (SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid = ' . ((int) getDolGlobalInt('CHARTOFACCOUNTS')) . ')'; |
|
2703 | - $sql .= ' AND aa.pcg_type IN (' . $this->db->sanitize(implode(',', $pcg_type_filter), 1) . ')'; |
|
2704 | - $sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($date_start) . "'"; |
|
2705 | - $sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($date_end) . "'"; |
|
2698 | + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; |
|
2699 | + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'accounting_account as aa ON aa.account_number = t.numero_compte'; |
|
2700 | + $sql .= ' WHERE t.entity = '.((int) $conf->entity); // Do not use getEntity for accounting features |
|
2701 | + $sql .= " AND aa.entity = ".((int) $conf->entity); |
|
2702 | + $sql .= ' AND aa.fk_pcg_version IN (SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid = '.((int) getDolGlobalInt('CHARTOFACCOUNTS')).')'; |
|
2703 | + $sql .= ' AND aa.pcg_type IN ('.$this->db->sanitize(implode(',', $pcg_type_filter), 1).')'; |
|
2704 | + $sql .= " AND DATE(t.doc_date) >= '".$this->db->idate($date_start)."'"; |
|
2705 | + $sql .= " AND DATE(t.doc_date) <= '".$this->db->idate($date_end)."'"; |
|
2706 | 2706 | $sql .= ' GROUP BY t.numero_compte, aa.pcg_type'; |
2707 | 2707 | |
2708 | 2708 | $resql = $this->db->query($sql); |
2709 | 2709 | if (!$resql) { |
2710 | - $this->errors[] = 'Error ' . $this->db->lasterror(); |
|
2711 | - dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR); |
|
2710 | + $this->errors[] = 'Error '.$this->db->lasterror(); |
|
2711 | + dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR); |
|
2712 | 2712 | } else { |
2713 | 2713 | while ($obj = $this->db->fetch_object($resql)) { |
2714 | 2714 | $income_statement_amount += $obj->accounting_result; |
@@ -2747,7 +2747,7 @@ discard block |
||
2747 | 2747 | return -1; |
2748 | 2748 | } elseif (empty($fiscal_period->id)) { |
2749 | 2749 | $langs->loadLangs(array('errors', 'compta')); |
2750 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('FiscalPeriod') . ' (' . $fiscal_period_id . ')'; |
|
2750 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('FiscalPeriod').' ('.$fiscal_period_id.')'; |
|
2751 | 2751 | return -1; |
2752 | 2752 | } |
2753 | 2753 | |
@@ -2766,7 +2766,7 @@ discard block |
||
2766 | 2766 | return -1; |
2767 | 2767 | } elseif (empty($new_fiscal_period->id)) { |
2768 | 2768 | $langs->loadLangs(array('errors', 'compta')); |
2769 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('FiscalPeriod') . ' (' . $new_fiscal_period_id . ')'; |
|
2769 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('FiscalPeriod').' ('.$new_fiscal_period_id.')'; |
|
2770 | 2770 | return -1; |
2771 | 2771 | } |
2772 | 2772 | |
@@ -2786,7 +2786,7 @@ discard block |
||
2786 | 2786 | $journal_id = max(0, getDolGlobalString('ACCOUNTING_CLOSURE_DEFAULT_JOURNAL')); |
2787 | 2787 | if (empty($journal_id)) { |
2788 | 2788 | $langs->loadLangs(array('errors', 'accountancy')); |
2789 | - $this->errors[] = $langs->trans('ErrorBadParameters') . ' - ' . $langs->trans('Codejournal') . ' (' . $langs->trans('AccountingJournalType9') . ')'; |
|
2789 | + $this->errors[] = $langs->trans('ErrorBadParameters').' - '.$langs->trans('Codejournal').' ('.$langs->trans('AccountingJournalType9').')'; |
|
2790 | 2790 | $error++; |
2791 | 2791 | } |
2792 | 2792 | |
@@ -2800,7 +2800,7 @@ discard block |
||
2800 | 2800 | $error++; |
2801 | 2801 | } elseif ($result == 0) { |
2802 | 2802 | $langs->loadLangs(array('errors', 'accountancy')); |
2803 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('Codejournal') . ' (' . $langs->trans('AccountingJournalType9') . ')'; |
|
2803 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('Codejournal').' ('.$langs->trans('AccountingJournalType9').')'; |
|
2804 | 2804 | $error++; |
2805 | 2805 | } |
2806 | 2806 | } else { |
@@ -2814,7 +2814,7 @@ discard block |
||
2814 | 2814 | $pcg_type_filter = array(); |
2815 | 2815 | $tmp = array_merge($accounting_groups_used_for_balance_sheet_account, $accounting_groups_used_for_income_statement); |
2816 | 2816 | foreach ($tmp as $item) { |
2817 | - $pcg_type_filter[] = "'" . $this->db->escape($item) . "'"; |
|
2817 | + $pcg_type_filter[] = "'".$this->db->escape($item)."'"; |
|
2818 | 2818 | } |
2819 | 2819 | |
2820 | 2820 | $sql = 'SELECT'; |
@@ -2826,14 +2826,14 @@ discard block |
||
2826 | 2826 | } |
2827 | 2827 | $sql .= " aa.pcg_type,"; |
2828 | 2828 | $sql .= " (SUM(t.credit) - SUM(t.debit)) as opening_balance"; |
2829 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; |
|
2830 | - $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'accounting_account as aa ON aa.account_number = t.numero_compte'; |
|
2831 | - $sql .= ' WHERE t.entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
2832 | - $sql .= " AND aa.entity = ". ((int) $conf->entity); |
|
2829 | + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; |
|
2830 | + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'accounting_account as aa ON aa.account_number = t.numero_compte'; |
|
2831 | + $sql .= ' WHERE t.entity = '.((int) $conf->entity); // Do not use getEntity for accounting features |
|
2832 | + $sql .= " AND aa.entity = ".((int) $conf->entity); |
|
2833 | 2833 | $sql .= ' AND aa.fk_pcg_version IN (SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid = '.((int) getDolGlobalInt('CHARTOFACCOUNTS')).')'; |
2834 | - $sql .= ' AND aa.pcg_type IN (' . $this->db->sanitize(implode(',', $pcg_type_filter), 1) . ')'; |
|
2835 | - $sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($fiscal_period->date_start) . "'"; |
|
2836 | - $sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($fiscal_period->date_end) . "'"; |
|
2834 | + $sql .= ' AND aa.pcg_type IN ('.$this->db->sanitize(implode(',', $pcg_type_filter), 1).')'; |
|
2835 | + $sql .= " AND DATE(t.doc_date) >= '".$this->db->idate($fiscal_period->date_start)."'"; |
|
2836 | + $sql .= " AND DATE(t.doc_date) <= '".$this->db->idate($fiscal_period->date_end)."'"; |
|
2837 | 2837 | $sql .= ' GROUP BY t.numero_compte, t.label_compte, aa.pcg_type'; |
2838 | 2838 | if ($separate_auxiliary_account) { |
2839 | 2839 | $sql .= ' ,t.subledger_account, t.subledger_label'; |
@@ -2842,8 +2842,8 @@ discard block |
||
2842 | 2842 | |
2843 | 2843 | $resql = $this->db->query($sql); |
2844 | 2844 | if (!$resql) { |
2845 | - $this->errors[] = 'Error ' . $this->db->lasterror(); |
|
2846 | - dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR); |
|
2845 | + $this->errors[] = 'Error '.$this->db->lasterror(); |
|
2846 | + dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR); |
|
2847 | 2847 | |
2848 | 2848 | $error++; |
2849 | 2849 | } else { |
@@ -2985,7 +2985,7 @@ discard block |
||
2985 | 2985 | return -1; |
2986 | 2986 | } elseif (empty($fiscal_period->id)) { |
2987 | 2987 | $langs->loadLangs(array('errors', 'compta')); |
2988 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('FiscalPeriod') . ' (' . $fiscal_period_id . ')'; |
|
2988 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('FiscalPeriod').' ('.$fiscal_period_id.')'; |
|
2989 | 2989 | return -1; |
2990 | 2990 | } |
2991 | 2991 | |
@@ -3004,7 +3004,7 @@ discard block |
||
3004 | 3004 | return -1; |
3005 | 3005 | } elseif (empty($new_fiscal_period->id)) { |
3006 | 3006 | $langs->loadLangs(array('errors', 'compta')); |
3007 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('FiscalPeriod') . ' (' . $new_fiscal_period_id . ')'; |
|
3007 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('FiscalPeriod').' ('.$new_fiscal_period_id.')'; |
|
3008 | 3008 | return -1; |
3009 | 3009 | } |
3010 | 3010 | |
@@ -3024,7 +3024,7 @@ discard block |
||
3024 | 3024 | return -1; |
3025 | 3025 | } elseif ($result == 0) { |
3026 | 3026 | $langs->loadLangs(array('errors', 'accountancy')); |
3027 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('InventoryJournal'); |
|
3027 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('InventoryJournal'); |
|
3028 | 3028 | return -1; |
3029 | 3029 | } |
3030 | 3030 | |
@@ -3032,18 +3032,18 @@ discard block |
||
3032 | 3032 | $this->db->begin(); |
3033 | 3033 | |
3034 | 3034 | $sql = 'SELECT t.rowid'; |
3035 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; |
|
3036 | - $sql .= ' WHERE t.entity = ' . ((int) $conf->entity); // Do not use getEntity for accounting features |
|
3037 | - $sql .= " AND code_journal = '" . $this->db->escape($inventory_journal->code) . "'"; |
|
3038 | - $sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($date_start) . "'"; |
|
3039 | - $sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($date_end) . "'"; |
|
3040 | - $sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($fiscal_period->date_start) . "'"; |
|
3041 | - $sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($fiscal_period->date_end) . "'"; |
|
3035 | + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; |
|
3036 | + $sql .= ' WHERE t.entity = '.((int) $conf->entity); // Do not use getEntity for accounting features |
|
3037 | + $sql .= " AND code_journal = '".$this->db->escape($inventory_journal->code)."'"; |
|
3038 | + $sql .= " AND DATE(t.doc_date) >= '".$this->db->idate($date_start)."'"; |
|
3039 | + $sql .= " AND DATE(t.doc_date) <= '".$this->db->idate($date_end)."'"; |
|
3040 | + $sql .= " AND DATE(t.doc_date) >= '".$this->db->idate($fiscal_period->date_start)."'"; |
|
3041 | + $sql .= " AND DATE(t.doc_date) <= '".$this->db->idate($fiscal_period->date_end)."'"; |
|
3042 | 3042 | |
3043 | 3043 | $resql = $this->db->query($sql); |
3044 | 3044 | if (!$resql) { |
3045 | - $this->errors[] = 'Error ' . $this->db->lasterror(); |
|
3046 | - dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR); |
|
3045 | + $this->errors[] = 'Error '.$this->db->lasterror(); |
|
3046 | + dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR); |
|
3047 | 3047 | |
3048 | 3048 | $error++; |
3049 | 3049 | } else { |
@@ -3058,7 +3058,7 @@ discard block |
||
3058 | 3058 | break; |
3059 | 3059 | } elseif ($result == 0) { |
3060 | 3060 | $langs->loadLangs(array('errors', 'accountancy')); |
3061 | - $this->errors[] = $langs->trans('ErrorRecordNotFound') . ' - ' . $langs->trans('LineId') . ': ' . $obj->rowid; |
|
3061 | + $this->errors[] = $langs->trans('ErrorRecordNotFound').' - '.$langs->trans('LineId').': '.$obj->rowid; |
|
3062 | 3062 | $error++; |
3063 | 3063 | break; |
3064 | 3064 | } |
@@ -296,10 +296,10 @@ |
||
296 | 296 | $cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y; |
297 | 297 | $tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt'); |
298 | 298 | |
299 | - print '<td class="right nowraponall amount" title="'.price($row[2*$i - 2]).' - '.$row[2*$i - 1].' lines">'; |
|
300 | - print price($row[2*$i - 2]); |
|
299 | + print '<td class="right nowraponall amount" title="'.price($row[2 * $i - 2]).' - '.$row[2 * $i - 1].' lines">'; |
|
300 | + print price($row[2 * $i - 2]); |
|
301 | 301 | // Add link to make binding |
302 | - if (!empty(price2num($row[2*$i - 2])) || !empty($row[2*$i - 1])) { |
|
302 | + if (!empty(price2num($row[2 * $i - 2])) || !empty($row[2 * $i - 1])) { |
|
303 | 303 | print '<a href="'.$_SERVER['PHP_SELF'].'?action=validatehistory&year='.$y.'&validatemonth='.((int) $cursormonth).'&validateyear='.((int) $cursoryear).'&token='.newToken().'">'; |
304 | 304 | print img_picto($langs->trans("ValidateHistory").' ('.$langs->trans('Month'.str_pad((string) $cursormonth, 2, '0', STR_PAD_LEFT)).' '.$cursoryear.')', 'link', 'class="marginleft2"'); |
305 | 305 | print '</a>'; |
@@ -135,20 +135,20 @@ discard block |
||
135 | 135 | $sql .= " FROM ".$db->prefix()."facture_fourn as f"; |
136 | 136 | $sql .= " INNER JOIN ".$db->prefix()."societe as s ON s.rowid = f.fk_soc"; |
137 | 137 | if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) { |
138 | - $sql .= " LEFT JOIN " . $db->prefix() . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); |
|
138 | + $sql .= " LEFT JOIN ".$db->prefix()."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity); |
|
139 | 139 | } |
140 | 140 | $sql .= " LEFT JOIN ".$db->prefix()."c_country as co ON co.rowid = s.fk_pays "; |
141 | 141 | $sql .= " INNER JOIN ".$db->prefix()."facture_fourn_det as l ON f.rowid = l.fk_facture_fourn"; |
142 | 142 | $sql .= " LEFT JOIN ".$db->prefix()."product as p ON p.rowid = l.fk_product"; |
143 | 143 | if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
144 | - $sql .= " LEFT JOIN " . $db->prefix() . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); |
|
144 | + $sql .= " LEFT JOIN ".$db->prefix()."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity); |
|
145 | 145 | } |
146 | 146 | $alias_societe_perentity = !getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED') ? "s" : "spe"; |
147 | 147 | $alias_product_perentity = !getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') ? "p" : "ppe"; |
148 | - $sql .= " LEFT JOIN ".$db->prefix()."accounting_account as aa ON " . $alias_product_perentity . ".accountancy_code_buy = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa.entity = ".$conf->entity; |
|
149 | - $sql .= " LEFT JOIN ".$db->prefix()."accounting_account as aa2 ON " . $alias_product_perentity . ".accountancy_code_buy_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity; |
|
150 | - $sql .= " LEFT JOIN ".$db->prefix()."accounting_account as aa3 ON " . $alias_product_perentity . ".accountancy_code_buy_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity; |
|
151 | - $sql .= " LEFT JOIN ".$db->prefix()."accounting_account as aa4 ON " . $alias_product_perentity . ".accountancy_code_buy = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity; |
|
148 | + $sql .= " LEFT JOIN ".$db->prefix()."accounting_account as aa ON ".$alias_product_perentity.".accountancy_code_buy = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa.entity = ".$conf->entity; |
|
149 | + $sql .= " LEFT JOIN ".$db->prefix()."accounting_account as aa2 ON ".$alias_product_perentity.".accountancy_code_buy_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity; |
|
150 | + $sql .= " LEFT JOIN ".$db->prefix()."accounting_account as aa3 ON ".$alias_product_perentity.".accountancy_code_buy_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity; |
|
151 | + $sql .= " LEFT JOIN ".$db->prefix()."accounting_account as aa4 ON ".$alias_product_perentity.".accountancy_code_buy = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity; |
|
152 | 152 | $sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0"; |
153 | 153 | $sql .= " AND l.product_type <= 2"; |
154 | 154 | $sql .= " AND f.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | $thirdpartystatic->email = !empty($objp->email) ? $objp->email : ""; |
191 | 191 | $thirdpartystatic->country_code = !empty($objp->country_code) ? $objp->country_code : ""; |
192 | 192 | $thirdpartystatic->tva_intra = !empty($objp->tva_intra) ? $objp->tva_intra : ""; |
193 | - $thirdpartystatic->code_compta_product = $objp->company_code_buy; // The accounting account for product stored on thirdparty object (for level3 suggestion) |
|
193 | + $thirdpartystatic->code_compta_product = $objp->company_code_buy; // The accounting account for product stored on thirdparty object (for level3 suggestion) |
|
194 | 194 | |
195 | 195 | $product_static->ref = $objp->product_ref; |
196 | 196 | $product_static->id = $objp->product_id; |
@@ -407,10 +407,10 @@ discard block |
||
407 | 407 | $cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y; |
408 | 408 | $tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt'); |
409 | 409 | |
410 | - print '<td class="right nowraponall amount" title="'.price($row[2*$i - 2]).' - '.$row[2*$i - 1].' lines">'; |
|
411 | - print price($row[2*$i - 2]); |
|
410 | + print '<td class="right nowraponall amount" title="'.price($row[2 * $i - 2]).' - '.$row[2 * $i - 1].' lines">'; |
|
411 | + print price($row[2 * $i - 2]); |
|
412 | 412 | // Add link to make binding |
413 | - if (!empty(price2num($row[2*$i - 2])) || !empty($row[2*$i - 1])) { |
|
413 | + if (!empty(price2num($row[2 * $i - 2])) || !empty($row[2 * $i - 1])) { |
|
414 | 414 | print '<a href="'.$_SERVER['PHP_SELF'].'?action=validatehistory&year='.$y.'&validatemonth='.((int) $cursormonth).'&validateyear='.((int) $cursoryear).'&token='.newToken().'">'; |
415 | 415 | print img_picto($langs->trans("ValidateHistory").' ('.$langs->trans('Month'.str_pad((string) $cursormonth, 2, '0', STR_PAD_LEFT)).' '.$cursoryear.')', 'link', 'class="marginleft2"'); |
416 | 416 | print '</a>'; |
@@ -129,20 +129,20 @@ discard block |
||
129 | 129 | $sql .= " co.code as country_code, co.label as country_label,"; |
130 | 130 | $sql .= " s.tva_intra,"; |
131 | 131 | if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) { |
132 | - $sql .= " spe.accountancy_code_sell as company_code_sell"; // accounting code for product but stored on thirdparty |
|
132 | + $sql .= " spe.accountancy_code_sell as company_code_sell"; // accounting code for product but stored on thirdparty |
|
133 | 133 | } else { |
134 | - $sql .= " s.accountancy_code_sell as company_code_sell"; // accounting code for product but stored on thirdparty |
|
134 | + $sql .= " s.accountancy_code_sell as company_code_sell"; // accounting code for product but stored on thirdparty |
|
135 | 135 | } |
136 | 136 | $sql .= " FROM ".$db->prefix()."facture as f"; |
137 | 137 | $sql .= " INNER JOIN ".$db->prefix()."societe as s ON s.rowid = f.fk_soc"; |
138 | 138 | if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) { |
139 | - $sql .= " LEFT JOIN " . $db->prefix() . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); |
|
139 | + $sql .= " LEFT JOIN ".$db->prefix()."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity); |
|
140 | 140 | } |
141 | 141 | $sql .= " LEFT JOIN ".$db->prefix()."c_country as co ON co.rowid = s.fk_pays "; |
142 | - $sql .= " INNER JOIN ".$db->prefix()."facturedet as l ON f.rowid = l.fk_facture"; // the main table |
|
142 | + $sql .= " INNER JOIN ".$db->prefix()."facturedet as l ON f.rowid = l.fk_facture"; // the main table |
|
143 | 143 | $sql .= " LEFT JOIN ".$db->prefix()."product as p ON p.rowid = l.fk_product"; |
144 | 144 | if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
145 | - $sql .= " LEFT JOIN " . $db->prefix() . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); |
|
145 | + $sql .= " LEFT JOIN ".$db->prefix()."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity); |
|
146 | 146 | } |
147 | 147 | $alias_societe_perentity = !getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED') ? "s" : "spe"; |
148 | 148 | $alias_product_perentity = !getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') ? "p" : "ppe"; |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $thirdpartystatic->email = !empty($objp->email) ? $objp->email : ""; |
194 | 194 | $thirdpartystatic->country_code = !empty($objp->country_code) ? $objp->country_code : ""; |
195 | 195 | $thirdpartystatic->tva_intra = !empty($objp->tva_intra) ? $objp->tva_intra : ""; |
196 | - $thirdpartystatic->code_compta_product = !empty($objp->company_code_sell) ? $objp->company_code_sell : ""; // The accounting account for product stored on thirdparty object (for level3 suggestion) |
|
196 | + $thirdpartystatic->code_compta_product = !empty($objp->company_code_sell) ? $objp->company_code_sell : ""; // The accounting account for product stored on thirdparty object (for level3 suggestion) |
|
197 | 197 | |
198 | 198 | $product_static->ref = $objp->product_ref; |
199 | 199 | $product_static->id = $objp->product_id; |
@@ -419,10 +419,10 @@ discard block |
||
419 | 419 | $cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y; |
420 | 420 | $tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt'); |
421 | 421 | |
422 | - print '<td class="right nowraponall amount" title="'.price($row[2*$i - 2]).' - '.$row[2*$i - 1].' lines">'; |
|
423 | - print price($row[2*$i - 2]); |
|
422 | + print '<td class="right nowraponall amount" title="'.price($row[2 * $i - 2]).' - '.$row[2 * $i - 1].' lines">'; |
|
423 | + print price($row[2 * $i - 2]); |
|
424 | 424 | // Add link to make binding |
425 | - if (!empty(price2num($row[2*$i - 2])) || !empty($row[2*$i - 1])) { |
|
425 | + if (!empty(price2num($row[2 * $i - 2])) || !empty($row[2 * $i - 1])) { |
|
426 | 426 | print '<a href="'.$_SERVER['PHP_SELF'].'?action=validatehistory&year='.$y.'&validatemonth='.((int) $cursormonth).'&validateyear='.((int) $cursoryear).'&token='.newToken().'">'; |
427 | 427 | print img_picto($langs->trans("ValidateHistory").' ('.$langs->trans('Month'.str_pad((string) $cursormonth, 2, '0', STR_PAD_LEFT)).' '.$cursoryear.')', 'link', 'class="marginleft2"'); |
428 | 428 | print '</a>'; |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | "MONTH(f.datef) = ".((int) $j), |
660 | 660 | " (".$db->ifsql( |
661 | 661 | "fd.total_ht < 0", |
662 | - " (-1 * (abs(fd.total_ht) - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100))))", // TODO This is bugged, we must use the percent for the invoice and fd.situation_percent is cumulated percent ! |
|
662 | + " (-1 * (abs(fd.total_ht) - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100))))", // TODO This is bugged, we must use the percent for the invoice and fd.situation_percent is cumulated percent ! |
|
663 | 663 | " (fd.total_ht - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100)))" |
664 | 664 | ).")", |
665 | 665 | 0 |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | } |
668 | 668 | $sql .= " SUM(".$db->ifsql( |
669 | 669 | "fd.total_ht < 0", |
670 | - " (-1 * (abs(fd.total_ht) - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100))))", // TODO This is bugged, we must use the percent for the invoice and fd.situation_percent is cumulated percent ! |
|
670 | + " (-1 * (abs(fd.total_ht) - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100))))", // TODO This is bugged, we must use the percent for the invoice and fd.situation_percent is cumulated percent ! |
|
671 | 671 | " (fd.total_ht - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100)))" |
672 | 672 | ).") as total"; |
673 | 673 | } else { |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | if ($result > 0) { |
113 | 113 | setEventMessages($langs->trans("AllMovementsWereRecordedAsValidated"), null, 'mesgs'); |
114 | 114 | |
115 | - header("Location: " . $_SERVER['PHP_SELF'] . (isset($current_fiscal_period) ? '?fiscal_period_id=' . $current_fiscal_period['id'] : '')); |
|
115 | + header("Location: ".$_SERVER['PHP_SELF'].(isset($current_fiscal_period) ? '?fiscal_period_id='.$current_fiscal_period['id'] : '')); |
|
116 | 116 | exit; |
117 | 117 | } else { |
118 | 118 | setEventMessages($langs->trans("NotAllMovementsCouldBeRecordedAsValidated"), null, 'errors'); |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | } else { |
131 | 131 | setEventMessages($langs->trans("AccountancyClosureCloseSuccessfully"), null, 'mesgs'); |
132 | 132 | |
133 | - header("Location: " . $_SERVER['PHP_SELF'] . (isset($current_fiscal_period) ? '?fiscal_period_id=' . $current_fiscal_period['id'] : '')); |
|
133 | + header("Location: ".$_SERVER['PHP_SELF'].(isset($current_fiscal_period) ? '?fiscal_period_id='.$current_fiscal_period['id'] : '')); |
|
134 | 134 | exit; |
135 | 135 | } |
136 | 136 | } elseif ($action == 'confirm_step_3' && $confirm == "yes") { |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | } else { |
146 | 146 | setEventMessages($langs->trans("AccountancyClosureInsertAccountingReversalSuccessfully"), null, 'mesgs'); |
147 | 147 | |
148 | - header("Location: " . $_SERVER['PHP_SELF'] . (isset($current_fiscal_period) ? '?fiscal_period_id=' . $current_fiscal_period['id'] : '')); |
|
148 | + header("Location: ".$_SERVER['PHP_SELF'].(isset($current_fiscal_period) ? '?fiscal_period_id='.$current_fiscal_period['id'] : '')); |
|
149 | 149 | exit; |
150 | 150 | } |
151 | 151 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | ); |
187 | 187 | |
188 | 188 | $formconfirm = $form->formconfirm( |
189 | - $_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $current_fiscal_period['id'], |
|
189 | + $_SERVER["PHP_SELF"].'?fiscal_period_id='.$current_fiscal_period['id'], |
|
190 | 190 | $langs->trans('ValidateMovements'), |
191 | 191 | $langs->trans('DescValidateMovements', $langs->transnoentitiesnoconv("RegistrationInAccounting")), |
192 | 192 | 'confirm_step_1', |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | ); |
224 | 224 | |
225 | 225 | $formconfirm = $form->formconfirm( |
226 | - $_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $current_fiscal_period['id'], |
|
226 | + $_SERVER["PHP_SELF"].'?fiscal_period_id='.$current_fiscal_period['id'], |
|
227 | 227 | $langs->trans('AccountancyClosureClose'), |
228 | 228 | $langs->trans('AccountancyClosureConfirmClose'), |
229 | 229 | 'confirm_step_2', |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | ); |
267 | 267 | |
268 | 268 | $formconfirm = $form->formconfirm( |
269 | - $_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $current_fiscal_period['id'], |
|
269 | + $_SERVER["PHP_SELF"].'?fiscal_period_id='.$current_fiscal_period['id'], |
|
270 | 270 | $langs->trans('AccountancyClosureAccountingReversal'), |
271 | 271 | $langs->trans('AccountancyClosureConfirmAccountingReversal'), |
272 | 272 | 'confirm_step_3', |
@@ -292,13 +292,13 @@ discard block |
||
292 | 292 | |
293 | 293 | $fiscal_period_nav_text = $langs->trans("FiscalPeriod"); |
294 | 294 | |
295 | -$fiscal_period_nav_text .= ' <a href="' . (isset($last_fiscal_period) ? $_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $last_fiscal_period['id'] : '#" class="disabled') . '">' . img_previous() . '</a>'; |
|
296 | -$fiscal_period_nav_text .= ' <a href="' . (isset($next_fiscal_period) ? $_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $next_fiscal_period['id'] : '#" class="disabled') . '">' . img_next() . '</a>'; |
|
295 | +$fiscal_period_nav_text .= ' <a href="'.(isset($last_fiscal_period) ? $_SERVER["PHP_SELF"].'?fiscal_period_id='.$last_fiscal_period['id'] : '#" class="disabled').'">'.img_previous().'</a>'; |
|
296 | +$fiscal_period_nav_text .= ' <a href="'.(isset($next_fiscal_period) ? $_SERVER["PHP_SELF"].'?fiscal_period_id='.$next_fiscal_period['id'] : '#" class="disabled').'">'.img_next().'</a>'; |
|
297 | 297 | if (!empty($current_fiscal_period)) { |
298 | - $fiscal_period_nav_text .= $current_fiscal_period['label'].' (' . (isset($current_fiscal_period) ? dol_print_date($current_fiscal_period['date_start'], 'day') . ' - ' . dol_print_date($current_fiscal_period['date_end'], 'day') . ')' : ''); |
|
298 | + $fiscal_period_nav_text .= $current_fiscal_period['label'].' ('.(isset($current_fiscal_period) ? dol_print_date($current_fiscal_period['date_start'], 'day').' - '.dol_print_date($current_fiscal_period['date_end'], 'day').')' : ''); |
|
299 | 299 | } |
300 | 300 | |
301 | -print load_fiche_titre($langs->trans("Closure") . " - " . $fiscal_period_nav_text, '', 'title_accountancy'); |
|
301 | +print load_fiche_titre($langs->trans("Closure")." - ".$fiscal_period_nav_text, '', 'title_accountancy'); |
|
302 | 302 | |
303 | 303 | if (empty($current_fiscal_period)) { |
304 | 304 | print $langs->trans('ErrorNoFiscalPeriodActiveFound', $langs->transnoentitiesnoconv("Accounting"), $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("FiscalPeriod")); |
@@ -307,12 +307,12 @@ discard block |
||
307 | 307 | if (isset($current_fiscal_period)) { |
308 | 308 | // Step 1 |
309 | 309 | $head = array(); |
310 | - $head[0][0] = DOL_URL_ROOT . '/accountancy/closure/index.php?fiscal_period_id=' . $current_fiscal_period['id']; |
|
310 | + $head[0][0] = DOL_URL_ROOT.'/accountancy/closure/index.php?fiscal_period_id='.$current_fiscal_period['id']; |
|
311 | 311 | $head[0][1] = $langs->trans("AccountancyClosureStep1"); |
312 | 312 | $head[0][2] = 'step1'; |
313 | 313 | print dol_get_fiche_head($head, 'step1', '', -1, ''); |
314 | 314 | |
315 | - print '<span class="opacitymedium">' . $langs->trans("AccountancyClosureStep1Desc") . '</span><br>'; |
|
315 | + print '<span class="opacitymedium">'.$langs->trans("AccountancyClosureStep1Desc").'</span><br>'; |
|
316 | 316 | |
317 | 317 | $count_by_month = $object->getCountByMonthForFiscalPeriod($current_fiscal_period['date_start'], $current_fiscal_period['date_end']); |
318 | 318 | if (!is_array($count_by_month)) { |
@@ -320,9 +320,9 @@ discard block |
||
320 | 320 | } |
321 | 321 | |
322 | 322 | if (empty($count_by_month['total'])) { |
323 | - $buttonvalidate = '<a class="butActionRefused classfortooltip" href="#">' . $langs->trans("ValidateMovements") . '</a>'; |
|
323 | + $buttonvalidate = '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("ValidateMovements").'</a>'; |
|
324 | 324 | } else { |
325 | - $buttonvalidate = '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=step_1&fiscal_period_id=' . $current_fiscal_period['id'] . '">' . $langs->trans("ValidateMovements") . '</a>'; |
|
325 | + $buttonvalidate = '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=step_1&fiscal_period_id='.$current_fiscal_period['id'].'">'.$langs->trans("ValidateMovements").'</a>'; |
|
326 | 326 | } |
327 | 327 | print_barre_liste($langs->trans("OverviewOfMovementsNotValidated"), '', '', '', '', '', '', -1, '', '', 0, $buttonvalidate, '', 0, 1, 0); |
328 | 328 | |
@@ -332,24 +332,24 @@ discard block |
||
332 | 332 | print '<tr class="liste_titre">'; |
333 | 333 | $nb_years = is_array($count_by_month['list']) ? count($count_by_month['list']) : 0; |
334 | 334 | if ($nb_years > 1) { |
335 | - print '<td class="right">' . $langs->trans("Year") . '</td>'; |
|
335 | + print '<td class="right">'.$langs->trans("Year").'</td>'; |
|
336 | 336 | } |
337 | 337 | for ($i = 1; $i <= 12; $i++) { |
338 | - print '<td class="right">' . $langs->trans('MonthShort' . str_pad((string) $i, 2, '0', STR_PAD_LEFT)) . '</td>'; |
|
338 | + print '<td class="right">'.$langs->trans('MonthShort'.str_pad((string) $i, 2, '0', STR_PAD_LEFT)).'</td>'; |
|
339 | 339 | } |
340 | - print '<td class="right"><b>' . $langs->trans("Total") . '</b></td>'; |
|
340 | + print '<td class="right"><b>'.$langs->trans("Total").'</b></td>'; |
|
341 | 341 | print '</tr>'; |
342 | 342 | |
343 | 343 | if (is_array($count_by_month['list'])) { |
344 | 344 | foreach ($count_by_month['list'] as $info) { |
345 | 345 | print '<tr class="oddeven">'; |
346 | 346 | if ($nb_years > 1) { |
347 | - print '<td class="right">' . $info['year'] . '</td>'; |
|
347 | + print '<td class="right">'.$info['year'].'</td>'; |
|
348 | 348 | } |
349 | 349 | for ($i = 1; $i <= 12; $i++) { |
350 | - print '<td class="right">' . ((int) $info['count'][$i]) . '</td>'; |
|
350 | + print '<td class="right">'.((int) $info['count'][$i]).'</td>'; |
|
351 | 351 | } |
352 | - print '<td class="right"><b>' . $info['total'] . '</b></td></tr>'; |
|
352 | + print '<td class="right"><b>'.$info['total'].'</b></td></tr>'; |
|
353 | 353 | } |
354 | 354 | } |
355 | 355 | |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | |
361 | 361 | // Step 2 |
362 | 362 | $head = array(); |
363 | - $head[0][0] = DOL_URL_ROOT . '/accountancy/closure/index.php?fiscal_period_id=' . $current_fiscal_period['id']; |
|
363 | + $head[0][0] = DOL_URL_ROOT.'/accountancy/closure/index.php?fiscal_period_id='.$current_fiscal_period['id']; |
|
364 | 364 | $head[0][1] = $langs->trans("AccountancyClosureStep2"); |
365 | 365 | $head[0][2] = 'step2'; |
366 | 366 | print dol_get_fiche_head($head, 'step2', '', -1, ''); |
@@ -368,9 +368,9 @@ discard block |
||
368 | 368 | // print '<span class="opacitymedium">' . $langs->trans("AccountancyClosureStep2Desc") . '</span><br>'; |
369 | 369 | |
370 | 370 | if (empty($count_by_month['total']) && empty($current_fiscal_period['status'])) { |
371 | - $button = '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=step_2&fiscal_period_id=' . $current_fiscal_period['id'] . '">' . $langs->trans("AccountancyClosureClose") . '</a>'; |
|
371 | + $button = '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=step_2&fiscal_period_id='.$current_fiscal_period['id'].'">'.$langs->trans("AccountancyClosureClose").'</a>'; |
|
372 | 372 | } else { |
373 | - $button = '<a class="butActionRefused classfortooltip" href="#">' . $langs->trans("AccountancyClosureClose") . '</a>'; |
|
373 | + $button = '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AccountancyClosureClose").'</a>'; |
|
374 | 374 | } |
375 | 375 | print_barre_liste('', '', '', '', '', '', '', -1, '', '', 0, $button, '', 0, 1, 0); |
376 | 376 | |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | |
379 | 379 | // Step 3 |
380 | 380 | $head = array(); |
381 | - $head[0][0] = DOL_URL_ROOT . '/accountancy/closure/index.php?fiscal_period_id=' . $current_fiscal_period['id']; |
|
381 | + $head[0][0] = DOL_URL_ROOT.'/accountancy/closure/index.php?fiscal_period_id='.$current_fiscal_period['id']; |
|
382 | 382 | $head[0][1] = $langs->trans("AccountancyClosureStep3"); |
383 | 383 | $head[0][2] = 'step3'; |
384 | 384 | print dol_get_fiche_head($head, 'step3', '', -1, ''); |
@@ -386,9 +386,9 @@ discard block |
||
386 | 386 | // print '<span class="opacitymedium">' . $langs->trans("AccountancyClosureStep3Desc") . '</span><br>'; |
387 | 387 | |
388 | 388 | if (empty($current_fiscal_period['status'])) { |
389 | - $button = '<a class="butActionRefused classfortooltip" href="#">' . $langs->trans("AccountancyClosureAccountingReversal") . '</a>'; |
|
389 | + $button = '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AccountancyClosureAccountingReversal").'</a>'; |
|
390 | 390 | } else { |
391 | - $button = '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=step_3&fiscal_period_id=' . $current_fiscal_period['id'] . '">' . $langs->trans("AccountancyClosureAccountingReversal") . '</a>'; |
|
391 | + $button = '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=step_3&fiscal_period_id='.$current_fiscal_period['id'].'">'.$langs->trans("AccountancyClosureAccountingReversal").'</a>'; |
|
392 | 392 | } |
393 | 393 | print_barre_liste('', '', '', '', '', '', '', -1, '', '', 0, $button, '', 0, 1, 0); |
394 | 394 | } |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | } |
401 | 401 | } |
402 | 402 | if ($emailtoadd && preg_match('/'.preg_quote($emailtoadd, '/').'/i', $to)) { |
403 | - $emailtoadd = ''; // Email already in the "To" |
|
403 | + $emailtoadd = ''; // Email already in the "To" |
|
404 | 404 | } |
405 | 405 | if ($emailtoadd) { |
406 | 406 | $listofemailstoadd[$key] = $emailtoadd; |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | $this->buildCSS(); |
595 | 595 | } |
596 | 596 | $msg = $this->html; |
597 | - $msg = $this->checkIfHTML($msg); // This add a header and a body including custom CSS to the HTML content |
|
597 | + $msg = $this->checkIfHTML($msg); // This add a header and a body including custom CSS to the HTML content |
|
598 | 598 | } |
599 | 599 | |
600 | 600 | // Replace . alone on a new line with .. to avoid to have SMTP interpret this as end of message |
@@ -743,7 +743,7 @@ discard block |
||
743 | 743 | $this->buildCSS(); |
744 | 744 | } |
745 | 745 | $msg = $this->html; |
746 | - $msg = $this->checkIfHTML($msg); // This add a header and a body including custom CSS to the HTML content |
|
746 | + $msg = $this->checkIfHTML($msg); // This add a header and a body including custom CSS to the HTML content |
|
747 | 747 | } |
748 | 748 | |
749 | 749 | if ($this->atleastoneimage) { |
@@ -1147,7 +1147,7 @@ discard block |
||
1147 | 1147 | if ($apiService instanceof OAuth\OAuth2\Service\AbstractService || $apiService instanceof OAuth\OAuth1\Service\AbstractService) { |
1148 | 1148 | // ServiceInterface does not provide refreshAccessToken, AbstractService does |
1149 | 1149 | $tokenobj = $apiService->refreshAccessToken($tokenobj); |
1150 | - $tokenobj->setRefreshToken($refreshtoken); // Restore the refresh token |
|
1150 | + $tokenobj->setRefreshToken($refreshtoken); // Restore the refresh token |
|
1151 | 1151 | $storage->storeAccessToken($OAUTH_SERVICENAME, $tokenobj); |
1152 | 1152 | } |
1153 | 1153 | |
@@ -1169,19 +1169,19 @@ discard block |
||
1169 | 1169 | $res = true; |
1170 | 1170 | $from = $this->smtps->getFrom('org'); |
1171 | 1171 | if ($res && !$from) { |
1172 | - $this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=" . getDolGlobalString($keyforsmtpport)." - Sender address '$from' invalid"; |
|
1172 | + $this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=".getDolGlobalString($keyforsmtpport)." - Sender address '$from' invalid"; |
|
1173 | 1173 | dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR); |
1174 | 1174 | $res = false; |
1175 | 1175 | } |
1176 | 1176 | $dest = $this->smtps->getTo(); |
1177 | 1177 | if ($res && !$dest) { |
1178 | - $this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=" . getDolGlobalString($keyforsmtpport)." - Recipient address '$dest' invalid"; |
|
1178 | + $this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=".getDolGlobalString($keyforsmtpport)." - Recipient address '$dest' invalid"; |
|
1179 | 1179 | dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR); |
1180 | 1180 | $res = false; |
1181 | 1181 | } |
1182 | 1182 | |
1183 | 1183 | if ($res) { |
1184 | - dol_syslog("CMailFile::sendfile: sendMsg, HOST=".$server.", PORT=" . getDolGlobalString($keyforsmtpport), LOG_NOTICE); |
|
1184 | + dol_syslog("CMailFile::sendfile: sendMsg, HOST=".$server.", PORT=".getDolGlobalString($keyforsmtpport), LOG_NOTICE); |
|
1185 | 1185 | |
1186 | 1186 | if (getDolGlobalString('MAIN_MAIL_DEBUG')) { |
1187 | 1187 | $this->smtps->setDebug(true); |
@@ -1194,8 +1194,8 @@ discard block |
||
1194 | 1194 | } |
1195 | 1195 | |
1196 | 1196 | $smtperrorcode = 0; |
1197 | - if (! $result) { |
|
1198 | - $smtperrorcode = $this->smtps->lastretval; // SMTP error code |
|
1197 | + if (!$result) { |
|
1198 | + $smtperrorcode = $this->smtps->lastretval; // SMTP error code |
|
1199 | 1199 | dol_syslog("CMailFile::sendfile: mail SMTP error code ".$smtperrorcode, LOG_WARNING); |
1200 | 1200 | |
1201 | 1201 | if ($smtperrorcode == '421') { // Try later |
@@ -1213,7 +1213,7 @@ discard block |
||
1213 | 1213 | } |
1214 | 1214 | } |
1215 | 1215 | |
1216 | - $result = $this->smtps->getErrors(); // applicative error code (not SMTP error code) |
|
1216 | + $result = $this->smtps->getErrors(); // applicative error code (not SMTP error code) |
|
1217 | 1217 | if (empty($this->error) && empty($result)) { |
1218 | 1218 | dol_syslog("CMailFile::sendfile: mail end success", LOG_DEBUG); |
1219 | 1219 | $res = true; |
@@ -1221,7 +1221,7 @@ discard block |
||
1221 | 1221 | if (empty($this->error)) { |
1222 | 1222 | $this->error = $result; |
1223 | 1223 | } |
1224 | - dol_syslog("CMailFile::sendfile: mail end error with smtps lib to HOST=".$server.", PORT=" . getDolGlobalString($keyforsmtpport)." - ".$this->error, LOG_ERR); |
|
1224 | + dol_syslog("CMailFile::sendfile: mail end error with smtps lib to HOST=".$server.", PORT=".getDolGlobalString($keyforsmtpport)." - ".$this->error, LOG_ERR); |
|
1225 | 1225 | $res = false; |
1226 | 1226 | |
1227 | 1227 | if (getDolGlobalString('MAIN_MAIL_DEBUG')) { |
@@ -1358,7 +1358,7 @@ discard block |
||
1358 | 1358 | $this->mailer->registerPlugin(new Swift_Plugins_LoggerPlugin($this->logger)); |
1359 | 1359 | } |
1360 | 1360 | |
1361 | - dol_syslog("CMailFile::sendfile: mailer->send, HOST=".$server.", PORT=" . getDolGlobalString($keyforsmtpport), LOG_NOTICE); |
|
1361 | + dol_syslog("CMailFile::sendfile: mailer->send, HOST=".$server.", PORT=".getDolGlobalString($keyforsmtpport), LOG_NOTICE); |
|
1362 | 1362 | |
1363 | 1363 | // send mail |
1364 | 1364 | $failedRecipients = array(); |
@@ -1374,10 +1374,10 @@ discard block |
||
1374 | 1374 | $res = true; |
1375 | 1375 | if (!empty($this->error) || !empty($this->errors) || !$result) { |
1376 | 1376 | if (!empty($failedRecipients)) { |
1377 | - $this->error = 'Transport failed for the following addresses: "' . implode('", "', $failedRecipients) . '".'; |
|
1377 | + $this->error = 'Transport failed for the following addresses: "'.implode('", "', $failedRecipients).'".'; |
|
1378 | 1378 | $this->errors[] = $this->error; |
1379 | 1379 | } |
1380 | - dol_syslog("CMailFile::sendfile: mail end error=". join(' ', $this->errors), LOG_ERR); |
|
1380 | + dol_syslog("CMailFile::sendfile: mail end error=".join(' ', $this->errors), LOG_ERR); |
|
1381 | 1381 | $res = false; |
1382 | 1382 | |
1383 | 1383 | if (getDolGlobalString('MAIN_MAIL_DEBUG')) { |
@@ -1472,7 +1472,7 @@ discard block |
||
1472 | 1472 | |
1473 | 1473 | if (@is_writable($dolibarr_main_data_root)) { // Avoid fatal error on fopen with open_basedir |
1474 | 1474 | $outputfile = $dolibarr_main_data_root."/dolibarr_mail.log"; |
1475 | - $fp = fopen($outputfile, "w"); // overwrite |
|
1475 | + $fp = fopen($outputfile, "w"); // overwrite |
|
1476 | 1476 | |
1477 | 1477 | if ($this->sendmode == 'mail') { |
1478 | 1478 | fwrite($fp, $this->headers); |
@@ -1735,11 +1735,11 @@ discard block |
||
1735 | 1735 | // Similar code to forge a text from html is also in smtps.class.php |
1736 | 1736 | $strContentAltText = preg_replace("/<br\s*[^>]*>/", " ", $strContent); |
1737 | 1737 | // TODO We could replace <img ...> with [Filename.ext] like Gmail do. |
1738 | - $strContentAltText = html_entity_decode(strip_tags($strContentAltText)); // Remove any HTML tags |
|
1738 | + $strContentAltText = html_entity_decode(strip_tags($strContentAltText)); // Remove any HTML tags |
|
1739 | 1739 | $strContentAltText = trim(wordwrap($strContentAltText, 75, !getDolGlobalString('MAIN_FIX_FOR_BUGGED_MTA') ? "\r\n" : "\n")); |
1740 | 1740 | |
1741 | 1741 | // Check if html header already in message, if not complete the message |
1742 | - $strContent = $this->checkIfHTML($strContent); // This add a header and a body including custom CSS to the HTML content |
|
1742 | + $strContent = $this->checkIfHTML($strContent); // This add a header and a body including custom CSS to the HTML content |
|
1743 | 1743 | } |
1744 | 1744 | |
1745 | 1745 | // Make RFC2045 Compliant, split lines |
@@ -2124,7 +2124,7 @@ discard block |
||
2124 | 2124 | // We save the image to send in disk |
2125 | 2125 | $filecontent = $matches[2][$key]; |
2126 | 2126 | |
2127 | - $cid = 'cid000'.dol_hash($filecontent, 'md5'); // The id must not change if image is same |
|
2127 | + $cid = 'cid000'.dol_hash($filecontent, 'md5'); // The id must not change if image is same |
|
2128 | 2128 | |
2129 | 2129 | $destfiletmp = $images_dir.'/'.$cid.'.'.$ext; |
2130 | 2130 |