@@ -29,138 +29,138 @@ |
||
29 | 29 | |
30 | 30 | if ($massaction == 'predeletedraft') |
31 | 31 | { |
32 | - print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassDraftDeletion"), $langs->trans("ConfirmMassDeletionQuestion", count($toselect)), "delete", null, '', 0, 200, 500, 1); |
|
32 | + print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassDraftDeletion"), $langs->trans("ConfirmMassDeletionQuestion", count($toselect)), "delete", null, '', 0, 200, 500, 1); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | if ($massaction == 'predelete') |
36 | 36 | { |
37 | - print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassDeletion"), $langs->trans("ConfirmMassDeletionQuestion", count($toselect)), "delete", null, '', 0, 200, 500, 1); |
|
37 | + print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassDeletion"), $langs->trans("ConfirmMassDeletionQuestion", count($toselect)), "delete", null, '', 0, 200, 500, 1); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | if ($massaction == 'presend') |
41 | 41 | { |
42 | - $langs->load("mails"); |
|
42 | + $langs->load("mails"); |
|
43 | 43 | |
44 | - $listofselectedid = array(); |
|
45 | - $listofselectedthirdparties = array(); |
|
46 | - $listofselectedref = array(); |
|
44 | + $listofselectedid = array(); |
|
45 | + $listofselectedthirdparties = array(); |
|
46 | + $listofselectedref = array(); |
|
47 | 47 | |
48 | - if (! GETPOST('cancel', 'alpha')) |
|
49 | - { |
|
50 | - foreach ($arrayofselected as $toselectid) |
|
51 | - { |
|
52 | - $result = $objecttmp->fetch($toselectid); |
|
53 | - if ($result > 0) |
|
54 | - { |
|
55 | - $listofselectedid[$toselectid] = $toselectid; |
|
56 | - $thirdpartyid = ($objecttmp->fk_soc ? $objecttmp->fk_soc : $objecttmp->socid); |
|
57 | - if ($objecttmp->element == 'societe') |
|
58 | - $thirdpartyid = $objecttmp->id; |
|
59 | - if ($objecttmp->element == 'expensereport') |
|
60 | - $thirdpartyid = $objecttmp->fk_user_author; |
|
61 | - $listofselectedthirdparties[$thirdpartyid] = $thirdpartyid; |
|
62 | - $listofselectedref[$thirdpartyid][$toselectid] = $objecttmp->ref; |
|
63 | - } |
|
64 | - } |
|
65 | - } |
|
66 | - |
|
67 | - print '<input type="hidden" name="massaction" value="confirm_presend">'; |
|
68 | - |
|
69 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
70 | - $formmail = new FormMail($db); |
|
71 | - |
|
72 | - dol_fiche_head(null, '', ''); |
|
73 | - |
|
74 | - // Cree l'objet formulaire mail |
|
75 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
76 | - $formmail = new FormMail($db); |
|
77 | - $formmail->withform = -1; |
|
78 | - $formmail->fromtype = (GETPOST('fromtype') ? GETPOST('fromtype') : (! empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) ? $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE : 'user')); |
|
79 | - |
|
80 | - if ($formmail->fromtype === 'user') |
|
81 | - { |
|
82 | - $formmail->fromid = $user->id; |
|
83 | - } |
|
84 | - $formmail->trackid = $trackid; |
|
85 | - if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set |
|
86 | - { |
|
87 | - include DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; |
|
88 | - $formmail->frommail = dolAddEmailTrackId($formmail->frommail, $trackid); |
|
89 | - } |
|
90 | - $formmail->withfrom = 1; |
|
91 | - $liste = $langs->trans("AllRecipientSelected", count($arrayofselected)); |
|
92 | - if (count($listofselectedthirdparties) == 1) // Only 1 different recipient selected, we can suggest contacts |
|
93 | - { |
|
94 | - $liste = array(); |
|
95 | - $thirdpartyid = array_shift($listofselectedthirdparties); |
|
96 | - if ($objecttmp->element == 'expensereport') |
|
97 | - { |
|
98 | - $fuser = new User($db); |
|
99 | - $fuser->fetch($thirdpartyid); |
|
100 | - $liste['thirdparty'] = $fuser->getFullName($langs)." <".$fuser->email.">"; |
|
101 | - } |
|
102 | - else |
|
103 | - { |
|
104 | - $soc = new Societe($db); |
|
105 | - $soc->fetch($thirdpartyid); |
|
106 | - foreach ($soc->thirdparty_and_contact_email_array(1) as $key => $value) { |
|
107 | - $liste[$key] = $value; |
|
108 | - } |
|
109 | - } |
|
110 | - $formmail->withtoreadonly = 0; |
|
111 | - } else { |
|
112 | - $formmail->withtoreadonly = 1; |
|
113 | - } |
|
48 | + if (! GETPOST('cancel', 'alpha')) |
|
49 | + { |
|
50 | + foreach ($arrayofselected as $toselectid) |
|
51 | + { |
|
52 | + $result = $objecttmp->fetch($toselectid); |
|
53 | + if ($result > 0) |
|
54 | + { |
|
55 | + $listofselectedid[$toselectid] = $toselectid; |
|
56 | + $thirdpartyid = ($objecttmp->fk_soc ? $objecttmp->fk_soc : $objecttmp->socid); |
|
57 | + if ($objecttmp->element == 'societe') |
|
58 | + $thirdpartyid = $objecttmp->id; |
|
59 | + if ($objecttmp->element == 'expensereport') |
|
60 | + $thirdpartyid = $objecttmp->fk_user_author; |
|
61 | + $listofselectedthirdparties[$thirdpartyid] = $thirdpartyid; |
|
62 | + $listofselectedref[$thirdpartyid][$toselectid] = $objecttmp->ref; |
|
63 | + } |
|
64 | + } |
|
65 | + } |
|
66 | + |
|
67 | + print '<input type="hidden" name="massaction" value="confirm_presend">'; |
|
68 | + |
|
69 | + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
70 | + $formmail = new FormMail($db); |
|
71 | + |
|
72 | + dol_fiche_head(null, '', ''); |
|
73 | + |
|
74 | + // Cree l'objet formulaire mail |
|
75 | + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
76 | + $formmail = new FormMail($db); |
|
77 | + $formmail->withform = -1; |
|
78 | + $formmail->fromtype = (GETPOST('fromtype') ? GETPOST('fromtype') : (! empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) ? $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE : 'user')); |
|
79 | + |
|
80 | + if ($formmail->fromtype === 'user') |
|
81 | + { |
|
82 | + $formmail->fromid = $user->id; |
|
83 | + } |
|
84 | + $formmail->trackid = $trackid; |
|
85 | + if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set |
|
86 | + { |
|
87 | + include DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; |
|
88 | + $formmail->frommail = dolAddEmailTrackId($formmail->frommail, $trackid); |
|
89 | + } |
|
90 | + $formmail->withfrom = 1; |
|
91 | + $liste = $langs->trans("AllRecipientSelected", count($arrayofselected)); |
|
92 | + if (count($listofselectedthirdparties) == 1) // Only 1 different recipient selected, we can suggest contacts |
|
93 | + { |
|
94 | + $liste = array(); |
|
95 | + $thirdpartyid = array_shift($listofselectedthirdparties); |
|
96 | + if ($objecttmp->element == 'expensereport') |
|
97 | + { |
|
98 | + $fuser = new User($db); |
|
99 | + $fuser->fetch($thirdpartyid); |
|
100 | + $liste['thirdparty'] = $fuser->getFullName($langs)." <".$fuser->email.">"; |
|
101 | + } |
|
102 | + else |
|
103 | + { |
|
104 | + $soc = new Societe($db); |
|
105 | + $soc->fetch($thirdpartyid); |
|
106 | + foreach ($soc->thirdparty_and_contact_email_array(1) as $key => $value) { |
|
107 | + $liste[$key] = $value; |
|
108 | + } |
|
109 | + } |
|
110 | + $formmail->withtoreadonly = 0; |
|
111 | + } else { |
|
112 | + $formmail->withtoreadonly = 1; |
|
113 | + } |
|
114 | 114 | |
115 | - $formmail->withoptiononeemailperrecipient = (count($listofselectedref) == 1 || empty($liste))? 0 : ((GETPOST('oneemailperrecipient')=='on')?1:-1); |
|
116 | - $formmail->withto = empty($liste)?(GETPOST('sendto','alpha')?GETPOST('sendto','alpha'):array()):$liste; |
|
117 | - $formmail->withtofree = empty($liste)?1:0; |
|
118 | - $formmail->withtocc = 1; |
|
119 | - $formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC; |
|
120 | - $formmail->withtopic = $langs->transnoentities($topicmail, '__REF__', '__REFCLIENT__'); |
|
121 | - $formmail->withfile = 1; |
|
122 | - // $formmail->withfile = 2; Not yet supported in mass action |
|
123 | - $formmail->withmaindocfile = 1; // Add a checkbox "Attach also main document" |
|
124 | - if ($objecttmp->element != 'societe') { |
|
125 | - $formmail->withfile = '<span class="hideonsmartphone">'.$langs->trans("OnlyPDFattachmentSupported").'</span>'; |
|
126 | - $formmail->withmaindocfile = - 1; // Add a checkbox "Attach also main document" but not checked by default |
|
127 | - } |
|
128 | - $formmail->withbody = 1; |
|
129 | - $formmail->withdeliveryreceipt = 1; |
|
130 | - $formmail->withcancel = 1; |
|
131 | - |
|
132 | - // Make substitution in email content |
|
133 | - $substitutionarray = getCommonSubstitutionArray($langs, 0, null, $object); |
|
134 | - $substitutionarray['__EMAIL__'] = $sendto; |
|
135 | - $substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty)) ? '<img src="' . DOL_MAIN_URL_ROOT . '/public/emailing/mailing-read.php?tag=' . $object->thirdparty->tag . '&securitykey=' . urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY) . '" width="1" height="1" style="width:1px;height:1px" border="0"/>' : ''; |
|
136 | - $substitutionarray['__PERSONALIZED__'] = ''; // deprecated |
|
137 | - $substitutionarray['__CONTACTCIVNAME__'] = ''; |
|
138 | - |
|
139 | - $parameters = array( |
|
140 | - 'mode' => 'formemail' |
|
141 | - ); |
|
142 | - complete_substitutions_array($substitutionarray, $langs, $object, $parameters); |
|
143 | - |
|
144 | - // Tableau des substitutions |
|
145 | - $formmail->substit = $substitutionarray; |
|
146 | - |
|
147 | - // Tableau des parametres complementaires du post |
|
148 | - $formmail->param['action'] = $action; |
|
149 | - $formmail->param['models'] = $modelmail; |
|
150 | - $formmail->param['models_id'] = GETPOST('modelmailselected', 'int'); |
|
151 | - $formmail->param['id'] = join(',', $arrayofselected); |
|
152 | - // $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; |
|
153 | - if (! empty($conf->global->MAILING_LIMIT_SENDBYWEB) && count($listofselectedthirdparties) > $conf->global->MAILING_LIMIT_SENDBYWEB) |
|
154 | - { |
|
155 | - $langs->load("errors"); |
|
156 | - print img_warning() . ' ' . $langs->trans('WarningNumberOfRecipientIsRestrictedInMassAction', $conf->global->MAILING_LIMIT_SENDBYWEB); |
|
157 | - print ' - <a href="javascript: window.history.go(-1)">' . $langs->trans("GoBack") . '</a>'; |
|
158 | - $arrayofmassactions = array(); |
|
159 | - } |
|
160 | - else |
|
161 | - { |
|
162 | - print $formmail->get_form(); |
|
163 | - } |
|
164 | - |
|
165 | - dol_fiche_end(); |
|
115 | + $formmail->withoptiononeemailperrecipient = (count($listofselectedref) == 1 || empty($liste))? 0 : ((GETPOST('oneemailperrecipient')=='on')?1:-1); |
|
116 | + $formmail->withto = empty($liste)?(GETPOST('sendto','alpha')?GETPOST('sendto','alpha'):array()):$liste; |
|
117 | + $formmail->withtofree = empty($liste)?1:0; |
|
118 | + $formmail->withtocc = 1; |
|
119 | + $formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC; |
|
120 | + $formmail->withtopic = $langs->transnoentities($topicmail, '__REF__', '__REFCLIENT__'); |
|
121 | + $formmail->withfile = 1; |
|
122 | + // $formmail->withfile = 2; Not yet supported in mass action |
|
123 | + $formmail->withmaindocfile = 1; // Add a checkbox "Attach also main document" |
|
124 | + if ($objecttmp->element != 'societe') { |
|
125 | + $formmail->withfile = '<span class="hideonsmartphone">'.$langs->trans("OnlyPDFattachmentSupported").'</span>'; |
|
126 | + $formmail->withmaindocfile = - 1; // Add a checkbox "Attach also main document" but not checked by default |
|
127 | + } |
|
128 | + $formmail->withbody = 1; |
|
129 | + $formmail->withdeliveryreceipt = 1; |
|
130 | + $formmail->withcancel = 1; |
|
131 | + |
|
132 | + // Make substitution in email content |
|
133 | + $substitutionarray = getCommonSubstitutionArray($langs, 0, null, $object); |
|
134 | + $substitutionarray['__EMAIL__'] = $sendto; |
|
135 | + $substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty)) ? '<img src="' . DOL_MAIN_URL_ROOT . '/public/emailing/mailing-read.php?tag=' . $object->thirdparty->tag . '&securitykey=' . urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY) . '" width="1" height="1" style="width:1px;height:1px" border="0"/>' : ''; |
|
136 | + $substitutionarray['__PERSONALIZED__'] = ''; // deprecated |
|
137 | + $substitutionarray['__CONTACTCIVNAME__'] = ''; |
|
138 | + |
|
139 | + $parameters = array( |
|
140 | + 'mode' => 'formemail' |
|
141 | + ); |
|
142 | + complete_substitutions_array($substitutionarray, $langs, $object, $parameters); |
|
143 | + |
|
144 | + // Tableau des substitutions |
|
145 | + $formmail->substit = $substitutionarray; |
|
146 | + |
|
147 | + // Tableau des parametres complementaires du post |
|
148 | + $formmail->param['action'] = $action; |
|
149 | + $formmail->param['models'] = $modelmail; |
|
150 | + $formmail->param['models_id'] = GETPOST('modelmailselected', 'int'); |
|
151 | + $formmail->param['id'] = join(',', $arrayofselected); |
|
152 | + // $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; |
|
153 | + if (! empty($conf->global->MAILING_LIMIT_SENDBYWEB) && count($listofselectedthirdparties) > $conf->global->MAILING_LIMIT_SENDBYWEB) |
|
154 | + { |
|
155 | + $langs->load("errors"); |
|
156 | + print img_warning() . ' ' . $langs->trans('WarningNumberOfRecipientIsRestrictedInMassAction', $conf->global->MAILING_LIMIT_SENDBYWEB); |
|
157 | + print ' - <a href="javascript: window.history.go(-1)">' . $langs->trans("GoBack") . '</a>'; |
|
158 | + $arrayofmassactions = array(); |
|
159 | + } |
|
160 | + else |
|
161 | + { |
|
162 | + print $formmail->get_form(); |
|
163 | + } |
|
164 | + |
|
165 | + dol_fiche_end(); |
|
166 | 166 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $listofselectedthirdparties = array(); |
46 | 46 | $listofselectedref = array(); |
47 | 47 | |
48 | - if (! GETPOST('cancel', 'alpha')) |
|
48 | + if (!GETPOST('cancel', 'alpha')) |
|
49 | 49 | { |
50 | 50 | foreach ($arrayofselected as $toselectid) |
51 | 51 | { |
@@ -66,25 +66,25 @@ discard block |
||
66 | 66 | |
67 | 67 | print '<input type="hidden" name="massaction" value="confirm_presend">'; |
68 | 68 | |
69 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
69 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
70 | 70 | $formmail = new FormMail($db); |
71 | 71 | |
72 | 72 | dol_fiche_head(null, '', ''); |
73 | 73 | |
74 | 74 | // Cree l'objet formulaire mail |
75 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
75 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
76 | 76 | $formmail = new FormMail($db); |
77 | 77 | $formmail->withform = -1; |
78 | - $formmail->fromtype = (GETPOST('fromtype') ? GETPOST('fromtype') : (! empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) ? $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE : 'user')); |
|
78 | + $formmail->fromtype = (GETPOST('fromtype') ? GETPOST('fromtype') : (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) ? $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE : 'user')); |
|
79 | 79 | |
80 | 80 | if ($formmail->fromtype === 'user') |
81 | 81 | { |
82 | 82 | $formmail->fromid = $user->id; |
83 | 83 | } |
84 | 84 | $formmail->trackid = $trackid; |
85 | - if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set |
|
85 | + if (!empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set |
|
86 | 86 | { |
87 | - include DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; |
|
87 | + include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
|
88 | 88 | $formmail->frommail = dolAddEmailTrackId($formmail->frommail, $trackid); |
89 | 89 | } |
90 | 90 | $formmail->withfrom = 1; |
@@ -112,9 +112,9 @@ discard block |
||
112 | 112 | $formmail->withtoreadonly = 1; |
113 | 113 | } |
114 | 114 | |
115 | - $formmail->withoptiononeemailperrecipient = (count($listofselectedref) == 1 || empty($liste))? 0 : ((GETPOST('oneemailperrecipient')=='on')?1:-1); |
|
116 | - $formmail->withto = empty($liste)?(GETPOST('sendto','alpha')?GETPOST('sendto','alpha'):array()):$liste; |
|
117 | - $formmail->withtofree = empty($liste)?1:0; |
|
115 | + $formmail->withoptiononeemailperrecipient = (count($listofselectedref) == 1 || empty($liste)) ? 0 : ((GETPOST('oneemailperrecipient') == 'on') ? 1 : -1); |
|
116 | + $formmail->withto = empty($liste) ? (GETPOST('sendto', 'alpha') ?GETPOST('sendto', 'alpha') : array()) : $liste; |
|
117 | + $formmail->withtofree = empty($liste) ? 1 : 0; |
|
118 | 118 | $formmail->withtocc = 1; |
119 | 119 | $formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC; |
120 | 120 | $formmail->withtopic = $langs->transnoentities($topicmail, '__REF__', '__REFCLIENT__'); |
@@ -132,8 +132,8 @@ discard block |
||
132 | 132 | // Make substitution in email content |
133 | 133 | $substitutionarray = getCommonSubstitutionArray($langs, 0, null, $object); |
134 | 134 | $substitutionarray['__EMAIL__'] = $sendto; |
135 | - $substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty)) ? '<img src="' . DOL_MAIN_URL_ROOT . '/public/emailing/mailing-read.php?tag=' . $object->thirdparty->tag . '&securitykey=' . urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY) . '" width="1" height="1" style="width:1px;height:1px" border="0"/>' : ''; |
|
136 | - $substitutionarray['__PERSONALIZED__'] = ''; // deprecated |
|
135 | + $substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : ''; |
|
136 | + $substitutionarray['__PERSONALIZED__'] = ''; // deprecated |
|
137 | 137 | $substitutionarray['__CONTACTCIVNAME__'] = ''; |
138 | 138 | |
139 | 139 | $parameters = array( |
@@ -150,11 +150,11 @@ discard block |
||
150 | 150 | $formmail->param['models_id'] = GETPOST('modelmailselected', 'int'); |
151 | 151 | $formmail->param['id'] = join(',', $arrayofselected); |
152 | 152 | // $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; |
153 | - if (! empty($conf->global->MAILING_LIMIT_SENDBYWEB) && count($listofselectedthirdparties) > $conf->global->MAILING_LIMIT_SENDBYWEB) |
|
153 | + if (!empty($conf->global->MAILING_LIMIT_SENDBYWEB) && count($listofselectedthirdparties) > $conf->global->MAILING_LIMIT_SENDBYWEB) |
|
154 | 154 | { |
155 | 155 | $langs->load("errors"); |
156 | - print img_warning() . ' ' . $langs->trans('WarningNumberOfRecipientIsRestrictedInMassAction', $conf->global->MAILING_LIMIT_SENDBYWEB); |
|
157 | - print ' - <a href="javascript: window.history.go(-1)">' . $langs->trans("GoBack") . '</a>'; |
|
156 | + print img_warning().' '.$langs->trans('WarningNumberOfRecipientIsRestrictedInMassAction', $conf->global->MAILING_LIMIT_SENDBYWEB); |
|
157 | + print ' - <a href="javascript: window.history.go(-1)">'.$langs->trans("GoBack").'</a>'; |
|
158 | 158 | $arrayofmassactions = array(); |
159 | 159 | } |
160 | 160 | else |
@@ -54,10 +54,12 @@ discard block |
||
54 | 54 | { |
55 | 55 | $listofselectedid[$toselectid] = $toselectid; |
56 | 56 | $thirdpartyid = ($objecttmp->fk_soc ? $objecttmp->fk_soc : $objecttmp->socid); |
57 | - if ($objecttmp->element == 'societe') |
|
58 | - $thirdpartyid = $objecttmp->id; |
|
59 | - if ($objecttmp->element == 'expensereport') |
|
60 | - $thirdpartyid = $objecttmp->fk_user_author; |
|
57 | + if ($objecttmp->element == 'societe') { |
|
58 | + $thirdpartyid = $objecttmp->id; |
|
59 | + } |
|
60 | + if ($objecttmp->element == 'expensereport') { |
|
61 | + $thirdpartyid = $objecttmp->fk_user_author; |
|
62 | + } |
|
61 | 63 | $listofselectedthirdparties[$thirdpartyid] = $thirdpartyid; |
62 | 64 | $listofselectedref[$thirdpartyid][$toselectid] = $objecttmp->ref; |
63 | 65 | } |
@@ -82,24 +84,27 @@ discard block |
||
82 | 84 | $formmail->fromid = $user->id; |
83 | 85 | } |
84 | 86 | $formmail->trackid = $trackid; |
85 | - if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set |
|
87 | + if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) { |
|
88 | + // If bit 2 is set |
|
86 | 89 | { |
87 | 90 | include DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; |
91 | + } |
|
88 | 92 | $formmail->frommail = dolAddEmailTrackId($formmail->frommail, $trackid); |
89 | 93 | } |
90 | 94 | $formmail->withfrom = 1; |
91 | 95 | $liste = $langs->trans("AllRecipientSelected", count($arrayofselected)); |
92 | - if (count($listofselectedthirdparties) == 1) // Only 1 different recipient selected, we can suggest contacts |
|
96 | + if (count($listofselectedthirdparties) == 1) { |
|
97 | + // Only 1 different recipient selected, we can suggest contacts |
|
93 | 98 | { |
94 | 99 | $liste = array(); |
100 | + } |
|
95 | 101 | $thirdpartyid = array_shift($listofselectedthirdparties); |
96 | 102 | if ($objecttmp->element == 'expensereport') |
97 | 103 | { |
98 | 104 | $fuser = new User($db); |
99 | 105 | $fuser->fetch($thirdpartyid); |
100 | 106 | $liste['thirdparty'] = $fuser->getFullName($langs)." <".$fuser->email.">"; |
101 | - } |
|
102 | - else |
|
107 | + } else |
|
103 | 108 | { |
104 | 109 | $soc = new Societe($db); |
105 | 110 | $soc->fetch($thirdpartyid); |
@@ -156,8 +161,7 @@ discard block |
||
156 | 161 | print img_warning() . ' ' . $langs->trans('WarningNumberOfRecipientIsRestrictedInMassAction', $conf->global->MAILING_LIMIT_SENDBYWEB); |
157 | 162 | print ' - <a href="javascript: window.history.go(-1)">' . $langs->trans("GoBack") . '</a>'; |
158 | 163 | $arrayofmassactions = array(); |
159 | - } |
|
160 | - else |
|
164 | + } else |
|
161 | 165 | { |
162 | 166 | print $formmail->get_form(); |
163 | 167 | } |
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | // Protection to avoid direct call of template |
20 | 20 | if (empty($conf) || ! is_object($conf)) |
21 | 21 | { |
22 | - print "Error, template page can't be called as URL"; |
|
23 | - exit; |
|
22 | + print "Error, template page can't be called as URL"; |
|
23 | + exit; |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | |
@@ -111,28 +111,28 @@ discard block |
||
111 | 111 | |
112 | 112 | <?php |
113 | 113 | if (! empty($morelogincontent)) { |
114 | - if (is_array($morelogincontent)) { |
|
115 | - foreach ($morelogincontent as $format => $option) |
|
116 | - { |
|
117 | - if ($format == 'table') { |
|
118 | - echo '<!-- Option by hook -->'; |
|
119 | - echo $option; |
|
120 | - } |
|
121 | - } |
|
122 | - } |
|
123 | - else { |
|
124 | - echo '<!-- Option by hook -->'; |
|
125 | - echo $morelogincontent; |
|
126 | - } |
|
114 | + if (is_array($morelogincontent)) { |
|
115 | + foreach ($morelogincontent as $format => $option) |
|
116 | + { |
|
117 | + if ($format == 'table') { |
|
118 | + echo '<!-- Option by hook -->'; |
|
119 | + echo $option; |
|
120 | + } |
|
121 | + } |
|
122 | + } |
|
123 | + else { |
|
124 | + echo '<!-- Option by hook -->'; |
|
125 | + echo $morelogincontent; |
|
126 | + } |
|
127 | 127 | } |
128 | 128 | ?> |
129 | 129 | |
130 | 130 | <?php if ($captcha) { |
131 | - // Add a variable param to force not using cache (jmobile) |
|
132 | - $php_self = preg_replace('/[&\?]time=(\d+)/','',$php_self); // Remove param time |
|
133 | - if (preg_match('/\?/',$php_self)) $php_self.='&time='.dol_print_date(dol_now(),'dayhourlog'); |
|
134 | - else $php_self.='?time='.dol_print_date(dol_now(),'dayhourlog'); |
|
135 | - ?> |
|
131 | + // Add a variable param to force not using cache (jmobile) |
|
132 | + $php_self = preg_replace('/[&\?]time=(\d+)/','',$php_self); // Remove param time |
|
133 | + if (preg_match('/\?/',$php_self)) $php_self.='&time='.dol_print_date(dol_now(),'dayhourlog'); |
|
134 | + else $php_self.='?time='.dol_print_date(dol_now(),'dayhourlog'); |
|
135 | + ?> |
|
136 | 136 | <!-- Captcha --> |
137 | 137 | <div class="trinputlogin"> |
138 | 138 | <div class="tdinputlogin nowraponall none center valignmiddle tdinputlogin"> |
@@ -167,14 +167,14 @@ discard block |
||
167 | 167 | <br> |
168 | 168 | <div align="center" style="margin-top: 15px;"> |
169 | 169 | <?php |
170 | - $moreparam=''; |
|
171 | - if (! empty($conf->dol_hide_topmenu)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_topmenu='.$conf->dol_hide_topmenu; |
|
172 | - if (! empty($conf->dol_hide_leftmenu)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_leftmenu='.$conf->dol_hide_leftmenu; |
|
173 | - if (! empty($conf->dol_no_mouse_hover)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_no_mouse_hover='.$conf->dol_no_mouse_hover; |
|
174 | - if (! empty($conf->dol_use_jmobile)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_use_jmobile='.$conf->dol_use_jmobile; |
|
175 | - |
|
176 | - print '<a class="alogin" href="'.$dol_url_root.'/index.php'.$moreparam.'">'.$langs->trans('BackToLoginPage').'</a>'; |
|
177 | - ?> |
|
170 | + $moreparam=''; |
|
171 | + if (! empty($conf->dol_hide_topmenu)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_topmenu='.$conf->dol_hide_topmenu; |
|
172 | + if (! empty($conf->dol_hide_leftmenu)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_leftmenu='.$conf->dol_hide_leftmenu; |
|
173 | + if (! empty($conf->dol_no_mouse_hover)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_no_mouse_hover='.$conf->dol_no_mouse_hover; |
|
174 | + if (! empty($conf->dol_use_jmobile)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_use_jmobile='.$conf->dol_use_jmobile; |
|
175 | + |
|
176 | + print '<a class="alogin" href="'.$dol_url_root.'/index.php'.$moreparam.'">'.$langs->trans('BackToLoginPage').'</a>'; |
|
177 | + ?> |
|
178 | 178 | </div> |
179 | 179 | |
180 | 180 | </div> |
@@ -206,17 +206,17 @@ discard block |
||
206 | 206 | <?php } ?> |
207 | 207 | |
208 | 208 | <?php if (! empty($morelogincontent) && is_array($morelogincontent)) { |
209 | - foreach ($morelogincontent as $format => $option) |
|
210 | - { |
|
211 | - if ($format == 'js') { |
|
212 | - echo "\n".'<!-- Javascript by hook -->'; |
|
213 | - echo $option."\n"; |
|
214 | - } |
|
215 | - } |
|
209 | + foreach ($morelogincontent as $format => $option) |
|
210 | + { |
|
211 | + if ($format == 'js') { |
|
212 | + echo "\n".'<!-- Javascript by hook -->'; |
|
213 | + echo $option."\n"; |
|
214 | + } |
|
215 | + } |
|
216 | 216 | } |
217 | 217 | else if (! empty($moreloginextracontent)) { |
218 | - echo '<!-- Javascript by hook -->'; |
|
219 | - echo $moreloginextracontent; |
|
218 | + echo '<!-- Javascript by hook -->'; |
|
219 | + echo $moreloginextracontent; |
|
220 | 220 | } |
221 | 221 | ?> |
222 | 222 |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | */ |
18 | 18 | |
19 | 19 | // Protection to avoid direct call of template |
20 | -if (empty($conf) || ! is_object($conf)) |
|
20 | +if (empty($conf) || !is_object($conf)) |
|
21 | 21 | { |
22 | 22 | print "Error, template page can't be called as URL"; |
23 | 23 | exit; |
@@ -29,32 +29,32 @@ discard block |
||
29 | 29 | header('Cache-Control: Public, must-revalidate'); |
30 | 30 | header("Content-type: text/html; charset=".$conf->file->character_set_client); |
31 | 31 | |
32 | -if (GETPOST('dol_hide_topmenu')) $conf->dol_hide_topmenu=1; |
|
33 | -if (GETPOST('dol_hide_leftmenu')) $conf->dol_hide_leftmenu=1; |
|
34 | -if (GETPOST('dol_optimize_smallscreen')) $conf->dol_optimize_smallscreen=1; |
|
35 | -if (GETPOST('dol_no_mouse_hover')) $conf->dol_no_mouse_hover=1; |
|
36 | -if (GETPOST('dol_use_jmobile')) $conf->dol_use_jmobile=1; |
|
32 | +if (GETPOST('dol_hide_topmenu')) $conf->dol_hide_topmenu = 1; |
|
33 | +if (GETPOST('dol_hide_leftmenu')) $conf->dol_hide_leftmenu = 1; |
|
34 | +if (GETPOST('dol_optimize_smallscreen')) $conf->dol_optimize_smallscreen = 1; |
|
35 | +if (GETPOST('dol_no_mouse_hover')) $conf->dol_no_mouse_hover = 1; |
|
36 | +if (GETPOST('dol_use_jmobile')) $conf->dol_use_jmobile = 1; |
|
37 | 37 | |
38 | 38 | // If we force to use jmobile, then we reenable javascript |
39 | -if (! empty($conf->dol_use_jmobile)) $conf->use_javascript_ajax=1; |
|
39 | +if (!empty($conf->dol_use_jmobile)) $conf->use_javascript_ajax = 1; |
|
40 | 40 | |
41 | 41 | $php_self = $_SERVER['PHP_SELF']; |
42 | -$php_self.= dol_escape_htmltag($_SERVER["QUERY_STRING"])?'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]):''; |
|
42 | +$php_self .= dol_escape_htmltag($_SERVER["QUERY_STRING"]) ? '?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]) : ''; |
|
43 | 43 | |
44 | -$titleofpage=$langs->trans('SendNewPassword'); |
|
44 | +$titleofpage = $langs->trans('SendNewPassword'); |
|
45 | 45 | |
46 | 46 | print top_htmlhead('', $titleofpage); |
47 | 47 | |
48 | 48 | |
49 | -$colorbackhmenu1='60,70,100'; // topmenu |
|
50 | -if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_TOPMENU_BACK1=$colorbackhmenu1; |
|
51 | -$colorbackhmenu1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$conf->global->THEME_ELDY_TOPMENU_BACK1) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$user->conf->THEME_ELDY_TOPMENU_BACK1); |
|
52 | -$colorbackhmenu1=join(',',colorStringToArray($colorbackhmenu1)); // Normalize value to 'x,y,z' |
|
49 | +$colorbackhmenu1 = '60,70,100'; // topmenu |
|
50 | +if (!isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_TOPMENU_BACK1 = $colorbackhmenu1; |
|
51 | +$colorbackhmenu1 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TOPMENU_BACK1) ? $colorbackhmenu1 : $conf->global->THEME_ELDY_TOPMENU_BACK1) : (empty($user->conf->THEME_ELDY_TOPMENU_BACK1) ? $colorbackhmenu1 : $user->conf->THEME_ELDY_TOPMENU_BACK1); |
|
52 | +$colorbackhmenu1 = join(',', colorStringToArray($colorbackhmenu1)); // Normalize value to 'x,y,z' |
|
53 | 53 | |
54 | 54 | ?> |
55 | 55 | <!-- BEGIN PHP TEMPLATE PASSWORDFORGOTTEN.TPL.PHP --> |
56 | 56 | |
57 | -<body class="body bodylogin"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode('logos/'.$conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>> |
|
57 | +<body class="body bodylogin"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND) ? '' : ' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode('logos/'.$conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>> |
|
58 | 58 | |
59 | 59 | <?php if (empty($conf->dol_use_jmobile)) { ?> |
60 | 60 | <script type="text/javascript"> |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | <?php } ?> |
67 | 67 | |
68 | 68 | |
69 | -<div class="login_center center"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));"':'' ?>> |
|
69 | +<div class="login_center center"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND) ? ' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));"' : '' ?>> |
|
70 | 70 | <div class="login_vertical_align"> |
71 | 71 | |
72 | 72 | <form id="login" name="login" method="POST" action="<?php echo $php_self; ?>"> |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | </div> |
111 | 111 | |
112 | 112 | <?php |
113 | -if (! empty($morelogincontent)) { |
|
113 | +if (!empty($morelogincontent)) { |
|
114 | 114 | if (is_array($morelogincontent)) { |
115 | 115 | foreach ($morelogincontent as $format => $option) |
116 | 116 | { |
@@ -129,9 +129,9 @@ discard block |
||
129 | 129 | |
130 | 130 | <?php if ($captcha) { |
131 | 131 | // Add a variable param to force not using cache (jmobile) |
132 | - $php_self = preg_replace('/[&\?]time=(\d+)/','',$php_self); // Remove param time |
|
133 | - if (preg_match('/\?/',$php_self)) $php_self.='&time='.dol_print_date(dol_now(),'dayhourlog'); |
|
134 | - else $php_self.='?time='.dol_print_date(dol_now(),'dayhourlog'); |
|
132 | + $php_self = preg_replace('/[&\?]time=(\d+)/', '', $php_self); // Remove param time |
|
133 | + if (preg_match('/\?/', $php_self)) $php_self .= '&time='.dol_print_date(dol_now(), 'dayhourlog'); |
|
134 | + else $php_self .= '?time='.dol_print_date(dol_now(), 'dayhourlog'); |
|
135 | 135 | ?> |
136 | 136 | <!-- Captcha --> |
137 | 137 | <div class="trinputlogin"> |
@@ -167,11 +167,11 @@ discard block |
||
167 | 167 | <br> |
168 | 168 | <div align="center" style="margin-top: 15px;"> |
169 | 169 | <?php |
170 | - $moreparam=''; |
|
171 | - if (! empty($conf->dol_hide_topmenu)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_topmenu='.$conf->dol_hide_topmenu; |
|
172 | - if (! empty($conf->dol_hide_leftmenu)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_leftmenu='.$conf->dol_hide_leftmenu; |
|
173 | - if (! empty($conf->dol_no_mouse_hover)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_no_mouse_hover='.$conf->dol_no_mouse_hover; |
|
174 | - if (! empty($conf->dol_use_jmobile)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_use_jmobile='.$conf->dol_use_jmobile; |
|
170 | + $moreparam = ''; |
|
171 | + if (!empty($conf->dol_hide_topmenu)) $moreparam .= (strpos($moreparam, '?') === false ? '?' : '&').'dol_hide_topmenu='.$conf->dol_hide_topmenu; |
|
172 | + if (!empty($conf->dol_hide_leftmenu)) $moreparam .= (strpos($moreparam, '?') === false ? '?' : '&').'dol_hide_leftmenu='.$conf->dol_hide_leftmenu; |
|
173 | + if (!empty($conf->dol_no_mouse_hover)) $moreparam .= (strpos($moreparam, '?') === false ? '?' : '&').'dol_no_mouse_hover='.$conf->dol_no_mouse_hover; |
|
174 | + if (!empty($conf->dol_use_jmobile)) $moreparam .= (strpos($moreparam, '?') === false ? '?' : '&').'dol_use_jmobile='.$conf->dol_use_jmobile; |
|
175 | 175 | |
176 | 176 | print '<a class="alogin" href="'.$dol_url_root.'/index.php'.$moreparam.'">'.$langs->trans('BackToLoginPage').'</a>'; |
177 | 177 | ?> |
@@ -184,12 +184,12 @@ discard block |
||
184 | 184 | </form> |
185 | 185 | |
186 | 186 | |
187 | -<div class="center login_main_home divpasswordmessagedesc paddingtopbottom<?php echo empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' backgroundsemitransparent'; ?>" style="max-width: 70%"> |
|
188 | -<?php if ($mode == 'dolibarr' || ! $disabled) { ?> |
|
187 | +<div class="center login_main_home divpasswordmessagedesc paddingtopbottom<?php echo empty($conf->global->MAIN_LOGIN_BACKGROUND) ? '' : ' backgroundsemitransparent'; ?>" style="max-width: 70%"> |
|
188 | +<?php if ($mode == 'dolibarr' || !$disabled) { ?> |
|
189 | 189 | <span class="passwordmessagedesc"> |
190 | 190 | <?php echo $langs->trans('SendNewPasswordDesc'); ?> |
191 | 191 | </span> |
192 | -<?php }else{ ?> |
|
192 | +<?php } else { ?> |
|
193 | 193 | <div class="warning" align="center"> |
194 | 194 | <?php echo $langs->trans('AuthenticationDoesNotAllowSendNewPassword', $mode); ?> |
195 | 195 | </div> |
@@ -201,11 +201,11 @@ discard block |
||
201 | 201 | |
202 | 202 | <?php if ($message) { ?> |
203 | 203 | <div class="center login_main_message"> |
204 | - <?php echo dol_htmloutput_mesg($message,'','',1); ?> |
|
204 | + <?php echo dol_htmloutput_mesg($message, '', '', 1); ?> |
|
205 | 205 | </div> |
206 | 206 | <?php } ?> |
207 | 207 | |
208 | -<?php if (! empty($morelogincontent) && is_array($morelogincontent)) { |
|
208 | +<?php if (!empty($morelogincontent) && is_array($morelogincontent)) { |
|
209 | 209 | foreach ($morelogincontent as $format => $option) |
210 | 210 | { |
211 | 211 | if ($format == 'js') { |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | } |
215 | 215 | } |
216 | 216 | } |
217 | -else if (! empty($moreloginextracontent)) { |
|
217 | +else if (!empty($moreloginextracontent)) { |
|
218 | 218 | echo '<!-- Javascript by hook -->'; |
219 | 219 | echo $moreloginextracontent; |
220 | 220 | } |
@@ -29,14 +29,26 @@ discard block |
||
29 | 29 | header('Cache-Control: Public, must-revalidate'); |
30 | 30 | header("Content-type: text/html; charset=".$conf->file->character_set_client); |
31 | 31 | |
32 | -if (GETPOST('dol_hide_topmenu')) $conf->dol_hide_topmenu=1; |
|
33 | -if (GETPOST('dol_hide_leftmenu')) $conf->dol_hide_leftmenu=1; |
|
34 | -if (GETPOST('dol_optimize_smallscreen')) $conf->dol_optimize_smallscreen=1; |
|
35 | -if (GETPOST('dol_no_mouse_hover')) $conf->dol_no_mouse_hover=1; |
|
36 | -if (GETPOST('dol_use_jmobile')) $conf->dol_use_jmobile=1; |
|
32 | +if (GETPOST('dol_hide_topmenu')) { |
|
33 | + $conf->dol_hide_topmenu=1; |
|
34 | +} |
|
35 | +if (GETPOST('dol_hide_leftmenu')) { |
|
36 | + $conf->dol_hide_leftmenu=1; |
|
37 | +} |
|
38 | +if (GETPOST('dol_optimize_smallscreen')) { |
|
39 | + $conf->dol_optimize_smallscreen=1; |
|
40 | +} |
|
41 | +if (GETPOST('dol_no_mouse_hover')) { |
|
42 | + $conf->dol_no_mouse_hover=1; |
|
43 | +} |
|
44 | +if (GETPOST('dol_use_jmobile')) { |
|
45 | + $conf->dol_use_jmobile=1; |
|
46 | +} |
|
37 | 47 | |
38 | 48 | // If we force to use jmobile, then we reenable javascript |
39 | -if (! empty($conf->dol_use_jmobile)) $conf->use_javascript_ajax=1; |
|
49 | +if (! empty($conf->dol_use_jmobile)) { |
|
50 | + $conf->use_javascript_ajax=1; |
|
51 | +} |
|
40 | 52 | |
41 | 53 | $php_self = $_SERVER['PHP_SELF']; |
42 | 54 | $php_self.= dol_escape_htmltag($_SERVER["QUERY_STRING"])?'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]):''; |
@@ -47,7 +59,9 @@ discard block |
||
47 | 59 | |
48 | 60 | |
49 | 61 | $colorbackhmenu1='60,70,100'; // topmenu |
50 | -if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_TOPMENU_BACK1=$colorbackhmenu1; |
|
62 | +if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) { |
|
63 | + $conf->global->THEME_ELDY_TOPMENU_BACK1=$colorbackhmenu1; |
|
64 | +} |
|
51 | 65 | $colorbackhmenu1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$conf->global->THEME_ELDY_TOPMENU_BACK1) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$user->conf->THEME_ELDY_TOPMENU_BACK1); |
52 | 66 | $colorbackhmenu1=join(',',colorStringToArray($colorbackhmenu1)); // Normalize value to 'x,y,z' |
53 | 67 | |
@@ -77,9 +91,13 @@ discard block |
||
77 | 91 | <!-- Title with version --> |
78 | 92 | <div class="login_table_title center" title="<?php echo dol_escape_htmltag($title); ?>"> |
79 | 93 | <?php |
80 | -if ($disablenofollow) echo '<a class="login_table_title" href="https://www.dolibarr.org" target="_blank">'; |
|
94 | +if ($disablenofollow) { |
|
95 | + echo '<a class="login_table_title" href="https://www.dolibarr.org" target="_blank">'; |
|
96 | +} |
|
81 | 97 | echo dol_escape_htmltag($title); |
82 | -if ($disablenofollow) echo '</a>'; |
|
98 | +if ($disablenofollow) { |
|
99 | + echo '</a>'; |
|
100 | +} |
|
83 | 101 | ?> |
84 | 102 | </div> |
85 | 103 | |
@@ -119,8 +137,7 @@ discard block |
||
119 | 137 | echo $option; |
120 | 138 | } |
121 | 139 | } |
122 | - } |
|
123 | - else { |
|
140 | + } else { |
|
124 | 141 | echo '<!-- Option by hook -->'; |
125 | 142 | echo $morelogincontent; |
126 | 143 | } |
@@ -130,8 +147,11 @@ discard block |
||
130 | 147 | <?php if ($captcha) { |
131 | 148 | // Add a variable param to force not using cache (jmobile) |
132 | 149 | $php_self = preg_replace('/[&\?]time=(\d+)/','',$php_self); // Remove param time |
133 | - if (preg_match('/\?/',$php_self)) $php_self.='&time='.dol_print_date(dol_now(),'dayhourlog'); |
|
134 | - else $php_self.='?time='.dol_print_date(dol_now(),'dayhourlog'); |
|
150 | + if (preg_match('/\?/',$php_self)) { |
|
151 | + $php_self.='&time='.dol_print_date(dol_now(),'dayhourlog'); |
|
152 | + } else { |
|
153 | + $php_self.='?time='.dol_print_date(dol_now(),'dayhourlog'); |
|
154 | + } |
|
135 | 155 | ?> |
136 | 156 | <!-- Captcha --> |
137 | 157 | <div class="trinputlogin"> |
@@ -168,10 +188,18 @@ discard block |
||
168 | 188 | <div align="center" style="margin-top: 15px;"> |
169 | 189 | <?php |
170 | 190 | $moreparam=''; |
171 | - if (! empty($conf->dol_hide_topmenu)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_topmenu='.$conf->dol_hide_topmenu; |
|
172 | - if (! empty($conf->dol_hide_leftmenu)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_leftmenu='.$conf->dol_hide_leftmenu; |
|
173 | - if (! empty($conf->dol_no_mouse_hover)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_no_mouse_hover='.$conf->dol_no_mouse_hover; |
|
174 | - if (! empty($conf->dol_use_jmobile)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_use_jmobile='.$conf->dol_use_jmobile; |
|
191 | + if (! empty($conf->dol_hide_topmenu)) { |
|
192 | + $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_topmenu='.$conf->dol_hide_topmenu; |
|
193 | + } |
|
194 | + if (! empty($conf->dol_hide_leftmenu)) { |
|
195 | + $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_leftmenu='.$conf->dol_hide_leftmenu; |
|
196 | + } |
|
197 | + if (! empty($conf->dol_no_mouse_hover)) { |
|
198 | + $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_no_mouse_hover='.$conf->dol_no_mouse_hover; |
|
199 | + } |
|
200 | + if (! empty($conf->dol_use_jmobile)) { |
|
201 | + $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_use_jmobile='.$conf->dol_use_jmobile; |
|
202 | + } |
|
175 | 203 | |
176 | 204 | print '<a class="alogin" href="'.$dol_url_root.'/index.php'.$moreparam.'">'.$langs->trans('BackToLoginPage').'</a>'; |
177 | 205 | ?> |
@@ -189,7 +217,7 @@ discard block |
||
189 | 217 | <span class="passwordmessagedesc"> |
190 | 218 | <?php echo $langs->trans('SendNewPasswordDesc'); ?> |
191 | 219 | </span> |
192 | -<?php }else{ ?> |
|
220 | +<?php } else{ ?> |
|
193 | 221 | <div class="warning" align="center"> |
194 | 222 | <?php echo $langs->trans('AuthenticationDoesNotAllowSendNewPassword', $mode); ?> |
195 | 223 | </div> |
@@ -213,8 +241,7 @@ discard block |
||
213 | 241 | echo $option."\n"; |
214 | 242 | } |
215 | 243 | } |
216 | -} |
|
217 | -else if (! empty($moreloginextracontent)) { |
|
244 | +} else if (! empty($moreloginextracontent)) { |
|
218 | 245 | echo '<!-- Javascript by hook -->'; |
219 | 246 | echo $moreloginextracontent; |
220 | 247 | } |
@@ -34,8 +34,8 @@ discard block |
||
34 | 34 | // Protection to avoid direct call of template |
35 | 35 | if (empty($object) || ! is_object($object)) |
36 | 36 | { |
37 | - print "Error, template page can't be called as URL"; |
|
38 | - exit; |
|
37 | + print "Error, template page can't be called as URL"; |
|
38 | + exit; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | |
@@ -78,129 +78,129 @@ discard block |
||
78 | 78 | |
79 | 79 | <a href="<?php echo DOL_URL_ROOT.'/product/card.php?id='.$line->fk_product; ?>"> |
80 | 80 | <?php |
81 | - if ($line->product_type==1) echo img_object($langs->trans('ShowService'),'service'); |
|
82 | - else print img_object($langs->trans('ShowProduct'),'product'); |
|
83 | - echo ' '.$line->ref; |
|
84 | - ?> |
|
81 | + if ($line->product_type==1) echo img_object($langs->trans('ShowService'),'service'); |
|
82 | + else print img_object($langs->trans('ShowProduct'),'product'); |
|
83 | + echo ' '.$line->ref; |
|
84 | + ?> |
|
85 | 85 | </a> |
86 | 86 | <?php |
87 | - echo ' - '.nl2br($line->product_label); |
|
88 | - ?> |
|
87 | + echo ' - '.nl2br($line->product_label); |
|
88 | + ?> |
|
89 | 89 | |
90 | 90 | <br><br> |
91 | 91 | |
92 | 92 | <?php } ?> |
93 | 93 | |
94 | 94 | <?php |
95 | - if (is_object($hookmanager)) |
|
96 | - { |
|
97 | - $fk_parent_line = (GETPOST('fk_parent_line') ? GETPOST('fk_parent_line') : $line->fk_parent_line); |
|
98 | - $parameters=array('line'=>$line,'fk_parent_line'=>$fk_parent_line,'var'=>$var,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer); |
|
99 | - $reshook=$hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action); |
|
100 | - } |
|
101 | - |
|
102 | - // Do not allow editing during a situation cycle |
|
103 | - if (empty($this->situation_cycle_ref) || $this->situation_counter == 1) |
|
104 | - { |
|
105 | - // editeur wysiwyg |
|
106 | - require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
107 | - $nbrows=ROWS_2; |
|
108 | - if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; |
|
109 | - $enable=(isset($conf->global->FCKEDITOR_ENABLE_DETAILS)?$conf->global->FCKEDITOR_ENABLE_DETAILS:0); |
|
110 | - $toolbarname='dolibarr_details'; |
|
111 | - if (! empty($conf->global->FCKEDITOR_ENABLE_DETAILS_FULL)) $toolbarname='dolibarr_notes'; |
|
112 | - $doleditor=new DolEditor('product_desc',$line->description,'',164,$toolbarname,'',false,true,$enable,$nbrows,'98%'); |
|
113 | - $doleditor->Create(); |
|
114 | - } else { |
|
115 | - print '<textarea id="product_desc" class="flat" name="product_desc" readonly style="width: 200px; height:80px;">' . $line->description . '</textarea>'; |
|
116 | - } |
|
117 | - |
|
118 | - // Show autofill date for recuring invoices |
|
119 | - if (! empty($conf->service->enabled) && $line->product_type == 1 && $line->element == 'facturedetrec') |
|
120 | - { |
|
121 | - echo '<br>'; |
|
122 | - echo $langs->trans('AutoFillDateFrom').' '; |
|
123 | - echo $form->selectyesno('date_start_fill', $line->date_start_fill, 1); |
|
124 | - echo ' - '; |
|
125 | - echo $langs->trans('AutoFillDateTo').' '; |
|
126 | - echo $form->selectyesno('date_end_fill', $line->date_end_fill, 1); |
|
127 | - } |
|
128 | - |
|
129 | - ?> |
|
95 | + if (is_object($hookmanager)) |
|
96 | + { |
|
97 | + $fk_parent_line = (GETPOST('fk_parent_line') ? GETPOST('fk_parent_line') : $line->fk_parent_line); |
|
98 | + $parameters=array('line'=>$line,'fk_parent_line'=>$fk_parent_line,'var'=>$var,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer); |
|
99 | + $reshook=$hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action); |
|
100 | + } |
|
101 | + |
|
102 | + // Do not allow editing during a situation cycle |
|
103 | + if (empty($this->situation_cycle_ref) || $this->situation_counter == 1) |
|
104 | + { |
|
105 | + // editeur wysiwyg |
|
106 | + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
107 | + $nbrows=ROWS_2; |
|
108 | + if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; |
|
109 | + $enable=(isset($conf->global->FCKEDITOR_ENABLE_DETAILS)?$conf->global->FCKEDITOR_ENABLE_DETAILS:0); |
|
110 | + $toolbarname='dolibarr_details'; |
|
111 | + if (! empty($conf->global->FCKEDITOR_ENABLE_DETAILS_FULL)) $toolbarname='dolibarr_notes'; |
|
112 | + $doleditor=new DolEditor('product_desc',$line->description,'',164,$toolbarname,'',false,true,$enable,$nbrows,'98%'); |
|
113 | + $doleditor->Create(); |
|
114 | + } else { |
|
115 | + print '<textarea id="product_desc" class="flat" name="product_desc" readonly style="width: 200px; height:80px;">' . $line->description . '</textarea>'; |
|
116 | + } |
|
117 | + |
|
118 | + // Show autofill date for recuring invoices |
|
119 | + if (! empty($conf->service->enabled) && $line->product_type == 1 && $line->element == 'facturedetrec') |
|
120 | + { |
|
121 | + echo '<br>'; |
|
122 | + echo $langs->trans('AutoFillDateFrom').' '; |
|
123 | + echo $form->selectyesno('date_start_fill', $line->date_start_fill, 1); |
|
124 | + echo ' - '; |
|
125 | + echo $langs->trans('AutoFillDateTo').' '; |
|
126 | + echo $form->selectyesno('date_end_fill', $line->date_end_fill, 1); |
|
127 | + } |
|
128 | + |
|
129 | + ?> |
|
130 | 130 | </td> |
131 | 131 | |
132 | 132 | <?php |
133 | - if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines |
|
134 | - { |
|
135 | - ?> |
|
133 | + if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines |
|
134 | + { |
|
135 | + ?> |
|
136 | 136 | <td align="right"><input id="fourn_ref" name="fourn_ref" class="flat minwidth75" value="<?php echo ($line->ref_supplier ? $line->ref_supplier : $line->ref_fourn); ?>"></td> |
137 | 137 | <?php |
138 | - } |
|
139 | - |
|
140 | - $coldisplay++; |
|
141 | - if ($this->situation_counter == 1 || !$this->situation_cycle_ref) { |
|
142 | - print '<td align="right">' . $form->load_tva('tva_tx', $line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), $seller, $buyer, 0, $line->info_bits, $line->product_type, false, 1) . '</td>'; |
|
143 | - } else { |
|
144 | - print '<td align="right"><input size="1" type="text" class="flat right" name="tva_tx" value="' . price($line->tva_tx) . '" readonly />%</td>'; |
|
145 | - } |
|
146 | - |
|
147 | - $coldisplay++; |
|
148 | - print '<td align="right"><input type="text" class="flat right" size="5" id="price_ht" name="price_ht" value="' . (isset($line->pu_ht)?price($line->pu_ht,0,'',0):price($line->subprice,0,'',0)) . '"'; |
|
149 | - if ($this->situation_counter > 1) print ' readonly'; |
|
150 | - print '></td>'; |
|
151 | - |
|
152 | - if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { |
|
153 | - print '<td align="right"><input rel="'.$object->multicurrency_tx.'" type="text" class="flat right" size="5" id="multicurrency_subprice" name="multicurrency_subprice" value="'.price($line->multicurrency_subprice).'" /></td>'; |
|
154 | - } |
|
155 | - |
|
156 | - if ($inputalsopricewithtax) |
|
157 | - { |
|
158 | - $coldisplay++; |
|
159 | - print '<td align="right"><input type="text" class="flat right" size="5" id="price_ttc" name="price_ttc" value="'.(isset($line->pu_ttc)?price($line->pu_ttc,0,'',0):'').'"'; |
|
160 | - if ($this->situation_counter > 1) print ' readonly'; |
|
161 | - print '></td>'; |
|
162 | - } |
|
163 | - ?> |
|
138 | + } |
|
139 | + |
|
140 | + $coldisplay++; |
|
141 | + if ($this->situation_counter == 1 || !$this->situation_cycle_ref) { |
|
142 | + print '<td align="right">' . $form->load_tva('tva_tx', $line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), $seller, $buyer, 0, $line->info_bits, $line->product_type, false, 1) . '</td>'; |
|
143 | + } else { |
|
144 | + print '<td align="right"><input size="1" type="text" class="flat right" name="tva_tx" value="' . price($line->tva_tx) . '" readonly />%</td>'; |
|
145 | + } |
|
146 | + |
|
147 | + $coldisplay++; |
|
148 | + print '<td align="right"><input type="text" class="flat right" size="5" id="price_ht" name="price_ht" value="' . (isset($line->pu_ht)?price($line->pu_ht,0,'',0):price($line->subprice,0,'',0)) . '"'; |
|
149 | + if ($this->situation_counter > 1) print ' readonly'; |
|
150 | + print '></td>'; |
|
151 | + |
|
152 | + if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { |
|
153 | + print '<td align="right"><input rel="'.$object->multicurrency_tx.'" type="text" class="flat right" size="5" id="multicurrency_subprice" name="multicurrency_subprice" value="'.price($line->multicurrency_subprice).'" /></td>'; |
|
154 | + } |
|
155 | + |
|
156 | + if ($inputalsopricewithtax) |
|
157 | + { |
|
158 | + $coldisplay++; |
|
159 | + print '<td align="right"><input type="text" class="flat right" size="5" id="price_ttc" name="price_ttc" value="'.(isset($line->pu_ttc)?price($line->pu_ttc,0,'',0):'').'"'; |
|
160 | + if ($this->situation_counter > 1) print ' readonly'; |
|
161 | + print '></td>'; |
|
162 | + } |
|
163 | + ?> |
|
164 | 164 | <td align="right"><?php $coldisplay++; ?> |
165 | 165 | <?php if (($line->info_bits & 2) != 2) { |
166 | - // I comment this because it shows info even when not required |
|
167 | - // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated |
|
168 | - // must also not be output for most entities (proposal, intervention, ...) |
|
169 | - //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." "; |
|
170 | - print '<input size="3" type="text" class="flat right" name="qty" id="qty" value="' . $line->qty . '"'; |
|
171 | - if ($this->situation_counter > 1) print ' readonly'; |
|
172 | - print '>'; |
|
173 | - } else { ?> |
|
166 | + // I comment this because it shows info even when not required |
|
167 | + // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated |
|
168 | + // must also not be output for most entities (proposal, intervention, ...) |
|
169 | + //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." "; |
|
170 | + print '<input size="3" type="text" class="flat right" name="qty" id="qty" value="' . $line->qty . '"'; |
|
171 | + if ($this->situation_counter > 1) print ' readonly'; |
|
172 | + print '>'; |
|
173 | + } else { ?> |
|
174 | 174 | |
175 | 175 | <?php } ?> |
176 | 176 | </td> |
177 | 177 | |
178 | 178 | <?php |
179 | - if($conf->global->PRODUCT_USE_UNITS) |
|
180 | - { |
|
181 | - print '<td align="left">'; |
|
182 | - print $form->selectUnits($line->fk_unit, "units"); |
|
183 | - print '</td>'; |
|
184 | - } |
|
185 | - ?> |
|
179 | + if($conf->global->PRODUCT_USE_UNITS) |
|
180 | + { |
|
181 | + print '<td align="left">'; |
|
182 | + print $form->selectUnits($line->fk_unit, "units"); |
|
183 | + print '</td>'; |
|
184 | + } |
|
185 | + ?> |
|
186 | 186 | |
187 | 187 | <td align="right" class="nowrap"><?php $coldisplay++; ?> |
188 | 188 | <?php if (($line->info_bits & 2) != 2) { |
189 | - print '<input size="1" type="text" class="flat right" name="remise_percent" id="remise_percent" value="' . $line->remise_percent . '"'; |
|
190 | - if ($this->situation_counter > 1) print ' readonly'; |
|
191 | - print '>%'; |
|
192 | - } else { ?> |
|
189 | + print '<input size="1" type="text" class="flat right" name="remise_percent" id="remise_percent" value="' . $line->remise_percent . '"'; |
|
190 | + if ($this->situation_counter > 1) print ' readonly'; |
|
191 | + print '>%'; |
|
192 | + } else { ?> |
|
193 | 193 | |
194 | 194 | <?php } ?> |
195 | 195 | </td> |
196 | 196 | <?php |
197 | - if ($this->situation_cycle_ref) { |
|
198 | - $coldisplay++; |
|
199 | - print '<td align="right" class="nowrap"><input class="right" type="text" size="1" value="' . $line->situation_percent . '" name="progress">%</td>'; |
|
200 | - } |
|
201 | - if (! empty($usemargins)) |
|
202 | - { |
|
203 | - ?> |
|
197 | + if ($this->situation_cycle_ref) { |
|
198 | + $coldisplay++; |
|
199 | + print '<td align="right" class="nowrap"><input class="right" type="text" size="1" value="' . $line->situation_percent . '" name="progress">%</td>'; |
|
200 | + } |
|
201 | + if (! empty($usemargins)) |
|
202 | + { |
|
203 | + ?> |
|
204 | 204 | <?php if (!empty($user->rights->margins->creer)) { ?> |
205 | 205 | <td align="right" class="margininfos"><?php $coldisplay++; ?> |
206 | 206 | <!-- For predef product --> |
@@ -212,29 +212,29 @@ discard block |
||
212 | 212 | </td> |
213 | 213 | <?php } ?> |
214 | 214 | <?php if ($user->rights->margins->creer) { |
215 | - if (! empty($conf->global->DISPLAY_MARGIN_RATES)) |
|
216 | - { |
|
217 | - $margin_rate = (isset($_POST["np_marginRate"])?GETPOST("np_marginRate","alpha",2):(($line->pa_ht == 0)?'':price($line->marge_tx))); |
|
218 | - // if credit note, dont allow to modify margin |
|
219 | - if ($line->subprice < 0) |
|
220 | - echo '<td align="right" class="nowrap margininfos">'.$margin_rate.'<span class="hideonsmartphone">%</span></td>'; |
|
221 | - else |
|
222 | - echo '<td align="right" class="nowrap margininfos"><input class="right" type="text" size="2" name="np_marginRate" value="'.$margin_rate.'"><span class="hideonsmartphone">%</span></td>'; |
|
223 | - $coldisplay++; |
|
224 | - } |
|
225 | - elseif (! empty($conf->global->DISPLAY_MARK_RATES)) |
|
226 | - { |
|
227 | - $mark_rate = (isset($_POST["np_markRate"])?GETPOST("np_markRate",'alpha',2):price($line->marque_tx)); |
|
228 | - // if credit note, dont allow to modify margin |
|
229 | - if ($line->subprice < 0) |
|
230 | - echo '<td align="right" class="nowrap margininfos">'.$mark_rate.'<span class="hideonsmartphone">%</span></td>'; |
|
231 | - else |
|
232 | - echo '<td align="right" class="nowrap margininfos"><input class="right" type="text" size="2" name="np_markRate" value="'.$mark_rate.'"><span class="hideonsmartphone">%</span></td>'; |
|
233 | - $coldisplay++; |
|
234 | - } |
|
235 | - } |
|
236 | - } |
|
237 | - ?> |
|
215 | + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) |
|
216 | + { |
|
217 | + $margin_rate = (isset($_POST["np_marginRate"])?GETPOST("np_marginRate","alpha",2):(($line->pa_ht == 0)?'':price($line->marge_tx))); |
|
218 | + // if credit note, dont allow to modify margin |
|
219 | + if ($line->subprice < 0) |
|
220 | + echo '<td align="right" class="nowrap margininfos">'.$margin_rate.'<span class="hideonsmartphone">%</span></td>'; |
|
221 | + else |
|
222 | + echo '<td align="right" class="nowrap margininfos"><input class="right" type="text" size="2" name="np_marginRate" value="'.$margin_rate.'"><span class="hideonsmartphone">%</span></td>'; |
|
223 | + $coldisplay++; |
|
224 | + } |
|
225 | + elseif (! empty($conf->global->DISPLAY_MARK_RATES)) |
|
226 | + { |
|
227 | + $mark_rate = (isset($_POST["np_markRate"])?GETPOST("np_markRate",'alpha',2):price($line->marque_tx)); |
|
228 | + // if credit note, dont allow to modify margin |
|
229 | + if ($line->subprice < 0) |
|
230 | + echo '<td align="right" class="nowrap margininfos">'.$mark_rate.'<span class="hideonsmartphone">%</span></td>'; |
|
231 | + else |
|
232 | + echo '<td align="right" class="nowrap margininfos"><input class="right" type="text" size="2" name="np_markRate" value="'.$mark_rate.'"><span class="hideonsmartphone">%</span></td>'; |
|
233 | + $coldisplay++; |
|
234 | + } |
|
235 | + } |
|
236 | + } |
|
237 | + ?> |
|
238 | 238 | |
239 | 239 | <!-- colspan=4 for this td because it replace total_ht+3 td for buttons --> |
240 | 240 | <td align="center" colspan="<?php echo $colspan; ?>" valign="middle"><?php $coldisplay+=4; ?> |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | //Line extrafield |
248 | 248 | if (!empty($extrafieldsline)) |
249 | 249 | { |
250 | - print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bc[$var],'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); |
|
250 | + print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bc[$var],'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); |
|
251 | 251 | } |
252 | 252 | ?> |
253 | 253 | |
@@ -258,29 +258,29 @@ discard block |
||
258 | 258 | <?php } ?> |
259 | 259 | <td colspan="<?php echo 7+$colspan ?>"><?php echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?> |
260 | 260 | <?php |
261 | - $hourmin=(isset($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE:''); |
|
262 | - print $form->selectDate($line->date_start, 'date_start', $hourmin, $hourmin, $line->date_start?0:1, "updateline", 1, 0); |
|
263 | - print ' '.$langs->trans('to').' '; |
|
264 | - print $form->selectDate($line->date_end, 'date_end', $hourmin, $hourmin, $line->date_end?0:1, "updateline", 1, 0); |
|
265 | - print '<script type="text/javascript">'; |
|
266 | - if (!$line->date_start) { |
|
267 | - if (isset($conf->global->MAIN_DEFAULT_DATE_START_HOUR)) { |
|
268 | - print 'jQuery("#date_starthour").val("'.$conf->global->MAIN_DEFAULT_DATE_START_HOUR.'");'; |
|
269 | - } |
|
270 | - if (isset($conf->global->MAIN_DEFAULT_DATE_START_MIN)) { |
|
271 | - print 'jQuery("#date_startmin").val("'.$conf->global->MAIN_DEFAULT_DATE_START_MIN.'");'; |
|
272 | - } |
|
273 | - } |
|
274 | - if (!$line->date_end) { |
|
275 | - if (isset($conf->global->MAIN_DEFAULT_DATE_END_HOUR)) { |
|
276 | - print 'jQuery("#date_endhour").val("'.$conf->global->MAIN_DEFAULT_DATE_END_HOUR.'");'; |
|
277 | - } |
|
278 | - if (isset($conf->global->MAIN_DEFAULT_DATE_END_MIN)) { |
|
279 | - print 'jQuery("#date_endmin").val("'.$conf->global->MAIN_DEFAULT_DATE_END_MIN.'");'; |
|
280 | - } |
|
281 | - } |
|
282 | - print '</script>' |
|
283 | - ?> |
|
261 | + $hourmin=(isset($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE:''); |
|
262 | + print $form->selectDate($line->date_start, 'date_start', $hourmin, $hourmin, $line->date_start?0:1, "updateline", 1, 0); |
|
263 | + print ' '.$langs->trans('to').' '; |
|
264 | + print $form->selectDate($line->date_end, 'date_end', $hourmin, $hourmin, $line->date_end?0:1, "updateline", 1, 0); |
|
265 | + print '<script type="text/javascript">'; |
|
266 | + if (!$line->date_start) { |
|
267 | + if (isset($conf->global->MAIN_DEFAULT_DATE_START_HOUR)) { |
|
268 | + print 'jQuery("#date_starthour").val("'.$conf->global->MAIN_DEFAULT_DATE_START_HOUR.'");'; |
|
269 | + } |
|
270 | + if (isset($conf->global->MAIN_DEFAULT_DATE_START_MIN)) { |
|
271 | + print 'jQuery("#date_startmin").val("'.$conf->global->MAIN_DEFAULT_DATE_START_MIN.'");'; |
|
272 | + } |
|
273 | + } |
|
274 | + if (!$line->date_end) { |
|
275 | + if (isset($conf->global->MAIN_DEFAULT_DATE_END_HOUR)) { |
|
276 | + print 'jQuery("#date_endhour").val("'.$conf->global->MAIN_DEFAULT_DATE_END_HOUR.'");'; |
|
277 | + } |
|
278 | + if (isset($conf->global->MAIN_DEFAULT_DATE_END_MIN)) { |
|
279 | + print 'jQuery("#date_endmin").val("'.$conf->global->MAIN_DEFAULT_DATE_END_MIN.'");'; |
|
280 | + } |
|
281 | + } |
|
282 | + print '</script>' |
|
283 | + ?> |
|
284 | 284 | </td> |
285 | 285 | </tr> |
286 | 286 | <?php } |
@@ -32,54 +32,54 @@ discard block |
||
32 | 32 | */ |
33 | 33 | |
34 | 34 | // Protection to avoid direct call of template |
35 | -if (empty($object) || ! is_object($object)) |
|
35 | +if (empty($object) || !is_object($object)) |
|
36 | 36 | { |
37 | 37 | print "Error, template page can't be called as URL"; |
38 | 38 | exit; |
39 | 39 | } |
40 | 40 | |
41 | 41 | |
42 | -$usemargins=0; |
|
43 | -if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) $usemargins=1; |
|
42 | +$usemargins = 0; |
|
43 | +if (!empty($conf->margin->enabled) && !empty($object->element) && in_array($object->element, array('facture', 'propal', 'commande'))) $usemargins = 1; |
|
44 | 44 | |
45 | 45 | global $forceall, $senderissupplier, $inputalsopricewithtax; |
46 | -if (empty($dateSelector)) $dateSelector=0; |
|
47 | -if (empty($forceall)) $forceall=0; |
|
48 | -if (empty($senderissupplier)) $senderissupplier=0; |
|
49 | -if (empty($inputalsopricewithtax)) $inputalsopricewithtax=0; |
|
46 | +if (empty($dateSelector)) $dateSelector = 0; |
|
47 | +if (empty($forceall)) $forceall = 0; |
|
48 | +if (empty($senderissupplier)) $senderissupplier = 0; |
|
49 | +if (empty($inputalsopricewithtax)) $inputalsopricewithtax = 0; |
|
50 | 50 | |
51 | 51 | |
52 | 52 | // Define colspan for button Add |
53 | -$colspan = 3; // Col total ht + col edit + col delete |
|
54 | -if (! empty($inputalsopricewithtax)) $colspan++; // We add 1 if col total ttc |
|
55 | -if (in_array($object->element,array('propal','supplier_proposal','facture','invoice','commande','order','order_supplier','invoice_supplier'))) $colspan++; // With this, there is a column move button |
|
53 | +$colspan = 3; // Col total ht + col edit + col delete |
|
54 | +if (!empty($inputalsopricewithtax)) $colspan++; // We add 1 if col total ttc |
|
55 | +if (in_array($object->element, array('propal', 'supplier_proposal', 'facture', 'invoice', 'commande', 'order', 'order_supplier', 'invoice_supplier'))) $colspan++; // With this, there is a column move button |
|
56 | 56 | if (empty($user->rights->margins->creer)) $colspan++; |
57 | -if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) $colspan+=2; |
|
57 | +if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) $colspan += 2; |
|
58 | 58 | ?> |
59 | 59 | |
60 | 60 | <!-- BEGIN PHP TEMPLATE objectline_edit.tpl.php --> |
61 | 61 | |
62 | 62 | <?php |
63 | -$coldisplay=-1; // We remove first td |
|
63 | +$coldisplay = -1; // We remove first td |
|
64 | 64 | ?> |
65 | 65 | <tr <?php echo $bc[$var]; ?>> |
66 | - <?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?> |
|
67 | - <td class="linecolnum" align="center"><?php $coldisplay++; ?><?php echo ($i+1); ?></td> |
|
66 | + <?php if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?> |
|
67 | + <td class="linecolnum" align="center"><?php $coldisplay++; ?><?php echo ($i + 1); ?></td> |
|
68 | 68 | <?php } ?> |
69 | 69 | <td> |
70 | 70 | <div id="line_<?php echo $line->id; ?>"></div> |
71 | 71 | |
72 | 72 | <input type="hidden" name="lineid" value="<?php echo $line->id; ?>"> |
73 | 73 | <input type="hidden" id="product_type" name="type" value="<?php echo $line->product_type; ?>"> |
74 | - <input type="hidden" id="product_id" name="productid" value="<?php echo (! empty($line->fk_product)?$line->fk_product:0); ?>" /> |
|
74 | + <input type="hidden" id="product_id" name="productid" value="<?php echo (!empty($line->fk_product) ? $line->fk_product : 0); ?>" /> |
|
75 | 75 | <input type="hidden" id="special_code" name="special_code" value="<?php echo $line->special_code; ?>"> |
76 | 76 | |
77 | 77 | <?php if ($line->fk_product > 0) { ?> |
78 | 78 | |
79 | 79 | <a href="<?php echo DOL_URL_ROOT.'/product/card.php?id='.$line->fk_product; ?>"> |
80 | 80 | <?php |
81 | - if ($line->product_type==1) echo img_object($langs->trans('ShowService'),'service'); |
|
82 | - else print img_object($langs->trans('ShowProduct'),'product'); |
|
81 | + if ($line->product_type == 1) echo img_object($langs->trans('ShowService'), 'service'); |
|
82 | + else print img_object($langs->trans('ShowProduct'), 'product'); |
|
83 | 83 | echo ' '.$line->ref; |
84 | 84 | ?> |
85 | 85 | </a> |
@@ -95,8 +95,8 @@ discard block |
||
95 | 95 | if (is_object($hookmanager)) |
96 | 96 | { |
97 | 97 | $fk_parent_line = (GETPOST('fk_parent_line') ? GETPOST('fk_parent_line') : $line->fk_parent_line); |
98 | - $parameters=array('line'=>$line,'fk_parent_line'=>$fk_parent_line,'var'=>$var,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer); |
|
99 | - $reshook=$hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action); |
|
98 | + $parameters = array('line'=>$line, 'fk_parent_line'=>$fk_parent_line, 'var'=>$var, 'dateSelector'=>$dateSelector, 'seller'=>$seller, 'buyer'=>$buyer); |
|
99 | + $reshook = $hookmanager->executeHooks('formEditProductOptions', $parameters, $this, $action); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | // Do not allow editing during a situation cycle |
@@ -104,19 +104,19 @@ discard block |
||
104 | 104 | { |
105 | 105 | // editeur wysiwyg |
106 | 106 | require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
107 | - $nbrows=ROWS_2; |
|
108 | - if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; |
|
109 | - $enable=(isset($conf->global->FCKEDITOR_ENABLE_DETAILS)?$conf->global->FCKEDITOR_ENABLE_DETAILS:0); |
|
110 | - $toolbarname='dolibarr_details'; |
|
111 | - if (! empty($conf->global->FCKEDITOR_ENABLE_DETAILS_FULL)) $toolbarname='dolibarr_notes'; |
|
112 | - $doleditor=new DolEditor('product_desc',$line->description,'',164,$toolbarname,'',false,true,$enable,$nbrows,'98%'); |
|
107 | + $nbrows = ROWS_2; |
|
108 | + if (!empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows = $conf->global->MAIN_INPUT_DESC_HEIGHT; |
|
109 | + $enable = (isset($conf->global->FCKEDITOR_ENABLE_DETAILS) ? $conf->global->FCKEDITOR_ENABLE_DETAILS : 0); |
|
110 | + $toolbarname = 'dolibarr_details'; |
|
111 | + if (!empty($conf->global->FCKEDITOR_ENABLE_DETAILS_FULL)) $toolbarname = 'dolibarr_notes'; |
|
112 | + $doleditor = new DolEditor('product_desc', $line->description, '', 164, $toolbarname, '', false, true, $enable, $nbrows, '98%'); |
|
113 | 113 | $doleditor->Create(); |
114 | 114 | } else { |
115 | - print '<textarea id="product_desc" class="flat" name="product_desc" readonly style="width: 200px; height:80px;">' . $line->description . '</textarea>'; |
|
115 | + print '<textarea id="product_desc" class="flat" name="product_desc" readonly style="width: 200px; height:80px;">'.$line->description.'</textarea>'; |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | // Show autofill date for recuring invoices |
119 | - if (! empty($conf->service->enabled) && $line->product_type == 1 && $line->element == 'facturedetrec') |
|
119 | + if (!empty($conf->service->enabled) && $line->product_type == 1 && $line->element == 'facturedetrec') |
|
120 | 120 | { |
121 | 121 | echo '<br>'; |
122 | 122 | echo $langs->trans('AutoFillDateFrom').' '; |
@@ -139,13 +139,13 @@ discard block |
||
139 | 139 | |
140 | 140 | $coldisplay++; |
141 | 141 | if ($this->situation_counter == 1 || !$this->situation_cycle_ref) { |
142 | - print '<td align="right">' . $form->load_tva('tva_tx', $line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), $seller, $buyer, 0, $line->info_bits, $line->product_type, false, 1) . '</td>'; |
|
142 | + print '<td align="right">'.$form->load_tva('tva_tx', $line->tva_tx.($line->vat_src_code ? (' ('.$line->vat_src_code.')') : ''), $seller, $buyer, 0, $line->info_bits, $line->product_type, false, 1).'</td>'; |
|
143 | 143 | } else { |
144 | - print '<td align="right"><input size="1" type="text" class="flat right" name="tva_tx" value="' . price($line->tva_tx) . '" readonly />%</td>'; |
|
144 | + print '<td align="right"><input size="1" type="text" class="flat right" name="tva_tx" value="'.price($line->tva_tx).'" readonly />%</td>'; |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | $coldisplay++; |
148 | - print '<td align="right"><input type="text" class="flat right" size="5" id="price_ht" name="price_ht" value="' . (isset($line->pu_ht)?price($line->pu_ht,0,'',0):price($line->subprice,0,'',0)) . '"'; |
|
148 | + print '<td align="right"><input type="text" class="flat right" size="5" id="price_ht" name="price_ht" value="'.(isset($line->pu_ht) ?price($line->pu_ht, 0, '', 0) : price($line->subprice, 0, '', 0)).'"'; |
|
149 | 149 | if ($this->situation_counter > 1) print ' readonly'; |
150 | 150 | print '></td>'; |
151 | 151 | |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | if ($inputalsopricewithtax) |
157 | 157 | { |
158 | 158 | $coldisplay++; |
159 | - print '<td align="right"><input type="text" class="flat right" size="5" id="price_ttc" name="price_ttc" value="'.(isset($line->pu_ttc)?price($line->pu_ttc,0,'',0):'').'"'; |
|
159 | + print '<td align="right"><input type="text" class="flat right" size="5" id="price_ttc" name="price_ttc" value="'.(isset($line->pu_ttc) ?price($line->pu_ttc, 0, '', 0) : '').'"'; |
|
160 | 160 | if ($this->situation_counter > 1) print ' readonly'; |
161 | 161 | print '></td>'; |
162 | 162 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated |
168 | 168 | // must also not be output for most entities (proposal, intervention, ...) |
169 | 169 | //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." "; |
170 | - print '<input size="3" type="text" class="flat right" name="qty" id="qty" value="' . $line->qty . '"'; |
|
170 | + print '<input size="3" type="text" class="flat right" name="qty" id="qty" value="'.$line->qty.'"'; |
|
171 | 171 | if ($this->situation_counter > 1) print ' readonly'; |
172 | 172 | print '>'; |
173 | 173 | } else { ?> |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | </td> |
177 | 177 | |
178 | 178 | <?php |
179 | - if($conf->global->PRODUCT_USE_UNITS) |
|
179 | + if ($conf->global->PRODUCT_USE_UNITS) |
|
180 | 180 | { |
181 | 181 | print '<td align="left">'; |
182 | 182 | print $form->selectUnits($line->fk_unit, "units"); |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | |
187 | 187 | <td align="right" class="nowrap"><?php $coldisplay++; ?> |
188 | 188 | <?php if (($line->info_bits & 2) != 2) { |
189 | - print '<input size="1" type="text" class="flat right" name="remise_percent" id="remise_percent" value="' . $line->remise_percent . '"'; |
|
189 | + print '<input size="1" type="text" class="flat right" name="remise_percent" id="remise_percent" value="'.$line->remise_percent.'"'; |
|
190 | 190 | if ($this->situation_counter > 1) print ' readonly'; |
191 | 191 | print '>%'; |
192 | 192 | } else { ?> |
@@ -196,25 +196,25 @@ discard block |
||
196 | 196 | <?php |
197 | 197 | if ($this->situation_cycle_ref) { |
198 | 198 | $coldisplay++; |
199 | - print '<td align="right" class="nowrap"><input class="right" type="text" size="1" value="' . $line->situation_percent . '" name="progress">%</td>'; |
|
199 | + print '<td align="right" class="nowrap"><input class="right" type="text" size="1" value="'.$line->situation_percent.'" name="progress">%</td>'; |
|
200 | 200 | } |
201 | - if (! empty($usemargins)) |
|
201 | + if (!empty($usemargins)) |
|
202 | 202 | { |
203 | 203 | ?> |
204 | 204 | <?php if (!empty($user->rights->margins->creer)) { ?> |
205 | 205 | <td align="right" class="margininfos"><?php $coldisplay++; ?> |
206 | 206 | <!-- For predef product --> |
207 | - <?php if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { ?> |
|
207 | + <?php if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { ?> |
|
208 | 208 | <select id="fournprice_predef" name="fournprice_predef" class="flat right" style="display: none;"></select> |
209 | 209 | <?php } ?> |
210 | 210 | <!-- For free product --> |
211 | - <input class="flat right" type="text" size="5" id="buying_price" name="buying_price" class="hideobject" value="<?php echo price($line->pa_ht,0,'',0); ?>"> |
|
211 | + <input class="flat right" type="text" size="5" id="buying_price" name="buying_price" class="hideobject" value="<?php echo price($line->pa_ht, 0, '', 0); ?>"> |
|
212 | 212 | </td> |
213 | 213 | <?php } ?> |
214 | 214 | <?php if ($user->rights->margins->creer) { |
215 | - if (! empty($conf->global->DISPLAY_MARGIN_RATES)) |
|
215 | + if (!empty($conf->global->DISPLAY_MARGIN_RATES)) |
|
216 | 216 | { |
217 | - $margin_rate = (isset($_POST["np_marginRate"])?GETPOST("np_marginRate","alpha",2):(($line->pa_ht == 0)?'':price($line->marge_tx))); |
|
217 | + $margin_rate = (isset($_POST["np_marginRate"]) ?GETPOST("np_marginRate", "alpha", 2) : (($line->pa_ht == 0) ? '' : price($line->marge_tx))); |
|
218 | 218 | // if credit note, dont allow to modify margin |
219 | 219 | if ($line->subprice < 0) |
220 | 220 | echo '<td align="right" class="nowrap margininfos">'.$margin_rate.'<span class="hideonsmartphone">%</span></td>'; |
@@ -222,9 +222,9 @@ discard block |
||
222 | 222 | echo '<td align="right" class="nowrap margininfos"><input class="right" type="text" size="2" name="np_marginRate" value="'.$margin_rate.'"><span class="hideonsmartphone">%</span></td>'; |
223 | 223 | $coldisplay++; |
224 | 224 | } |
225 | - elseif (! empty($conf->global->DISPLAY_MARK_RATES)) |
|
225 | + elseif (!empty($conf->global->DISPLAY_MARK_RATES)) |
|
226 | 226 | { |
227 | - $mark_rate = (isset($_POST["np_markRate"])?GETPOST("np_markRate",'alpha',2):price($line->marque_tx)); |
|
227 | + $mark_rate = (isset($_POST["np_markRate"]) ?GETPOST("np_markRate", 'alpha', 2) : price($line->marque_tx)); |
|
228 | 228 | // if credit note, dont allow to modify margin |
229 | 229 | if ($line->subprice < 0) |
230 | 230 | echo '<td align="right" class="nowrap margininfos">'.$mark_rate.'<span class="hideonsmartphone">%</span></td>'; |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | ?> |
238 | 238 | |
239 | 239 | <!-- colspan=4 for this td because it replace total_ht+3 td for buttons --> |
240 | - <td align="center" colspan="<?php echo $colspan; ?>" valign="middle"><?php $coldisplay+=4; ?> |
|
240 | + <td align="center" colspan="<?php echo $colspan; ?>" valign="middle"><?php $coldisplay += 4; ?> |
|
241 | 241 | <input type="submit" class="button" id="savelinebutton" name="save" value="<?php echo $langs->trans("Save"); ?>"><br> |
242 | 242 | <input type="submit" class="button" id="cancellinebutton" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>"> |
243 | 243 | </td> |
@@ -247,21 +247,21 @@ discard block |
||
247 | 247 | //Line extrafield |
248 | 248 | if (!empty($extrafieldsline)) |
249 | 249 | { |
250 | - print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bc[$var],'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); |
|
250 | + print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bc[$var], 'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD) ? 0 : 1); |
|
251 | 251 | } |
252 | 252 | ?> |
253 | 253 | |
254 | -<?php if (! empty($conf->service->enabled) && $line->product_type == 1 && $dateSelector) { ?> |
|
254 | +<?php if (!empty($conf->service->enabled) && $line->product_type == 1 && $dateSelector) { ?> |
|
255 | 255 | <tr id="service_duration_area" <?php echo $bc[$var]; ?>> |
256 | - <?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?> |
|
256 | + <?php if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?> |
|
257 | 257 | <td class="linecolnum" align="center"><?php $coldisplay++; ?></td> |
258 | 258 | <?php } ?> |
259 | - <td colspan="<?php echo 7+$colspan ?>"><?php echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?> |
|
259 | + <td colspan="<?php echo 7 + $colspan ?>"><?php echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?> |
|
260 | 260 | <?php |
261 | - $hourmin=(isset($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE:''); |
|
262 | - print $form->selectDate($line->date_start, 'date_start', $hourmin, $hourmin, $line->date_start?0:1, "updateline", 1, 0); |
|
261 | + $hourmin = (isset($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE : ''); |
|
262 | + print $form->selectDate($line->date_start, 'date_start', $hourmin, $hourmin, $line->date_start ? 0 : 1, "updateline", 1, 0); |
|
263 | 263 | print ' '.$langs->trans('to').' '; |
264 | - print $form->selectDate($line->date_end, 'date_end', $hourmin, $hourmin, $line->date_end?0:1, "updateline", 1, 0); |
|
264 | + print $form->selectDate($line->date_end, 'date_end', $hourmin, $hourmin, $line->date_end ? 0 : 1, "updateline", 1, 0); |
|
265 | 265 | print '<script type="text/javascript">'; |
266 | 266 | if (!$line->date_start) { |
267 | 267 | if (isset($conf->global->MAIN_DEFAULT_DATE_START_HOUR)) { |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | }); |
315 | 315 | |
316 | 316 | <?php |
317 | - if (! empty($conf->margin->enabled)) |
|
317 | + if (!empty($conf->margin->enabled)) |
|
318 | 318 | { |
319 | 319 | ?> |
320 | 320 | /* Add rule to clear margin when we change some data, so when we change sell or buy price, margin will be recalculated after submitting form */ |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | }); |
345 | 345 | |
346 | 346 | /* Init field buying_price and fournprice */ |
347 | - $.post('<?php echo DOL_URL_ROOT; ?>/fourn/ajax/getSupplierPrices.php', {'idprod': <?php echo $line->fk_product?$line->fk_product:0; ?>}, function(data) { |
|
347 | + $.post('<?php echo DOL_URL_ROOT; ?>/fourn/ajax/getSupplierPrices.php', {'idprod': <?php echo $line->fk_product ? $line->fk_product : 0; ?>}, function(data) { |
|
348 | 348 | if (data && data.length > 0) { |
349 | 349 | var options = ''; |
350 | 350 | var trouve=false; |
@@ -40,21 +40,41 @@ discard block |
||
40 | 40 | |
41 | 41 | |
42 | 42 | $usemargins=0; |
43 | -if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) $usemargins=1; |
|
43 | +if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) { |
|
44 | + $usemargins=1; |
|
45 | +} |
|
44 | 46 | |
45 | 47 | global $forceall, $senderissupplier, $inputalsopricewithtax; |
46 | -if (empty($dateSelector)) $dateSelector=0; |
|
47 | -if (empty($forceall)) $forceall=0; |
|
48 | -if (empty($senderissupplier)) $senderissupplier=0; |
|
49 | -if (empty($inputalsopricewithtax)) $inputalsopricewithtax=0; |
|
48 | +if (empty($dateSelector)) { |
|
49 | + $dateSelector=0; |
|
50 | +} |
|
51 | +if (empty($forceall)) { |
|
52 | + $forceall=0; |
|
53 | +} |
|
54 | +if (empty($senderissupplier)) { |
|
55 | + $senderissupplier=0; |
|
56 | +} |
|
57 | +if (empty($inputalsopricewithtax)) { |
|
58 | + $inputalsopricewithtax=0; |
|
59 | +} |
|
50 | 60 | |
51 | 61 | |
52 | 62 | // Define colspan for button Add |
53 | 63 | $colspan = 3; // Col total ht + col edit + col delete |
54 | -if (! empty($inputalsopricewithtax)) $colspan++; // We add 1 if col total ttc |
|
55 | -if (in_array($object->element,array('propal','supplier_proposal','facture','invoice','commande','order','order_supplier','invoice_supplier'))) $colspan++; // With this, there is a column move button |
|
56 | -if (empty($user->rights->margins->creer)) $colspan++; |
|
57 | -if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) $colspan+=2; |
|
64 | +if (! empty($inputalsopricewithtax)) { |
|
65 | + $colspan++; |
|
66 | +} |
|
67 | +// We add 1 if col total ttc |
|
68 | +if (in_array($object->element,array('propal','supplier_proposal','facture','invoice','commande','order','order_supplier','invoice_supplier'))) { |
|
69 | + $colspan++; |
|
70 | +} |
|
71 | +// With this, there is a column move button |
|
72 | +if (empty($user->rights->margins->creer)) { |
|
73 | + $colspan++; |
|
74 | +} |
|
75 | +if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { |
|
76 | + $colspan+=2; |
|
77 | +} |
|
58 | 78 | ?> |
59 | 79 | |
60 | 80 | <!-- BEGIN PHP TEMPLATE objectline_edit.tpl.php --> |
@@ -78,8 +98,11 @@ discard block |
||
78 | 98 | |
79 | 99 | <a href="<?php echo DOL_URL_ROOT.'/product/card.php?id='.$line->fk_product; ?>"> |
80 | 100 | <?php |
81 | - if ($line->product_type==1) echo img_object($langs->trans('ShowService'),'service'); |
|
82 | - else print img_object($langs->trans('ShowProduct'),'product'); |
|
101 | + if ($line->product_type==1) { |
|
102 | + echo img_object($langs->trans('ShowService'),'service'); |
|
103 | + } else { |
|
104 | + print img_object($langs->trans('ShowProduct'),'product'); |
|
105 | + } |
|
83 | 106 | echo ' '.$line->ref; |
84 | 107 | ?> |
85 | 108 | </a> |
@@ -105,10 +128,14 @@ discard block |
||
105 | 128 | // editeur wysiwyg |
106 | 129 | require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
107 | 130 | $nbrows=ROWS_2; |
108 | - if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; |
|
131 | + if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) { |
|
132 | + $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; |
|
133 | + } |
|
109 | 134 | $enable=(isset($conf->global->FCKEDITOR_ENABLE_DETAILS)?$conf->global->FCKEDITOR_ENABLE_DETAILS:0); |
110 | 135 | $toolbarname='dolibarr_details'; |
111 | - if (! empty($conf->global->FCKEDITOR_ENABLE_DETAILS_FULL)) $toolbarname='dolibarr_notes'; |
|
136 | + if (! empty($conf->global->FCKEDITOR_ENABLE_DETAILS_FULL)) { |
|
137 | + $toolbarname='dolibarr_notes'; |
|
138 | + } |
|
112 | 139 | $doleditor=new DolEditor('product_desc',$line->description,'',164,$toolbarname,'',false,true,$enable,$nbrows,'98%'); |
113 | 140 | $doleditor->Create(); |
114 | 141 | } else { |
@@ -130,10 +157,13 @@ discard block |
||
130 | 157 | </td> |
131 | 158 | |
132 | 159 | <?php |
133 | - if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines |
|
160 | + if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') { |
|
161 | + // We must have same test in printObjectLines |
|
134 | 162 | { |
135 | 163 | ?> |
136 | - <td align="right"><input id="fourn_ref" name="fourn_ref" class="flat minwidth75" value="<?php echo ($line->ref_supplier ? $line->ref_supplier : $line->ref_fourn); ?>"></td> |
|
164 | + <td align="right"><input id="fourn_ref" name="fourn_ref" class="flat minwidth75" value="<?php echo ($line->ref_supplier ? $line->ref_supplier : $line->ref_fourn); |
|
165 | + } |
|
166 | + ?>"></td> |
|
137 | 167 | <?php |
138 | 168 | } |
139 | 169 | |
@@ -146,7 +176,9 @@ discard block |
||
146 | 176 | |
147 | 177 | $coldisplay++; |
148 | 178 | print '<td align="right"><input type="text" class="flat right" size="5" id="price_ht" name="price_ht" value="' . (isset($line->pu_ht)?price($line->pu_ht,0,'',0):price($line->subprice,0,'',0)) . '"'; |
149 | - if ($this->situation_counter > 1) print ' readonly'; |
|
179 | + if ($this->situation_counter > 1) { |
|
180 | + print ' readonly'; |
|
181 | + } |
|
150 | 182 | print '></td>'; |
151 | 183 | |
152 | 184 | if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { |
@@ -157,7 +189,9 @@ discard block |
||
157 | 189 | { |
158 | 190 | $coldisplay++; |
159 | 191 | print '<td align="right"><input type="text" class="flat right" size="5" id="price_ttc" name="price_ttc" value="'.(isset($line->pu_ttc)?price($line->pu_ttc,0,'',0):'').'"'; |
160 | - if ($this->situation_counter > 1) print ' readonly'; |
|
192 | + if ($this->situation_counter > 1) { |
|
193 | + print ' readonly'; |
|
194 | + } |
|
161 | 195 | print '></td>'; |
162 | 196 | } |
163 | 197 | ?> |
@@ -168,7 +202,9 @@ discard block |
||
168 | 202 | // must also not be output for most entities (proposal, intervention, ...) |
169 | 203 | //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." "; |
170 | 204 | print '<input size="3" type="text" class="flat right" name="qty" id="qty" value="' . $line->qty . '"'; |
171 | - if ($this->situation_counter > 1) print ' readonly'; |
|
205 | + if ($this->situation_counter > 1) { |
|
206 | + print ' readonly'; |
|
207 | + } |
|
172 | 208 | print '>'; |
173 | 209 | } else { ?> |
174 | 210 | |
@@ -187,7 +223,9 @@ discard block |
||
187 | 223 | <td align="right" class="nowrap"><?php $coldisplay++; ?> |
188 | 224 | <?php if (($line->info_bits & 2) != 2) { |
189 | 225 | print '<input size="1" type="text" class="flat right" name="remise_percent" id="remise_percent" value="' . $line->remise_percent . '"'; |
190 | - if ($this->situation_counter > 1) print ' readonly'; |
|
226 | + if ($this->situation_counter > 1) { |
|
227 | + print ' readonly'; |
|
228 | + } |
|
191 | 229 | print '>%'; |
192 | 230 | } else { ?> |
193 | 231 | |
@@ -216,20 +254,21 @@ discard block |
||
216 | 254 | { |
217 | 255 | $margin_rate = (isset($_POST["np_marginRate"])?GETPOST("np_marginRate","alpha",2):(($line->pa_ht == 0)?'':price($line->marge_tx))); |
218 | 256 | // if credit note, dont allow to modify margin |
219 | - if ($line->subprice < 0) |
|
220 | - echo '<td align="right" class="nowrap margininfos">'.$margin_rate.'<span class="hideonsmartphone">%</span></td>'; |
|
221 | - else |
|
222 | - echo '<td align="right" class="nowrap margininfos"><input class="right" type="text" size="2" name="np_marginRate" value="'.$margin_rate.'"><span class="hideonsmartphone">%</span></td>'; |
|
257 | + if ($line->subprice < 0) { |
|
258 | + echo '<td align="right" class="nowrap margininfos">'.$margin_rate.'<span class="hideonsmartphone">%</span></td>'; |
|
259 | + } else { |
|
260 | + echo '<td align="right" class="nowrap margininfos"><input class="right" type="text" size="2" name="np_marginRate" value="'.$margin_rate.'"><span class="hideonsmartphone">%</span></td>'; |
|
261 | + } |
|
223 | 262 | $coldisplay++; |
224 | - } |
|
225 | - elseif (! empty($conf->global->DISPLAY_MARK_RATES)) |
|
263 | + } elseif (! empty($conf->global->DISPLAY_MARK_RATES)) |
|
226 | 264 | { |
227 | 265 | $mark_rate = (isset($_POST["np_markRate"])?GETPOST("np_markRate",'alpha',2):price($line->marque_tx)); |
228 | 266 | // if credit note, dont allow to modify margin |
229 | - if ($line->subprice < 0) |
|
230 | - echo '<td align="right" class="nowrap margininfos">'.$mark_rate.'<span class="hideonsmartphone">%</span></td>'; |
|
231 | - else |
|
232 | - echo '<td align="right" class="nowrap margininfos"><input class="right" type="text" size="2" name="np_markRate" value="'.$mark_rate.'"><span class="hideonsmartphone">%</span></td>'; |
|
267 | + if ($line->subprice < 0) { |
|
268 | + echo '<td align="right" class="nowrap margininfos">'.$mark_rate.'<span class="hideonsmartphone">%</span></td>'; |
|
269 | + } else { |
|
270 | + echo '<td align="right" class="nowrap margininfos"><input class="right" type="text" size="2" name="np_markRate" value="'.$mark_rate.'"><span class="hideonsmartphone">%</span></td>'; |
|
271 | + } |
|
233 | 272 | $coldisplay++; |
234 | 273 | } |
235 | 274 | } |
@@ -18,8 +18,8 @@ |
||
18 | 18 | // Protection to avoid direct call of template |
19 | 19 | if (empty($conf) || ! is_object($conf)) |
20 | 20 | { |
21 | - print "Error, template page can't be called as URL"; |
|
22 | - exit; |
|
21 | + print "Error, template page can't be called as URL"; |
|
22 | + exit; |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | $objectUrl = $object->getNomUrl(0,'',0,1); |
@@ -16,14 +16,14 @@ discard block |
||
16 | 16 | */ |
17 | 17 | |
18 | 18 | // Protection to avoid direct call of template |
19 | -if (empty($conf) || ! is_object($conf)) |
|
19 | +if (empty($conf) || !is_object($conf)) |
|
20 | 20 | { |
21 | 21 | print "Error, template page can't be called as URL"; |
22 | 22 | exit; |
23 | 23 | } |
24 | 24 | |
25 | -$objectUrl = $object->getNomUrl(0,'',0,1); |
|
26 | -if($object->element == 'propal') |
|
25 | +$objectUrl = $object->getNomUrl(0, '', 0, 1); |
|
26 | +if ($object->element == 'propal') |
|
27 | 27 | { |
28 | 28 | $objectUrl = DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id; |
29 | 29 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | }); |
54 | 54 | |
55 | 55 | |
56 | - var $dialog = $('<form id="' + formId + '" action="<?php print $objectUrl ; ?>" method="post" ></form>') |
|
56 | + var $dialog = $('<form id="' + formId + '" action="<?php print $objectUrl; ?>" method="post" ></form>') |
|
57 | 57 | .load( page + " #tablelines", function() { |
58 | 58 | |
59 | 59 | $("#" + formId + " #tablelines").prop("id", "ajaxloaded_tablelines"); // change id attribute |
@@ -28,8 +28,8 @@ |
||
28 | 28 | // Protection to avoid direct call of template |
29 | 29 | if (empty($object) || ! is_object($object)) |
30 | 30 | { |
31 | - print "Error, template page can't be called as URL"; |
|
32 | - exit; |
|
31 | + print "Error, template page can't be called as URL"; |
|
32 | + exit; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | ?> |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | |
28 | 28 | // Protection to avoid direct call of template |
29 | -if (empty($object) || ! is_object($object)) |
|
29 | +if (empty($object) || !is_object($object)) |
|
30 | 30 | { |
31 | 31 | print "Error, template page can't be called as URL"; |
32 | 32 | exit; |
@@ -36,15 +36,15 @@ discard block |
||
36 | 36 | |
37 | 37 | <!-- BEGIN PHP TEMPLATE AJAXROW.TPL.PHP - Script to enable drag and drop on lines of a table --> |
38 | 38 | <?php |
39 | -$id=$object->id; |
|
40 | -$fk_element=empty($object->fk_element)?$fk_element:$object->fk_element; |
|
41 | -$table_element_line=(empty($table_element_line)?$object->table_element_line:$table_element_line); |
|
42 | -$nboflines=(isset($object->lines)?count($object->lines):(isset($tasksarray)?count($tasksarray):(empty($nboflines)?0:$nboflines))); |
|
43 | -$forcereloadpage=empty($conf->global->MAIN_FORCE_RELOAD_PAGE)?0:1; |
|
44 | -$tagidfortablednd=(empty($tagidfortablednd)?'tablelines':$tagidfortablednd); |
|
45 | -$filepath=(empty($filepath)?'':$filepath); |
|
39 | +$id = $object->id; |
|
40 | +$fk_element = empty($object->fk_element) ? $fk_element : $object->fk_element; |
|
41 | +$table_element_line = (empty($table_element_line) ? $object->table_element_line : $table_element_line); |
|
42 | +$nboflines = (isset($object->lines) ?count($object->lines) : (isset($tasksarray) ?count($tasksarray) : (empty($nboflines) ? 0 : $nboflines))); |
|
43 | +$forcereloadpage = empty($conf->global->MAIN_FORCE_RELOAD_PAGE) ? 0 : 1; |
|
44 | +$tagidfortablednd = (empty($tagidfortablednd) ? 'tablelines' : $tagidfortablednd); |
|
45 | +$filepath = (empty($filepath) ? '' : $filepath); |
|
46 | 46 | |
47 | -if (GETPOST('action','aZ09') != 'editline' && $nboflines > 1) { ?> |
|
47 | +if (GETPOST('action', 'aZ09') != 'editline' && $nboflines > 1) { ?> |
|
48 | 48 | <script type="text/javascript"> |
49 | 49 | $(document).ready(function(){ |
50 | 50 | $(".imgupforline").hide(); |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | // Protection to avoid direct call of template |
30 | 30 | if (empty($conf) || ! is_object($conf)) |
31 | 31 | { |
32 | - print "Error, template page can't be called as URL"; |
|
33 | - exit; |
|
32 | + print "Error, template page can't be called as URL"; |
|
33 | + exit; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -54,17 +54,17 @@ discard block |
||
54 | 54 | var list = jQuery("#list"); |
55 | 55 | var totalizable = jQuery("#totalizable"); |
56 | 56 | <?php |
57 | - if((GETPOST('type','alpha') != "select") && (GETPOST('type','alpha') != "sellist")) |
|
58 | - { |
|
59 | - print 'jQuery("#value_choice").hide();'; |
|
60 | - } |
|
57 | + if((GETPOST('type','alpha') != "select") && (GETPOST('type','alpha') != "sellist")) |
|
58 | + { |
|
59 | + print 'jQuery("#value_choice").hide();'; |
|
60 | + } |
|
61 | 61 | |
62 | - if (GETPOST('type','alpha') == "separate") |
|
63 | - { |
|
64 | - print "jQuery('#size, #default_value, #langfile').val('').prop('disabled', true);"; |
|
65 | - print 'jQuery("#value_choice").hide();'; |
|
66 | - } |
|
67 | - ?> |
|
62 | + if (GETPOST('type','alpha') == "separate") |
|
63 | + { |
|
64 | + print "jQuery('#size, #default_value, #langfile').val('').prop('disabled', true);"; |
|
65 | + print 'jQuery("#value_choice").hide();'; |
|
66 | + } |
|
67 | + ?> |
|
68 | 68 | |
69 | 69 | // Case of computed field |
70 | 70 | if (type == 'varchar' || type == 'int' || type == 'double' || type == 'price') { |
@@ -164,19 +164,19 @@ discard block |
||
164 | 164 | |
165 | 165 | if((($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) && is_array($param)) |
166 | 166 | { |
167 | - $param_chain = ''; |
|
168 | - foreach ($param['options'] as $key => $value) |
|
169 | - { |
|
170 | - if(strlen($key)) |
|
171 | - { |
|
172 | - $param_chain .= $key.','.$value."\n"; |
|
173 | - } |
|
174 | - } |
|
167 | + $param_chain = ''; |
|
168 | + foreach ($param['options'] as $key => $value) |
|
169 | + { |
|
170 | + if(strlen($key)) |
|
171 | + { |
|
172 | + $param_chain .= $key.','.$value."\n"; |
|
173 | + } |
|
174 | + } |
|
175 | 175 | } |
176 | 176 | elseif (($type== 'sellist') || ($type == 'chkbxlst') || ($type == 'link') || ($type == 'password')) |
177 | 177 | { |
178 | - $paramlist=array_keys($param['options']); |
|
179 | - $param_chain = $paramlist[0]; |
|
178 | + $paramlist=array_keys($param['options']); |
|
179 | + $param_chain = $paramlist[0]; |
|
180 | 180 | } |
181 | 181 | ?> |
182 | 182 | <!-- Label --> |
@@ -188,11 +188,11 @@ discard block |
||
188 | 188 | <?php |
189 | 189 | // Define list of possible type transition |
190 | 190 | $typewecanchangeinto=array( |
191 | - 'varchar'=>array('varchar', 'phone', 'mail', 'url', 'select', 'password', 'text', 'html'), |
|
192 | - 'text'=>array('text','html'), |
|
193 | - 'html'=>array('text','html'), |
|
194 | - 'password'=>array('password', 'varchar'), |
|
195 | - 'mail'=>array('varchar', 'phone', 'mail', 'url', 'select'), |
|
191 | + 'varchar'=>array('varchar', 'phone', 'mail', 'url', 'select', 'password', 'text', 'html'), |
|
192 | + 'text'=>array('text','html'), |
|
193 | + 'html'=>array('text','html'), |
|
194 | + 'password'=>array('password', 'varchar'), |
|
195 | + 'mail'=>array('varchar', 'phone', 'mail', 'url', 'select'), |
|
196 | 196 | 'url'=>array('varchar', 'phone', 'mail', 'url', 'select'), |
197 | 197 | 'phone'=>array('varchar', 'phone', 'mail', 'url', 'select'), |
198 | 198 | 'select'=>array('varchar', 'phone', 'mail', 'url', 'select') |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | } |
213 | 213 | else |
214 | 214 | { |
215 | - print $type2label[$type]; |
|
215 | + print $type2label[$type]; |
|
216 | 216 | print '<input type="hidden" name="type" id="type" value="'.$type.'">'; |
217 | 217 | } |
218 | 218 | ?> |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | */ |
28 | 28 | |
29 | 29 | // Protection to avoid direct call of template |
30 | -if (empty($conf) || ! is_object($conf)) |
|
30 | +if (empty($conf) || !is_object($conf)) |
|
31 | 31 | { |
32 | 32 | print "Error, template page can't be called as URL"; |
33 | 33 | exit; |
@@ -54,12 +54,12 @@ discard block |
||
54 | 54 | var list = jQuery("#list"); |
55 | 55 | var totalizable = jQuery("#totalizable"); |
56 | 56 | <?php |
57 | - if((GETPOST('type','alpha') != "select") && (GETPOST('type','alpha') != "sellist")) |
|
57 | + if ((GETPOST('type', 'alpha') != "select") && (GETPOST('type', 'alpha') != "sellist")) |
|
58 | 58 | { |
59 | 59 | print 'jQuery("#value_choice").hide();'; |
60 | 60 | } |
61 | 61 | |
62 | - if (GETPOST('type','alpha') == "separate") |
|
62 | + if (GETPOST('type', 'alpha') == "separate") |
|
63 | 63 | { |
64 | 64 | print "jQuery('#size, #default_value, #langfile').val('').prop('disabled', true);"; |
65 | 65 | print 'jQuery("#value_choice").hide();'; |
@@ -145,37 +145,37 @@ discard block |
||
145 | 145 | <table summary="listofattributes" class="border centpercent"> |
146 | 146 | |
147 | 147 | <?php |
148 | -$label=$extrafields->attributes[$elementtype]['label'][$attrname]; |
|
149 | -$type=$extrafields->attributes[$elementtype]['type'][$attrname]; |
|
150 | -$size=$extrafields->attributes[$elementtype]['size'][$attrname]; |
|
151 | -$computed=$extrafields->attributes[$elementtype]['computed'][$attrname]; |
|
152 | -$default=$extrafields->attributes[$elementtype]['default'][$attrname]; |
|
153 | -$unique=$extrafields->attributes[$elementtype]['unique'][$attrname]; |
|
154 | -$required=$extrafields->attributes[$elementtype]['required'][$attrname]; |
|
155 | -$pos=$extrafields->attributes[$elementtype]['pos'][$attrname]; |
|
156 | -$alwayseditable=$extrafields->attributes[$elementtype]['alwayseditable'][$attrname]; |
|
157 | -$param=$extrafields->attributes[$elementtype]['param'][$attrname]; |
|
158 | -$perms=$extrafields->attributes[$elementtype]['perms'][$attrname]; |
|
159 | -$langfile=$extrafields->attributes[$elementtype]['langfile'][$attrname]; |
|
160 | -$list=$extrafields->attributes[$elementtype]['list'][$attrname]; |
|
148 | +$label = $extrafields->attributes[$elementtype]['label'][$attrname]; |
|
149 | +$type = $extrafields->attributes[$elementtype]['type'][$attrname]; |
|
150 | +$size = $extrafields->attributes[$elementtype]['size'][$attrname]; |
|
151 | +$computed = $extrafields->attributes[$elementtype]['computed'][$attrname]; |
|
152 | +$default = $extrafields->attributes[$elementtype]['default'][$attrname]; |
|
153 | +$unique = $extrafields->attributes[$elementtype]['unique'][$attrname]; |
|
154 | +$required = $extrafields->attributes[$elementtype]['required'][$attrname]; |
|
155 | +$pos = $extrafields->attributes[$elementtype]['pos'][$attrname]; |
|
156 | +$alwayseditable = $extrafields->attributes[$elementtype]['alwayseditable'][$attrname]; |
|
157 | +$param = $extrafields->attributes[$elementtype]['param'][$attrname]; |
|
158 | +$perms = $extrafields->attributes[$elementtype]['perms'][$attrname]; |
|
159 | +$langfile = $extrafields->attributes[$elementtype]['langfile'][$attrname]; |
|
160 | +$list = $extrafields->attributes[$elementtype]['list'][$attrname]; |
|
161 | 161 | $totalizable = $extrafields->attributes[$elementtype]['totalizable'][$attrname]; |
162 | -$help=$extrafields->attributes[$elementtype]['help'][$attrname]; |
|
163 | -$entitycurrentorall=$extrafields->attributes[$elementtype]['entityid'][$attrname]; |
|
162 | +$help = $extrafields->attributes[$elementtype]['help'][$attrname]; |
|
163 | +$entitycurrentorall = $extrafields->attributes[$elementtype]['entityid'][$attrname]; |
|
164 | 164 | |
165 | -if((($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) && is_array($param)) |
|
165 | +if ((($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) && is_array($param)) |
|
166 | 166 | { |
167 | 167 | $param_chain = ''; |
168 | 168 | foreach ($param['options'] as $key => $value) |
169 | 169 | { |
170 | - if(strlen($key)) |
|
170 | + if (strlen($key)) |
|
171 | 171 | { |
172 | 172 | $param_chain .= $key.','.$value."\n"; |
173 | 173 | } |
174 | 174 | } |
175 | 175 | } |
176 | -elseif (($type== 'sellist') || ($type == 'chkbxlst') || ($type == 'link') || ($type == 'password')) |
|
176 | +elseif (($type == 'sellist') || ($type == 'chkbxlst') || ($type == 'link') || ($type == 'password')) |
|
177 | 177 | { |
178 | - $paramlist=array_keys($param['options']); |
|
178 | + $paramlist = array_keys($param['options']); |
|
179 | 179 | $param_chain = $paramlist[0]; |
180 | 180 | } |
181 | 181 | ?> |
@@ -187,10 +187,10 @@ discard block |
||
187 | 187 | <tr><td class="fieldrequired"><?php echo $langs->trans("Type"); ?></td><td class="valeur"> |
188 | 188 | <?php |
189 | 189 | // Define list of possible type transition |
190 | -$typewecanchangeinto=array( |
|
190 | +$typewecanchangeinto = array( |
|
191 | 191 | 'varchar'=>array('varchar', 'phone', 'mail', 'url', 'select', 'password', 'text', 'html'), |
192 | - 'text'=>array('text','html'), |
|
193 | - 'html'=>array('text','html'), |
|
192 | + 'text'=>array('text', 'html'), |
|
193 | + 'html'=>array('text', 'html'), |
|
194 | 194 | 'password'=>array('password', 'varchar'), |
195 | 195 | 'mail'=>array('varchar', 'phone', 'mail', 'url', 'select'), |
196 | 196 | 'url'=>array('varchar', 'phone', 'mail', 'url', 'select'), |
@@ -199,12 +199,12 @@ discard block |
||
199 | 199 | ); |
200 | 200 | if (in_array($type, array_keys($typewecanchangeinto))) |
201 | 201 | { |
202 | - $newarray=array(); |
|
202 | + $newarray = array(); |
|
203 | 203 | print '<select id="type" class="flat type" name="type">'; |
204 | - foreach($type2label as $key => $val) |
|
204 | + foreach ($type2label as $key => $val) |
|
205 | 205 | { |
206 | - $selected=''; |
|
207 | - if ($key == (GETPOST('type','alpha')?GETPOST('type','alpha'):$type)) $selected=' selected="selected"'; |
|
206 | + $selected = ''; |
|
207 | + if ($key == (GETPOST('type', 'alpha') ?GETPOST('type', 'alpha') : $type)) $selected = ' selected="selected"'; |
|
208 | 208 | if (in_array($key, $typewecanchangeinto[$type])) print '<option value="'.$key.'"'.$selected.'>'.$val.'</option>'; |
209 | 209 | else print '<option value="'.$key.'" disabled="disabled"'.$selected.'>'.$val.'</option>'; |
210 | 210 | } |
@@ -229,37 +229,37 @@ discard block |
||
229 | 229 | <tr><td> |
230 | 230 | <textarea name="param" id="param" cols="80" rows="<?php echo ROWS_4 ?>"><?php echo dol_htmlcleanlastbr($param_chain); ?></textarea> |
231 | 231 | </td><td> |
232 | - <span id="helpselect"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"),1,0,'', 0, 2, 'helpvalue1')?></span> |
|
233 | - <span id="helpsellist"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"),1,0,'', 0, 2, 'helpvalue2')?></span> |
|
234 | - <span id="helpchkbxlst"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"),1,0,'', 0, 2, 'helpvalue3')?></span> |
|
235 | - <span id="helplink"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelplink"),1,0,'', 0, 2, 'helpvalue4')?></span> |
|
236 | - <span id="helppassword"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"),1,0,'', 0, 2, 'helpvalue5')?></span> |
|
232 | + <span id="helpselect"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"), 1, 0, '', 0, 2, 'helpvalue1')?></span> |
|
233 | + <span id="helpsellist"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"), 1, 0, '', 0, 2, 'helpvalue2')?></span> |
|
234 | + <span id="helpchkbxlst"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"), 1, 0, '', 0, 2, 'helpvalue3')?></span> |
|
235 | + <span id="helplink"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelplink"), 1, 0, '', 0, 2, 'helpvalue4')?></span> |
|
236 | + <span id="helppassword"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"), 1, 0, '', 0, 2, 'helpvalue5')?></span> |
|
237 | 237 | </td></tr> |
238 | 238 | </table> |
239 | 239 | </td> |
240 | 240 | </tr> |
241 | 241 | <!-- Position --> |
242 | -<tr><td class="titlefield"><?php echo $langs->trans("Position"); ?></td><td class="valeur"><input type="text" name="pos" size="5" value="<?php echo dol_escape_htmltag($pos); ?>"></td></tr> |
|
242 | +<tr><td class="titlefield"><?php echo $langs->trans("Position"); ?></td><td class="valeur"><input type="text" name="pos" size="5" value="<?php echo dol_escape_htmltag($pos); ?>"></td></tr> |
|
243 | 243 | <!-- Language file --> |
244 | -<tr><td class="titlefield"><?php echo $langs->trans("LanguageFile"); ?></td><td class="valeur"><input type="text" name="langfile" class="minwidth200" value="<?php echo dol_escape_htmltag($langfile); ?>"></td></tr> |
|
244 | +<tr><td class="titlefield"><?php echo $langs->trans("LanguageFile"); ?></td><td class="valeur"><input type="text" name="langfile" class="minwidth200" value="<?php echo dol_escape_htmltag($langfile); ?>"></td></tr> |
|
245 | 245 | <!-- Computed value --> |
246 | 246 | <tr class="extra_computed_value"><td><?php echo $form->textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?></td><td class="valeur"><input id="computed_value" class="quatrevingtpercent" type="text" name="computed_value" value="<?php echo dol_escape_htmltag($computed); ?>"></td></tr> |
247 | 247 | <!-- Default Value (at sql setup level) --> |
248 | 248 | <tr class="extra_default_value"><td><?php echo $langs->trans("DefaultValue").' ('.$langs->trans("Database").')'; ?></td><td class="valeur"><input id="default_value" type="text" name="default_value" size="5" value="<?php echo dol_escape_htmltag($default); ?>"></td></tr> |
249 | 249 | <!-- Unique --> |
250 | -<tr class="extra_unique"><td><?php echo $langs->trans("Unique"); ?></td><td class="valeur"><input id="unique" type="checkbox" name="unique"<?php echo ($unique?' checked':''); ?>></td></tr> |
|
250 | +<tr class="extra_unique"><td><?php echo $langs->trans("Unique"); ?></td><td class="valeur"><input id="unique" type="checkbox" name="unique"<?php echo ($unique ? ' checked' : ''); ?>></td></tr> |
|
251 | 251 | <!-- Required --> |
252 | -<tr class="extra_required"><td><?php echo $langs->trans("Required"); ?></td><td class="valeur"><input id="required" type="checkbox" name="required"<?php echo ($required?' checked':''); ?>></td></tr> |
|
252 | +<tr class="extra_required"><td><?php echo $langs->trans("Required"); ?></td><td class="valeur"><input id="required" type="checkbox" name="required"<?php echo ($required ? ' checked' : ''); ?>></td></tr> |
|
253 | 253 | <!-- Always editable --> |
254 | -<tr class="extra_alwayseditable"><td><?php echo $langs->trans("AlwaysEditable"); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable"<?php echo ($alwayseditable?' checked':''); ?>></td></tr> |
|
254 | +<tr class="extra_alwayseditable"><td><?php echo $langs->trans("AlwaysEditable"); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable"<?php echo ($alwayseditable ? ' checked' : ''); ?>></td></tr> |
|
255 | 255 | <tr><td class="extra_list"><?php echo $form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?> |
256 | -</td><td class="valeur"><input id="list" class="minwidth100" type="text" name="list" value="<?php echo ($list!=''?$list:'1'); ?>"></td></tr> |
|
257 | -<tr class="extra_totalizable"><td><?php echo $form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")); ?></td><td class="valeur"><input id="totalizable" type="checkbox" name="totalizable"<?php echo ($totalizable?' checked':''); ?>></td></tr> |
|
256 | +</td><td class="valeur"><input id="list" class="minwidth100" type="text" name="list" value="<?php echo ($list != '' ? $list : '1'); ?>"></td></tr> |
|
257 | +<tr class="extra_totalizable"><td><?php echo $form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")); ?></td><td class="valeur"><input id="totalizable" type="checkbox" name="totalizable"<?php echo ($totalizable ? ' checked' : ''); ?>></td></tr> |
|
258 | 258 | <!-- Help tooltip --> |
259 | 259 | <tr class="help"><td><?php echo $form->textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?></td><td class="valeur"><input id="help" class="quatrevingtpercent" type="text" name="help" value="<?php echo dol_escape_htmltag($help); ?>"></td></tr> |
260 | 260 | <?php if ($conf->multicompany->enabled) { ?> |
261 | 261 | <!-- Multicompany entity --> |
262 | - <tr><td><?php echo $langs->trans("AllEntities"); ?></td><td class="valeur"><input id="entitycurrentorall" type="checkbox" name="entitycurrentorall"<?php echo (empty($entitycurrentorall) ?' checked':''); ?>></td></tr> |
|
262 | + <tr><td><?php echo $langs->trans("AllEntities"); ?></td><td class="valeur"><input id="entitycurrentorall" type="checkbox" name="entitycurrentorall"<?php echo (empty($entitycurrentorall) ? ' checked' : ''); ?>></td></tr> |
|
263 | 263 | <?php } ?> |
264 | 264 | <!-- Visibility --> |
265 | 265 | </table> |
@@ -172,8 +172,7 @@ discard block |
||
172 | 172 | $param_chain .= $key.','.$value."\n"; |
173 | 173 | } |
174 | 174 | } |
175 | -} |
|
176 | -elseif (($type== 'sellist') || ($type == 'chkbxlst') || ($type == 'link') || ($type == 'password')) |
|
175 | +} elseif (($type== 'sellist') || ($type == 'chkbxlst') || ($type == 'link') || ($type == 'password')) |
|
177 | 176 | { |
178 | 177 | $paramlist=array_keys($param['options']); |
179 | 178 | $param_chain = $paramlist[0]; |
@@ -204,13 +203,17 @@ discard block |
||
204 | 203 | foreach($type2label as $key => $val) |
205 | 204 | { |
206 | 205 | $selected=''; |
207 | - if ($key == (GETPOST('type','alpha')?GETPOST('type','alpha'):$type)) $selected=' selected="selected"'; |
|
208 | - if (in_array($key, $typewecanchangeinto[$type])) print '<option value="'.$key.'"'.$selected.'>'.$val.'</option>'; |
|
209 | - else print '<option value="'.$key.'" disabled="disabled"'.$selected.'>'.$val.'</option>'; |
|
206 | + if ($key == (GETPOST('type','alpha')?GETPOST('type','alpha'):$type)) { |
|
207 | + $selected=' selected="selected"'; |
|
208 | + } |
|
209 | + if (in_array($key, $typewecanchangeinto[$type])) { |
|
210 | + print '<option value="'.$key.'"'.$selected.'>'.$val.'</option>'; |
|
211 | + } else { |
|
212 | + print '<option value="'.$key.'" disabled="disabled"'.$selected.'>'.$val.'</option>'; |
|
213 | + } |
|
210 | 214 | } |
211 | 215 | print '</select>'; |
212 | -} |
|
213 | -else |
|
216 | +} else |
|
214 | 217 | { |
215 | 218 | print $type2label[$type]; |
216 | 219 | print '<input type="hidden" name="type" id="type" value="'.$type.'">'; |
@@ -27,8 +27,8 @@ discard block |
||
27 | 27 | // Protection to avoid direct call of template |
28 | 28 | if (empty($langs) || ! is_object($langs)) |
29 | 29 | { |
30 | - print "Error, template page can't be called as URL"; |
|
31 | - exit; |
|
30 | + print "Error, template page can't be called as URL"; |
|
31 | + exit; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | |
@@ -51,16 +51,16 @@ discard block |
||
51 | 51 | |
52 | 52 | if ($action == 'delete') |
53 | 53 | { |
54 | - $langs->load("companies"); // Need for string DeleteFile+ConfirmDeleteFiles |
|
55 | - print $form->formconfirm( |
|
56 | - $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int') . (empty($param)?'':$param), |
|
57 | - $langs->trans('DeleteFile'), |
|
58 | - $langs->trans('ConfirmDeleteFile'), |
|
59 | - 'confirm_deletefile', |
|
60 | - '', |
|
61 | - 0, |
|
62 | - 1 |
|
63 | - ); |
|
54 | + $langs->load("companies"); // Need for string DeleteFile+ConfirmDeleteFiles |
|
55 | + print $form->formconfirm( |
|
56 | + $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int') . (empty($param)?'':$param), |
|
57 | + $langs->trans('DeleteFile'), |
|
58 | + $langs->trans('ConfirmDeleteFile'), |
|
59 | + 'confirm_deletefile', |
|
60 | + '', |
|
61 | + 0, |
|
62 | + 1 |
|
63 | + ); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | $formfile=new FormFile($db); |
@@ -69,12 +69,12 @@ discard block |
||
69 | 69 | $savingdocmask=''; |
70 | 70 | if (empty($conf->global->MAIN_DISABLE_SUGGEST_REF_AS_PREFIX)) |
71 | 71 | { |
72 | - //var_dump($modulepart); |
|
73 | - if (in_array($modulepart,array('facture_fournisseur','commande_fournisseur','facture','commande','propal','supplier_proposal','ficheinter','contract','expedition','project','project_task','expensereport','tax', 'produit', 'product_batch'))) |
|
74 | - { |
|
75 | - $savingdocmask=dol_sanitizeFileName($object->ref).'-__file__'; |
|
76 | - } |
|
77 | - /*if (in_array($modulepart,array('member'))) |
|
72 | + //var_dump($modulepart); |
|
73 | + if (in_array($modulepart,array('facture_fournisseur','commande_fournisseur','facture','commande','propal','supplier_proposal','ficheinter','contract','expedition','project','project_task','expensereport','tax', 'produit', 'product_batch'))) |
|
74 | + { |
|
75 | + $savingdocmask=dol_sanitizeFileName($object->ref).'-__file__'; |
|
76 | + } |
|
77 | + /*if (in_array($modulepart,array('member'))) |
|
78 | 78 | { |
79 | 79 | $savingdocmask=$object->login.'___file__'; |
80 | 80 | }*/ |
@@ -89,9 +89,9 @@ discard block |
||
89 | 89 | $permission, |
90 | 90 | $conf->browser->layout == 'phone' ? 40 : 60, |
91 | 91 | $object, |
92 | - '', |
|
93 | - 1, |
|
94 | - $savingdocmask |
|
92 | + '', |
|
93 | + 1, |
|
94 | + $savingdocmask |
|
95 | 95 | ); |
96 | 96 | |
97 | 97 | // List of document |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | // $param = param to add to download links |
26 | 26 | |
27 | 27 | // Protection to avoid direct call of template |
28 | -if (empty($langs) || ! is_object($langs)) |
|
28 | +if (empty($langs) || !is_object($langs)) |
|
29 | 29 | { |
30 | 30 | print "Error, template page can't be called as URL"; |
31 | 31 | exit; |
@@ -33,15 +33,15 @@ discard block |
||
33 | 33 | |
34 | 34 | |
35 | 35 | $langs->load("link"); |
36 | -if (empty($relativepathwithnofile)) $relativepathwithnofile=''; |
|
37 | -if (empty($permtoedit)) $permtoedit=-1; |
|
36 | +if (empty($relativepathwithnofile)) $relativepathwithnofile = ''; |
|
37 | +if (empty($permtoedit)) $permtoedit = -1; |
|
38 | 38 | |
39 | 39 | // Drag and drop for up and down allowed on product, thirdparty, ... |
40 | 40 | // The drag and drop call the page core/ajax/row.php |
41 | 41 | // If you enable the move up/down of files here, check that page that include template set its sortorder on 'position_name' instead of 'name' |
42 | 42 | // Also the object->fk_element must be defined. |
43 | -$disablemove=1; |
|
44 | -if (in_array($modulepart, array('product', 'produit', 'societe', 'user', 'ticket', 'holiday', 'expensereport'))) $disablemove=0; |
|
43 | +$disablemove = 1; |
|
44 | +if (in_array($modulepart, array('product', 'produit', 'societe', 'user', 'ticket', 'holiday', 'expensereport'))) $disablemove = 0; |
|
45 | 45 | |
46 | 46 | |
47 | 47 | |
@@ -51,9 +51,9 @@ discard block |
||
51 | 51 | |
52 | 52 | if ($action == 'delete') |
53 | 53 | { |
54 | - $langs->load("companies"); // Need for string DeleteFile+ConfirmDeleteFiles |
|
54 | + $langs->load("companies"); // Need for string DeleteFile+ConfirmDeleteFiles |
|
55 | 55 | print $form->formconfirm( |
56 | - $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int') . (empty($param)?'':$param), |
|
56 | + $_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode(GETPOST("urlfile")).'&linkid='.GETPOST('linkid', 'int').(empty($param) ? '' : $param), |
|
57 | 57 | $langs->trans('DeleteFile'), |
58 | 58 | $langs->trans('ConfirmDeleteFile'), |
59 | 59 | 'confirm_deletefile', |
@@ -63,16 +63,16 @@ discard block |
||
63 | 63 | ); |
64 | 64 | } |
65 | 65 | |
66 | -$formfile=new FormFile($db); |
|
66 | +$formfile = new FormFile($db); |
|
67 | 67 | |
68 | 68 | // We define var to enable the feature to add prefix of uploaded files |
69 | -$savingdocmask=''; |
|
69 | +$savingdocmask = ''; |
|
70 | 70 | if (empty($conf->global->MAIN_DISABLE_SUGGEST_REF_AS_PREFIX)) |
71 | 71 | { |
72 | 72 | //var_dump($modulepart); |
73 | - if (in_array($modulepart,array('facture_fournisseur','commande_fournisseur','facture','commande','propal','supplier_proposal','ficheinter','contract','expedition','project','project_task','expensereport','tax', 'produit', 'product_batch'))) |
|
73 | + if (in_array($modulepart, array('facture_fournisseur', 'commande_fournisseur', 'facture', 'commande', 'propal', 'supplier_proposal', 'ficheinter', 'contract', 'expedition', 'project', 'project_task', 'expensereport', 'tax', 'produit', 'product_batch'))) |
|
74 | 74 | { |
75 | - $savingdocmask=dol_sanitizeFileName($object->ref).'-__file__'; |
|
75 | + $savingdocmask = dol_sanitizeFileName($object->ref).'-__file__'; |
|
76 | 76 | } |
77 | 77 | /*if (in_array($modulepart,array('member'))) |
78 | 78 | { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | // Show upload form (document and links) |
84 | 84 | $formfile->form_attach_new_file( |
85 | - $_SERVER["PHP_SELF"].'?id='.$object->id.(empty($withproject)?'':'&withproject=1'), |
|
85 | + $_SERVER["PHP_SELF"].'?id='.$object->id.(empty($withproject) ? '' : '&withproject=1'), |
|
86 | 86 | '', |
87 | 87 | 0, |
88 | 88 | 0, |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $modulepart, |
102 | 102 | $param, |
103 | 103 | 0, |
104 | - $relativepathwithnofile, // relative path with no file. For example "0/1" |
|
104 | + $relativepathwithnofile, // relative path with no file. For example "0/1" |
|
105 | 105 | $permission, |
106 | 106 | 0, |
107 | 107 | '', |
@@ -33,15 +33,21 @@ |
||
33 | 33 | |
34 | 34 | |
35 | 35 | $langs->load("link"); |
36 | -if (empty($relativepathwithnofile)) $relativepathwithnofile=''; |
|
37 | -if (empty($permtoedit)) $permtoedit=-1; |
|
36 | +if (empty($relativepathwithnofile)) { |
|
37 | + $relativepathwithnofile=''; |
|
38 | +} |
|
39 | +if (empty($permtoedit)) { |
|
40 | + $permtoedit=-1; |
|
41 | +} |
|
38 | 42 | |
39 | 43 | // Drag and drop for up and down allowed on product, thirdparty, ... |
40 | 44 | // The drag and drop call the page core/ajax/row.php |
41 | 45 | // If you enable the move up/down of files here, check that page that include template set its sortorder on 'position_name' instead of 'name' |
42 | 46 | // Also the object->fk_element must be defined. |
43 | 47 | $disablemove=1; |
44 | -if (in_array($modulepart, array('product', 'produit', 'societe', 'user', 'ticket', 'holiday', 'expensereport'))) $disablemove=0; |
|
48 | +if (in_array($modulepart, array('product', 'produit', 'societe', 'user', 'ticket', 'holiday', 'expensereport'))) { |
|
49 | + $disablemove=0; |
|
50 | +} |
|
45 | 51 | |
46 | 52 | |
47 | 53 |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | // Protection to avoid direct call of template |
36 | 36 | if (empty($object) || ! is_object($object)) |
37 | 37 | { |
38 | - print "Error, template page can't be called as URL"; |
|
39 | - exit; |
|
38 | + print "Error, template page can't be called as URL"; |
|
39 | + exit; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | |
@@ -65,30 +65,30 @@ discard block |
||
65 | 65 | $objectline = null; |
66 | 66 | if (!empty($extrafieldsline)) |
67 | 67 | { |
68 | - if ($this->table_element_line=='commandedet') { |
|
69 | - $objectline = new OrderLine($this->db); |
|
70 | - } |
|
71 | - elseif ($this->table_element_line=='propaldet') { |
|
72 | - $objectline = new PropaleLigne($this->db); |
|
73 | - } |
|
74 | - elseif ($this->table_element_line=='supplier_proposaldet') { |
|
75 | - $objectline = new SupplierProposalLine($this->db); |
|
76 | - } |
|
77 | - elseif ($this->table_element_line=='facturedet') { |
|
78 | - $objectline = new FactureLigne($this->db); |
|
79 | - } |
|
80 | - elseif ($this->table_element_line=='contratdet') { |
|
81 | - $objectline = new ContratLigne($this->db); |
|
82 | - } |
|
83 | - elseif ($this->table_element_line=='commande_fournisseurdet') { |
|
84 | - $objectline = new CommandeFournisseurLigne($this->db); |
|
85 | - } |
|
86 | - elseif ($this->table_element_line=='facture_fourn_det') { |
|
87 | - $objectline = new SupplierInvoiceLine($this->db); |
|
88 | - } |
|
89 | - elseif ($this->table_element_line=='facturedet_rec') { |
|
90 | - $objectline = new FactureLigneRec($this->db); |
|
91 | - } |
|
68 | + if ($this->table_element_line=='commandedet') { |
|
69 | + $objectline = new OrderLine($this->db); |
|
70 | + } |
|
71 | + elseif ($this->table_element_line=='propaldet') { |
|
72 | + $objectline = new PropaleLigne($this->db); |
|
73 | + } |
|
74 | + elseif ($this->table_element_line=='supplier_proposaldet') { |
|
75 | + $objectline = new SupplierProposalLine($this->db); |
|
76 | + } |
|
77 | + elseif ($this->table_element_line=='facturedet') { |
|
78 | + $objectline = new FactureLigne($this->db); |
|
79 | + } |
|
80 | + elseif ($this->table_element_line=='contratdet') { |
|
81 | + $objectline = new ContratLigne($this->db); |
|
82 | + } |
|
83 | + elseif ($this->table_element_line=='commande_fournisseurdet') { |
|
84 | + $objectline = new CommandeFournisseurLigne($this->db); |
|
85 | + } |
|
86 | + elseif ($this->table_element_line=='facture_fourn_det') { |
|
87 | + $objectline = new SupplierInvoiceLine($this->db); |
|
88 | + } |
|
89 | + elseif ($this->table_element_line=='facturedet_rec') { |
|
90 | + $objectline = new FactureLigneRec($this->db); |
|
91 | + } |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | ?> |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | <div id="add"></div><span class="hideonsmartphone"><?php echo $langs->trans('AddNewLine'); ?></span><?php // echo $langs->trans("FreeZone"); ?> |
107 | 107 | </td> |
108 | 108 | <?php |
109 | - if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines |
|
110 | - { |
|
111 | - ?> |
|
109 | + if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines |
|
110 | + { |
|
111 | + ?> |
|
112 | 112 | <td class="linecolrefsupplier"><span id="title_fourn_ref"><?php echo $langs->trans('SupplierRef'); ?></span></td> |
113 | 113 | <?php } ?> |
114 | 114 | <td class="linecolvat" align="right"><span id="title_vat"><?php echo $langs->trans('VAT'); ?></span></td> |
@@ -121,39 +121,39 @@ discard block |
||
121 | 121 | <?php } ?> |
122 | 122 | <td class="linecolqty" align="right"><?php echo $langs->trans('Qty'); ?></td> |
123 | 123 | <?php |
124 | - if($conf->global->PRODUCT_USE_UNITS) |
|
125 | - { |
|
126 | - print '<td class="linecoluseunit" align="left">'; |
|
127 | - print '<span id="title_units">'; |
|
128 | - print $langs->trans('Unit'); |
|
129 | - print '</span></td>'; |
|
130 | - } |
|
131 | - ?> |
|
124 | + if($conf->global->PRODUCT_USE_UNITS) |
|
125 | + { |
|
126 | + print '<td class="linecoluseunit" align="left">'; |
|
127 | + print '<span id="title_units">'; |
|
128 | + print $langs->trans('Unit'); |
|
129 | + print '</span></td>'; |
|
130 | + } |
|
131 | + ?> |
|
132 | 132 | <td class="linecoldiscount" align="right"><?php echo $langs->trans('ReductionShort'); ?></td> |
133 | 133 | <?php |
134 | - if ($this->situation_cycle_ref) { |
|
135 | - print '<td class="linecolcycleref" align="right">' . $langs->trans('Progress') . '</td>'; |
|
136 | - } |
|
137 | - if (! empty($usemargins)) |
|
138 | - { |
|
139 | - if (!empty($user->rights->margins->creer)) { |
|
140 | - ?> |
|
134 | + if ($this->situation_cycle_ref) { |
|
135 | + print '<td class="linecolcycleref" align="right">' . $langs->trans('Progress') . '</td>'; |
|
136 | + } |
|
137 | + if (! empty($usemargins)) |
|
138 | + { |
|
139 | + if (!empty($user->rights->margins->creer)) { |
|
140 | + ?> |
|
141 | 141 | <td align="right" class="margininfos linecolmargin1"> |
142 | 142 | <?php |
143 | - } |
|
144 | - else $colspan++; |
|
143 | + } |
|
144 | + else $colspan++; |
|
145 | 145 | |
146 | - if ($conf->global->MARGIN_TYPE == "1") |
|
147 | - echo $langs->trans('BuyingPrice'); |
|
148 | - else |
|
149 | - echo $langs->trans('CostPrice'); |
|
150 | - ?> |
|
146 | + if ($conf->global->MARGIN_TYPE == "1") |
|
147 | + echo $langs->trans('BuyingPrice'); |
|
148 | + else |
|
149 | + echo $langs->trans('CostPrice'); |
|
150 | + ?> |
|
151 | 151 | </td> |
152 | 152 | <?php |
153 | - if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARGIN_RATES)) echo '<td align="right" class="margininfos linecolmargin2"><span class="np_marginRate">'.$langs->trans('MarginRate').'</span></td>'; |
|
154 | - if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARK_RATES)) echo '<td align="right" class="margininfos linecolmargin2"><span class="np_markRate">'.$langs->trans('MarkRate').'</span></td>'; |
|
155 | - } |
|
156 | - ?> |
|
153 | + if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARGIN_RATES)) echo '<td align="right" class="margininfos linecolmargin2"><span class="np_marginRate">'.$langs->trans('MarginRate').'</span></td>'; |
|
154 | + if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARK_RATES)) echo '<td align="right" class="margininfos linecolmargin2"><span class="np_markRate">'.$langs->trans('MarkRate').'</span></td>'; |
|
155 | + } |
|
156 | + ?> |
|
157 | 157 | <td class="linecoledit" colspan="<?php echo $colspan; ?>"> </td> |
158 | 158 | </tr> |
159 | 159 | <?php |
@@ -163,13 +163,13 @@ discard block |
||
163 | 163 | <?php |
164 | 164 | // Adds a line numbering column |
165 | 165 | if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { |
166 | - $coldisplay=2; |
|
167 | - ?> |
|
166 | + $coldisplay=2; |
|
167 | + ?> |
|
168 | 168 | <td class="nobottom linecolnum" align="center" width="5"></td> |
169 | 169 | <?php |
170 | 170 | } |
171 | 171 | else { |
172 | - $coldisplay=0; |
|
172 | + $coldisplay=0; |
|
173 | 173 | } |
174 | 174 | ?> |
175 | 175 | |
@@ -177,172 +177,172 @@ discard block |
||
177 | 177 | |
178 | 178 | <?php |
179 | 179 | |
180 | - $freelines = false; |
|
181 | - if (empty($conf->global->MAIN_DISABLE_FREE_LINES)) |
|
182 | - { |
|
183 | - $freelines = true; |
|
184 | - $forceall=1; // We always force all type for free lines (module product or service means we use predefined product or service) |
|
185 | - if ($object->element == 'contrat') |
|
186 | - { |
|
187 | - if (empty($conf->product->enabled) && empty($conf->service->enabled) && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $forceall=-1; // With contract, by default, no choice at all, except if CONTRACT_SUPPORT_PRODUCTS is set |
|
188 | - else if (empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $forceall=3; |
|
189 | - } |
|
180 | + $freelines = false; |
|
181 | + if (empty($conf->global->MAIN_DISABLE_FREE_LINES)) |
|
182 | + { |
|
183 | + $freelines = true; |
|
184 | + $forceall=1; // We always force all type for free lines (module product or service means we use predefined product or service) |
|
185 | + if ($object->element == 'contrat') |
|
186 | + { |
|
187 | + if (empty($conf->product->enabled) && empty($conf->service->enabled) && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $forceall=-1; // With contract, by default, no choice at all, except if CONTRACT_SUPPORT_PRODUCTS is set |
|
188 | + else if (empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $forceall=3; |
|
189 | + } |
|
190 | 190 | |
191 | - // Free line |
|
192 | - echo '<span class="prod_entry_mode_free">'; |
|
193 | - // Show radio free line |
|
194 | - if ($forceall >= 0 && (! empty($conf->product->enabled) || ! empty($conf->service->enabled))) |
|
195 | - { |
|
196 | - echo '<label for="prod_entry_mode_free">'; |
|
197 | - echo '<input type="radio" class="prod_entry_mode_free" name="prod_entry_mode" id="prod_entry_mode_free" value="free"'; |
|
198 | - //echo (GETPOST('prod_entry_mode')=='free' ? ' checked' : ((empty($forceall) && (empty($conf->product->enabled) || empty($conf->service->enabled)))?' checked':'') ); |
|
199 | - echo (GETPOST('prod_entry_mode')=='free' ? ' checked' : ''); |
|
200 | - echo '> '; |
|
201 | - // Show type selector |
|
202 | - echo $langs->trans("FreeLineOfType"); |
|
203 | - echo '</label>'; |
|
204 | - echo ' '; |
|
205 | - } |
|
206 | - else |
|
207 | - { |
|
208 | - echo '<input type="hidden" id="prod_entry_mode_free" name="prod_entry_mode" value="free">'; |
|
209 | - // Show type selector |
|
210 | - if ($forceall >= 0) |
|
211 | - { |
|
212 | - if (empty($conf->product->enabled) || empty($conf->service->enabled)) echo $langs->trans("Type"); |
|
213 | - else echo $langs->trans("FreeLineOfType"); |
|
214 | - echo ' '; |
|
215 | - } |
|
216 | - } |
|
191 | + // Free line |
|
192 | + echo '<span class="prod_entry_mode_free">'; |
|
193 | + // Show radio free line |
|
194 | + if ($forceall >= 0 && (! empty($conf->product->enabled) || ! empty($conf->service->enabled))) |
|
195 | + { |
|
196 | + echo '<label for="prod_entry_mode_free">'; |
|
197 | + echo '<input type="radio" class="prod_entry_mode_free" name="prod_entry_mode" id="prod_entry_mode_free" value="free"'; |
|
198 | + //echo (GETPOST('prod_entry_mode')=='free' ? ' checked' : ((empty($forceall) && (empty($conf->product->enabled) || empty($conf->service->enabled)))?' checked':'') ); |
|
199 | + echo (GETPOST('prod_entry_mode')=='free' ? ' checked' : ''); |
|
200 | + echo '> '; |
|
201 | + // Show type selector |
|
202 | + echo $langs->trans("FreeLineOfType"); |
|
203 | + echo '</label>'; |
|
204 | + echo ' '; |
|
205 | + } |
|
206 | + else |
|
207 | + { |
|
208 | + echo '<input type="hidden" id="prod_entry_mode_free" name="prod_entry_mode" value="free">'; |
|
209 | + // Show type selector |
|
210 | + if ($forceall >= 0) |
|
211 | + { |
|
212 | + if (empty($conf->product->enabled) || empty($conf->service->enabled)) echo $langs->trans("Type"); |
|
213 | + else echo $langs->trans("FreeLineOfType"); |
|
214 | + echo ' '; |
|
215 | + } |
|
216 | + } |
|
217 | 217 | |
218 | - echo $form->select_type_of_lines(isset($_POST["type"])?GETPOST("type",'alpha',2):-1,'type',1,1,$forceall); |
|
218 | + echo $form->select_type_of_lines(isset($_POST["type"])?GETPOST("type",'alpha',2):-1,'type',1,1,$forceall); |
|
219 | 219 | |
220 | - echo '</span>'; |
|
221 | - } |
|
220 | + echo '</span>'; |
|
221 | + } |
|
222 | 222 | |
223 | - // Predefined product/service |
|
224 | - if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) |
|
225 | - { |
|
226 | - if ($forceall >= 0 && $freelines) echo '<br>'; |
|
227 | - echo '<span class="prod_entry_mode_predef">'; |
|
228 | - echo '<label for="prod_entry_mode_predef">'; |
|
229 | - echo '<input type="radio" class="prod_entry_mode_predef" name="prod_entry_mode" id="prod_entry_mode_predef" value="predef"'.(GETPOST('prod_entry_mode')=='predef'?' checked':'').'> '; |
|
230 | - if (empty($senderissupplier)) |
|
231 | - { |
|
232 | - if (! empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToSell'); |
|
233 | - else if ((empty($conf->product->enabled) && ! empty($conf->service->enabled)) || ($object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))) echo $langs->trans('PredefinedServicesToSell'); |
|
234 | - else echo $langs->trans('PredefinedProductsAndServicesToSell'); |
|
235 | - } |
|
236 | - else |
|
237 | - { |
|
238 | - if (! empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToPurchase'); |
|
239 | - else if (empty($conf->product->enabled) && ! empty($conf->service->enabled)) echo $langs->trans('PredefinedServicesToPurchase'); |
|
240 | - else echo $langs->trans('PredefinedProductsAndServicesToPurchase'); |
|
241 | - } |
|
242 | - echo '</label>'; |
|
243 | - echo ' '; |
|
223 | + // Predefined product/service |
|
224 | + if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) |
|
225 | + { |
|
226 | + if ($forceall >= 0 && $freelines) echo '<br>'; |
|
227 | + echo '<span class="prod_entry_mode_predef">'; |
|
228 | + echo '<label for="prod_entry_mode_predef">'; |
|
229 | + echo '<input type="radio" class="prod_entry_mode_predef" name="prod_entry_mode" id="prod_entry_mode_predef" value="predef"'.(GETPOST('prod_entry_mode')=='predef'?' checked':'').'> '; |
|
230 | + if (empty($senderissupplier)) |
|
231 | + { |
|
232 | + if (! empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToSell'); |
|
233 | + else if ((empty($conf->product->enabled) && ! empty($conf->service->enabled)) || ($object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))) echo $langs->trans('PredefinedServicesToSell'); |
|
234 | + else echo $langs->trans('PredefinedProductsAndServicesToSell'); |
|
235 | + } |
|
236 | + else |
|
237 | + { |
|
238 | + if (! empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToPurchase'); |
|
239 | + else if (empty($conf->product->enabled) && ! empty($conf->service->enabled)) echo $langs->trans('PredefinedServicesToPurchase'); |
|
240 | + else echo $langs->trans('PredefinedProductsAndServicesToPurchase'); |
|
241 | + } |
|
242 | + echo '</label>'; |
|
243 | + echo ' '; |
|
244 | 244 | |
245 | - $filtertype=''; |
|
246 | - if (! empty($object->element) && $object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $filtertype='1'; |
|
245 | + $filtertype=''; |
|
246 | + if (! empty($object->element) && $object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $filtertype='1'; |
|
247 | 247 | |
248 | - if (empty($senderissupplier)) |
|
249 | - { |
|
250 | - if (! empty($conf->global->ENTREPOT_EXTRA_STATUS)) |
|
251 | - { |
|
252 | - // hide products in closed warehouse, but show products for internal transfer |
|
253 | - $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth300', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array')); |
|
254 | - } |
|
255 | - else |
|
256 | - { |
|
257 | - $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth300', 0, '', GETPOST('combinations', 'array')); |
|
258 | - } |
|
259 | - } |
|
260 | - else |
|
261 | - { |
|
262 | - // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum |
|
263 | - if ($senderissupplier != 2) |
|
264 | - { |
|
265 | - $ajaxoptions=array( |
|
266 | - 'update' => array('qty'=>'qty','remise_percent' => 'discount','idprod' => 'idprod'), // html id tags that will be edited with which ajax json response key |
|
267 | - 'option_disabled' => 'idthatdoesnotexists', // html id to disable once select is done |
|
268 | - 'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'warning' (for exemple shown we select a disabled option into combo) |
|
269 | - ); |
|
270 | - $alsoproductwithnosupplierprice=0; |
|
271 | - } |
|
272 | - else |
|
273 | - { |
|
274 | - $ajaxoptions = array(); |
|
275 | - $alsoproductwithnosupplierprice=1; |
|
276 | - } |
|
277 | - |
|
278 | - $form->select_produits_fournisseurs($object->socid, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1, $alsoproductwithnosupplierprice); |
|
279 | - } |
|
280 | - echo '<input type="hidden" name="pbq" id="pbq" value="">'; |
|
281 | - echo '</span>'; |
|
282 | - } |
|
248 | + if (empty($senderissupplier)) |
|
249 | + { |
|
250 | + if (! empty($conf->global->ENTREPOT_EXTRA_STATUS)) |
|
251 | + { |
|
252 | + // hide products in closed warehouse, but show products for internal transfer |
|
253 | + $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth300', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array')); |
|
254 | + } |
|
255 | + else |
|
256 | + { |
|
257 | + $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth300', 0, '', GETPOST('combinations', 'array')); |
|
258 | + } |
|
259 | + } |
|
260 | + else |
|
261 | + { |
|
262 | + // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum |
|
263 | + if ($senderissupplier != 2) |
|
264 | + { |
|
265 | + $ajaxoptions=array( |
|
266 | + 'update' => array('qty'=>'qty','remise_percent' => 'discount','idprod' => 'idprod'), // html id tags that will be edited with which ajax json response key |
|
267 | + 'option_disabled' => 'idthatdoesnotexists', // html id to disable once select is done |
|
268 | + 'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'warning' (for exemple shown we select a disabled option into combo) |
|
269 | + ); |
|
270 | + $alsoproductwithnosupplierprice=0; |
|
271 | + } |
|
272 | + else |
|
273 | + { |
|
274 | + $ajaxoptions = array(); |
|
275 | + $alsoproductwithnosupplierprice=1; |
|
276 | + } |
|
283 | 277 | |
284 | - if (is_object($hookmanager) && empty($senderissupplier)) |
|
285 | - { |
|
286 | - $parameters=array('fk_parent_line'=>GETPOST('fk_parent_line','int')); |
|
287 | - $reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action); |
|
288 | - if (!empty($hookmanager->resPrint)) { |
|
289 | - print $hookmanager->resPrint; |
|
290 | - } |
|
291 | - } |
|
292 | - if (is_object($hookmanager) && ! empty($senderissupplier)) |
|
293 | - { |
|
294 | - $parameters=array('htmlname'=>'addproduct'); |
|
295 | - $reshook=$hookmanager->executeHooks('formCreateProductSupplierOptions',$parameters,$object,$action); |
|
296 | - if (!empty($hookmanager->resPrint)) { |
|
297 | - print $hookmanager->resPrint; |
|
298 | - } |
|
299 | - } |
|
278 | + $form->select_produits_fournisseurs($object->socid, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1, $alsoproductwithnosupplierprice); |
|
279 | + } |
|
280 | + echo '<input type="hidden" name="pbq" id="pbq" value="">'; |
|
281 | + echo '</span>'; |
|
282 | + } |
|
300 | 283 | |
284 | + if (is_object($hookmanager) && empty($senderissupplier)) |
|
285 | + { |
|
286 | + $parameters=array('fk_parent_line'=>GETPOST('fk_parent_line','int')); |
|
287 | + $reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action); |
|
288 | + if (!empty($hookmanager->resPrint)) { |
|
289 | + print $hookmanager->resPrint; |
|
290 | + } |
|
291 | + } |
|
292 | + if (is_object($hookmanager) && ! empty($senderissupplier)) |
|
293 | + { |
|
294 | + $parameters=array('htmlname'=>'addproduct'); |
|
295 | + $reshook=$hookmanager->executeHooks('formCreateProductSupplierOptions',$parameters,$object,$action); |
|
296 | + if (!empty($hookmanager->resPrint)) { |
|
297 | + print $hookmanager->resPrint; |
|
298 | + } |
|
299 | + } |
|
301 | 300 | |
302 | - if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { |
|
303 | 301 | |
304 | - if (!empty($conf->variants->enabled)) { |
|
305 | - echo '<div id="attributes_box"></div>'; |
|
306 | - } |
|
302 | + if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { |
|
307 | 303 | |
308 | - echo '<br>'; |
|
309 | - } |
|
304 | + if (!empty($conf->variants->enabled)) { |
|
305 | + echo '<div id="attributes_box"></div>'; |
|
306 | + } |
|
310 | 307 | |
311 | - // Editor wysiwyg |
|
312 | - require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
313 | - $nbrows=ROWS_2; |
|
314 | - $enabled=(! empty($conf->global->FCKEDITOR_ENABLE_DETAILS)?$conf->global->FCKEDITOR_ENABLE_DETAILS:0); |
|
315 | - if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; |
|
316 | - $toolbarname='dolibarr_details'; |
|
317 | - if (! empty($conf->global->FCKEDITOR_ENABLE_DETAILS_FULL)) $toolbarname='dolibarr_notes'; |
|
318 | - $doleditor=new DolEditor('dp_desc',GETPOST('dp_desc'),'',100,$toolbarname,'',false,true,$enabled,$nbrows,'98%'); |
|
319 | - $doleditor->Create(); |
|
320 | - |
|
321 | - // Show autofill date for recuring invoices |
|
322 | - if (! empty($conf->service->enabled) && $object->element == 'facturerec') |
|
323 | - { |
|
324 | - echo '<div class="divlinefordates"><br>'; |
|
325 | - echo $langs->trans('AutoFillDateFrom').' '; |
|
326 | - echo $form->selectyesno('date_start_fill', $line->date_start_fill, 1); |
|
327 | - echo ' - '; |
|
328 | - echo $langs->trans('AutoFillDateTo').' '; |
|
329 | - echo $form->selectyesno('date_end_fill', $line->date_end_fill, 1); |
|
330 | - echo '</div>'; |
|
331 | - } |
|
332 | - ?> |
|
308 | + echo '<br>'; |
|
309 | + } |
|
310 | + |
|
311 | + // Editor wysiwyg |
|
312 | + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
313 | + $nbrows=ROWS_2; |
|
314 | + $enabled=(! empty($conf->global->FCKEDITOR_ENABLE_DETAILS)?$conf->global->FCKEDITOR_ENABLE_DETAILS:0); |
|
315 | + if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; |
|
316 | + $toolbarname='dolibarr_details'; |
|
317 | + if (! empty($conf->global->FCKEDITOR_ENABLE_DETAILS_FULL)) $toolbarname='dolibarr_notes'; |
|
318 | + $doleditor=new DolEditor('dp_desc',GETPOST('dp_desc'),'',100,$toolbarname,'',false,true,$enabled,$nbrows,'98%'); |
|
319 | + $doleditor->Create(); |
|
320 | + |
|
321 | + // Show autofill date for recuring invoices |
|
322 | + if (! empty($conf->service->enabled) && $object->element == 'facturerec') |
|
323 | + { |
|
324 | + echo '<div class="divlinefordates"><br>'; |
|
325 | + echo $langs->trans('AutoFillDateFrom').' '; |
|
326 | + echo $form->selectyesno('date_start_fill', $line->date_start_fill, 1); |
|
327 | + echo ' - '; |
|
328 | + echo $langs->trans('AutoFillDateTo').' '; |
|
329 | + echo $form->selectyesno('date_end_fill', $line->date_end_fill, 1); |
|
330 | + echo '</div>'; |
|
331 | + } |
|
332 | + ?> |
|
333 | 333 | </td> |
334 | 334 | |
335 | 335 | <?php |
336 | - if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines |
|
337 | - { |
|
338 | - ?> |
|
336 | + if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines |
|
337 | + { |
|
338 | + ?> |
|
339 | 339 | <td class="nobottom linecolresupplier"><input id="fourn_ref" name="fourn_ref" class="flat maxwidth75" value="<?php echo (isset($_POST["fourn_ref"])?GETPOST("fourn_ref",'alpha',2):''); ?>"></td> |
340 | 340 | <?php } ?> |
341 | 341 | |
342 | 342 | <td class="nobottom linecolvat" align="right"><?php |
343 | - if ($seller->tva_assuj == "0") echo '<input type="hidden" name="tva_tx" id="tva_tx" value="0">'.vatrate(0, true); |
|
344 | - else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?GETPOST("tva_tx",'alpha',2):-1), $seller, $buyer, 0, 0, '', false, 1); |
|
345 | - ?> |
|
343 | + if ($seller->tva_assuj == "0") echo '<input type="hidden" name="tva_tx" id="tva_tx" value="0">'.vatrate(0, true); |
|
344 | + else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?GETPOST("tva_tx",'alpha',2):-1), $seller, $buyer, 0, 0, '', false, 1); |
|
345 | + ?> |
|
346 | 346 | </td> |
347 | 347 | <td class="nobottom linecoluht" align="right"> |
348 | 348 | <input type="text" size="5" name="price_ht" id="price_ht" class="flat right" value="<?php echo (isset($_POST["price_ht"])?GETPOST("price_ht",'alpha',2):''); ?>"> |
@@ -362,27 +362,27 @@ discard block |
||
362 | 362 | <td class="nobottom linecolqty" align="right"><input type="text" size="2" name="qty" id="qty" class="flat right" value="<?php echo (isset($_POST["qty"])?GETPOST("qty",'alpha',2):1); ?>"> |
363 | 363 | </td> |
364 | 364 | <?php |
365 | - if($conf->global->PRODUCT_USE_UNITS) |
|
366 | - { |
|
367 | - print '<td class="nobottom linecoluseunit" align="left">'; |
|
368 | - print $form->selectUnits($line->fk_unit, "units"); |
|
369 | - print '</td>'; |
|
370 | - } |
|
371 | - $remise_percent = $buyer->remise_percent; |
|
372 | - if($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') { |
|
373 | - $remise_percent = $seller->remise_supplier_percent; |
|
374 | - } |
|
375 | - ?> |
|
365 | + if($conf->global->PRODUCT_USE_UNITS) |
|
366 | + { |
|
367 | + print '<td class="nobottom linecoluseunit" align="left">'; |
|
368 | + print $form->selectUnits($line->fk_unit, "units"); |
|
369 | + print '</td>'; |
|
370 | + } |
|
371 | + $remise_percent = $buyer->remise_percent; |
|
372 | + if($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') { |
|
373 | + $remise_percent = $seller->remise_supplier_percent; |
|
374 | + } |
|
375 | + ?> |
|
376 | 376 | <td class="nobottom nowrap linecoldiscount" align="right"><input type="text" size="1" name="remise_percent" id="remise_percent" class="flat right" value="<?php echo (isset($_POST["remise_percent"])?GETPOST("remise_percent",'alpha',2):$remise_percent); ?>"><span class="hideonsmartphone">%</span></td> |
377 | 377 | <?php |
378 | - if ($this->situation_cycle_ref) { |
|
379 | - $coldisplay++; |
|
380 | - print '<td class="nobottom nowrap" align="right"><input class="falt right" type="text" size="1" value="0" name="progress">%</td>'; |
|
381 | - } |
|
382 | - if (! empty($usemargins)) |
|
383 | - { |
|
384 | - if (!empty($user->rights->margins->creer)) { |
|
385 | - ?> |
|
378 | + if ($this->situation_cycle_ref) { |
|
379 | + $coldisplay++; |
|
380 | + print '<td class="nobottom nowrap" align="right"><input class="falt right" type="text" size="1" value="0" name="progress">%</td>'; |
|
381 | + } |
|
382 | + if (! empty($usemargins)) |
|
383 | + { |
|
384 | + if (!empty($user->rights->margins->creer)) { |
|
385 | + ?> |
|
386 | 386 | <td align="right" class="nobottom margininfos linecolmargin"> |
387 | 387 | <!-- For predef product --> |
388 | 388 | <?php if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { ?> |
@@ -392,29 +392,29 @@ discard block |
||
392 | 392 | <input type="text" size="5" id="buying_price" name="buying_price" class="flat right" value="<?php echo (isset($_POST["buying_price"])?GETPOST("buying_price",'alpha',2):''); ?>"> |
393 | 393 | </td> |
394 | 394 | <?php |
395 | - $coldisplay++; |
|
396 | - } |
|
395 | + $coldisplay++; |
|
396 | + } |
|
397 | 397 | |
398 | - if ($user->rights->margins->creer) |
|
399 | - { |
|
400 | - if (! empty($conf->global->DISPLAY_MARGIN_RATES)) |
|
401 | - { |
|
402 | - echo '<td align="right" class="nobottom nowrap margininfos"><input class="flat right" type="text" size="2" id="np_marginRate" name="np_marginRate" value="'.(isset($_POST["np_marginRate"])?GETPOST("np_marginRate",'alpha',2):'').'"><span class="np_marginRate hideonsmartphone">%</span></td>'; |
|
403 | - $coldisplay++; |
|
404 | - } |
|
405 | - if (! empty($conf->global->DISPLAY_MARK_RATES)) |
|
406 | - { |
|
407 | - echo '<td align="right" class="nobottom nowrap margininfos"><input class="flat right" type="text" size="2" id="np_markRate" name="np_markRate" value="'.(isset($_POST["np_markRate"])?GETPOST("np_markRate",'alpha',2):'').'"><span class="np_markRate hideonsmartphone">%</span></td>'; |
|
408 | - $coldisplay++; |
|
409 | - } |
|
410 | - } |
|
411 | - else |
|
412 | - { |
|
413 | - if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $coldisplay++; |
|
414 | - if (! empty($conf->global->DISPLAY_MARK_RATES)) $coldisplay++; |
|
415 | - } |
|
416 | - } |
|
417 | - ?> |
|
398 | + if ($user->rights->margins->creer) |
|
399 | + { |
|
400 | + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) |
|
401 | + { |
|
402 | + echo '<td align="right" class="nobottom nowrap margininfos"><input class="flat right" type="text" size="2" id="np_marginRate" name="np_marginRate" value="'.(isset($_POST["np_marginRate"])?GETPOST("np_marginRate",'alpha',2):'').'"><span class="np_marginRate hideonsmartphone">%</span></td>'; |
|
403 | + $coldisplay++; |
|
404 | + } |
|
405 | + if (! empty($conf->global->DISPLAY_MARK_RATES)) |
|
406 | + { |
|
407 | + echo '<td align="right" class="nobottom nowrap margininfos"><input class="flat right" type="text" size="2" id="np_markRate" name="np_markRate" value="'.(isset($_POST["np_markRate"])?GETPOST("np_markRate",'alpha',2):'').'"><span class="np_markRate hideonsmartphone">%</span></td>'; |
|
408 | + $coldisplay++; |
|
409 | + } |
|
410 | + } |
|
411 | + else |
|
412 | + { |
|
413 | + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $coldisplay++; |
|
414 | + if (! empty($conf->global->DISPLAY_MARK_RATES)) $coldisplay++; |
|
415 | + } |
|
416 | + } |
|
417 | + ?> |
|
418 | 418 | <td class="nobottom linecoledit" align="center" valign="middle" colspan="<?php echo $colspan; ?>"> |
419 | 419 | <input type="submit" class="button" value="<?php echo $langs->trans('Add'); ?>" name="addline" id="addline"> |
420 | 420 | </td> |
@@ -422,98 +422,98 @@ discard block |
||
422 | 422 | |
423 | 423 | <?php |
424 | 424 | if (is_object($objectline)) { |
425 | - print $objectline->showOptionals($extrafieldsline, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay+8), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); |
|
425 | + print $objectline->showOptionals($extrafieldsline, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay+8), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); |
|
426 | 426 | } |
427 | 427 | ?> |
428 | 428 | |
429 | 429 | <?php |
430 | 430 | if ((! empty($conf->service->enabled) || ($object->element == 'contrat')) && $dateSelector && GETPOST('type') != '0') // We show date field if required |
431 | 431 | { |
432 | - $colspan = 6; |
|
433 | - |
|
434 | - if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines |
|
435 | - { |
|
436 | - $colspan++; |
|
437 | - } |
|
438 | - if ($this->situation_cycle_ref) { |
|
439 | - $colspan++; |
|
440 | - } |
|
441 | - // We add 1 if col total ttc |
|
442 | - if (!empty($inputalsopricewithtax)) { |
|
443 | - $colspan++; |
|
444 | - } |
|
445 | - if ($conf->global->PRODUCT_USE_UNITS) { |
|
446 | - $colspan++; |
|
447 | - } |
|
448 | - if (count($object->lines)) { |
|
449 | - //There will be an edit and a delete button |
|
450 | - $colspan += 2; |
|
451 | - |
|
452 | - // With this, there is a column move button ONLY if lines > 1 |
|
453 | - if (in_array($object->element, array( |
|
454 | - 'propal', |
|
455 | - 'supplier_proposal', |
|
456 | - 'facture', |
|
457 | - 'facturerec', |
|
458 | - 'invoice', |
|
459 | - 'commande', |
|
460 | - 'order', |
|
461 | - 'order_supplier', |
|
462 | - 'invoice_supplier' |
|
463 | - ))) { |
|
464 | - $colspan++; |
|
465 | - } |
|
466 | - } |
|
432 | + $colspan = 6; |
|
433 | + |
|
434 | + if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines |
|
435 | + { |
|
436 | + $colspan++; |
|
437 | + } |
|
438 | + if ($this->situation_cycle_ref) { |
|
439 | + $colspan++; |
|
440 | + } |
|
441 | + // We add 1 if col total ttc |
|
442 | + if (!empty($inputalsopricewithtax)) { |
|
443 | + $colspan++; |
|
444 | + } |
|
445 | + if ($conf->global->PRODUCT_USE_UNITS) { |
|
446 | + $colspan++; |
|
447 | + } |
|
448 | + if (count($object->lines)) { |
|
449 | + //There will be an edit and a delete button |
|
450 | + $colspan += 2; |
|
451 | + |
|
452 | + // With this, there is a column move button ONLY if lines > 1 |
|
453 | + if (in_array($object->element, array( |
|
454 | + 'propal', |
|
455 | + 'supplier_proposal', |
|
456 | + 'facture', |
|
457 | + 'facturerec', |
|
458 | + 'invoice', |
|
459 | + 'commande', |
|
460 | + 'order', |
|
461 | + 'order_supplier', |
|
462 | + 'invoice_supplier' |
|
463 | + ))) { |
|
464 | + $colspan++; |
|
465 | + } |
|
466 | + } |
|
467 | 467 | |
468 | - if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) $colspan+=2; |
|
468 | + if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) $colspan+=2; |
|
469 | 469 | |
470 | - if (! empty($usemargins)) |
|
471 | - { |
|
472 | - if (!empty($user->rights->margins->creer)) $colspan++; // For the buying price |
|
473 | - if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; |
|
474 | - if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; |
|
475 | - } |
|
476 | - ?> |
|
470 | + if (! empty($usemargins)) |
|
471 | + { |
|
472 | + if (!empty($user->rights->margins->creer)) $colspan++; // For the buying price |
|
473 | + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; |
|
474 | + if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; |
|
475 | + } |
|
476 | + ?> |
|
477 | 477 | |
478 | 478 | <tr id="trlinefordates" <?php echo $bcnd[$var]; ?>> |
479 | 479 | <?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { print '<td></td>'; } ?> |
480 | 480 | <td colspan="<?php echo $colspan; ?>"> |
481 | 481 | <?php |
482 | - $date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); |
|
483 | - $date_end=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); |
|
484 | - if (! empty($object->element) && $object->element == 'contrat') |
|
485 | - { |
|
486 | - print $langs->trans("DateStartPlanned").' '; |
|
487 | - print $form->selectDate($date_start,"date_start",$usehm,$usehm,1,"addproduct"); |
|
488 | - print ' '.$langs->trans("DateEndPlanned").' '; |
|
489 | - print $form->selectDate($date_end,"date_end",$usehm,$usehm,1,"addproduct"); |
|
490 | - } |
|
491 | - else |
|
492 | - { |
|
493 | - echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; |
|
494 | - print $form->selectDate($date_start, 'date_start', empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1, empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1, 1, "addproduct", 1, 0); |
|
495 | - echo ' '.$langs->trans('to').' '; |
|
496 | - print $form->selectDate($date_end, 'date_end', empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1, empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1, 1, "addproduct", 1, 0); |
|
497 | - }; |
|
498 | - print '<script type="text/javascript">'; |
|
499 | - if (!$date_start) { |
|
500 | - if (isset($conf->global->MAIN_DEFAULT_DATE_START_HOUR)) { |
|
501 | - print 'jQuery("#date_starthour").val("'.$conf->global->MAIN_DEFAULT_DATE_START_HOUR.'");'; |
|
502 | - } |
|
503 | - if (isset($conf->global->MAIN_DEFAULT_DATE_START_MIN)) { |
|
504 | - print 'jQuery("#date_startmin").val("'.$conf->global->MAIN_DEFAULT_DATE_START_MIN.'");'; |
|
505 | - } |
|
506 | - } |
|
507 | - if (!$date_end) { |
|
508 | - if (isset($conf->global->MAIN_DEFAULT_DATE_END_HOUR)) { |
|
509 | - print 'jQuery("#date_endhour").val("'.$conf->global->MAIN_DEFAULT_DATE_END_HOUR.'");'; |
|
510 | - } |
|
511 | - if (isset($conf->global->MAIN_DEFAULT_DATE_END_MIN)) { |
|
512 | - print 'jQuery("#date_endmin").val("'.$conf->global->MAIN_DEFAULT_DATE_END_MIN.'");'; |
|
513 | - } |
|
514 | - } |
|
515 | - print '</script>' |
|
516 | - ?> |
|
482 | + $date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); |
|
483 | + $date_end=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); |
|
484 | + if (! empty($object->element) && $object->element == 'contrat') |
|
485 | + { |
|
486 | + print $langs->trans("DateStartPlanned").' '; |
|
487 | + print $form->selectDate($date_start,"date_start",$usehm,$usehm,1,"addproduct"); |
|
488 | + print ' '.$langs->trans("DateEndPlanned").' '; |
|
489 | + print $form->selectDate($date_end,"date_end",$usehm,$usehm,1,"addproduct"); |
|
490 | + } |
|
491 | + else |
|
492 | + { |
|
493 | + echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; |
|
494 | + print $form->selectDate($date_start, 'date_start', empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1, empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1, 1, "addproduct", 1, 0); |
|
495 | + echo ' '.$langs->trans('to').' '; |
|
496 | + print $form->selectDate($date_end, 'date_end', empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1, empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1, 1, "addproduct", 1, 0); |
|
497 | + }; |
|
498 | + print '<script type="text/javascript">'; |
|
499 | + if (!$date_start) { |
|
500 | + if (isset($conf->global->MAIN_DEFAULT_DATE_START_HOUR)) { |
|
501 | + print 'jQuery("#date_starthour").val("'.$conf->global->MAIN_DEFAULT_DATE_START_HOUR.'");'; |
|
502 | + } |
|
503 | + if (isset($conf->global->MAIN_DEFAULT_DATE_START_MIN)) { |
|
504 | + print 'jQuery("#date_startmin").val("'.$conf->global->MAIN_DEFAULT_DATE_START_MIN.'");'; |
|
505 | + } |
|
506 | + } |
|
507 | + if (!$date_end) { |
|
508 | + if (isset($conf->global->MAIN_DEFAULT_DATE_END_HOUR)) { |
|
509 | + print 'jQuery("#date_endhour").val("'.$conf->global->MAIN_DEFAULT_DATE_END_HOUR.'");'; |
|
510 | + } |
|
511 | + if (isset($conf->global->MAIN_DEFAULT_DATE_END_MIN)) { |
|
512 | + print 'jQuery("#date_endmin").val("'.$conf->global->MAIN_DEFAULT_DATE_END_MIN.'");'; |
|
513 | + } |
|
514 | + } |
|
515 | + print '</script>' |
|
516 | + ?> |
|
517 | 517 | </td> |
518 | 518 | </tr> |
519 | 519 | <?php |
@@ -530,19 +530,19 @@ discard block |
||
530 | 530 | /* Some js test when we click on button "Add" */ |
531 | 531 | jQuery(document).ready(function() { |
532 | 532 | <?php |
533 | - if (! empty($conf->global->DISPLAY_MARGIN_RATES)) { ?> |
|
533 | + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) { ?> |
|
534 | 534 | $("input[name='np_marginRate']:first").blur(function(e) { |
535 | 535 | return checkFreeLine(e, "np_marginRate"); |
536 | 536 | }); |
537 | 537 | <?php |
538 | - } |
|
539 | - if (! empty($conf->global->DISPLAY_MARK_RATES)) { ?> |
|
538 | + } |
|
539 | + if (! empty($conf->global->DISPLAY_MARK_RATES)) { ?> |
|
540 | 540 | $("input[name='np_markRate']:first").blur(function(e) { |
541 | 541 | return checkFreeLine(e, "np_markRate"); |
542 | 542 | }); |
543 | 543 | <?php |
544 | - } |
|
545 | - ?> |
|
544 | + } |
|
545 | + ?> |
|
546 | 546 | }); |
547 | 547 | |
548 | 548 | /* TODO This does not work for number with thousand separator that is , */ |
@@ -633,11 +633,11 @@ discard block |
||
633 | 633 | }); |
634 | 634 | |
635 | 635 | <?php |
636 | - if(!$freelines) { ?> |
|
636 | + if(!$freelines) { ?> |
|
637 | 637 | $("#prod_entry_mode_predef").click(); |
638 | 638 | <?php |
639 | - } |
|
640 | - ?> |
|
639 | + } |
|
640 | + ?> |
|
641 | 641 | |
642 | 642 | /* When changing predefined product, we reload list of supplier prices required for margin combo */ |
643 | 643 | $("#idprod, #idprodfournprice").change(function() |
@@ -649,10 +649,10 @@ discard block |
||
649 | 649 | jQuery('#trlinefordates').show(); |
650 | 650 | |
651 | 651 | <?php |
652 | - if (! empty($usemargins) && $user->rights->margins->creer) |
|
653 | - { |
|
654 | - $langs->load('stocks'); |
|
655 | - ?> |
|
652 | + if (! empty($usemargins) && $user->rights->margins->creer) |
|
653 | + { |
|
654 | + $langs->load('stocks'); |
|
655 | + ?> |
|
656 | 656 | |
657 | 657 | /* Code for margin */ |
658 | 658 | $("#fournprice_predef").find("option").remove(); |
@@ -673,12 +673,12 @@ discard block |
||
673 | 673 | |
674 | 674 | /* setup of margin calculation */ |
675 | 675 | var defaultbuyprice = '<?php |
676 | - if (isset($conf->global->MARGIN_TYPE)) |
|
677 | - { |
|
678 | - if ($conf->global->MARGIN_TYPE == '1') print 'bestsupplierprice'; |
|
679 | - if ($conf->global->MARGIN_TYPE == 'pmp') print 'pmp'; |
|
680 | - if ($conf->global->MARGIN_TYPE == 'costprice') print 'costprice'; |
|
681 | - } ?>'; |
|
676 | + if (isset($conf->global->MARGIN_TYPE)) |
|
677 | + { |
|
678 | + if ($conf->global->MARGIN_TYPE == '1') print 'bestsupplierprice'; |
|
679 | + if ($conf->global->MARGIN_TYPE == 'pmp') print 'pmp'; |
|
680 | + if ($conf->global->MARGIN_TYPE == 'costprice') print 'costprice'; |
|
681 | + } ?>'; |
|
682 | 682 | console.log("we will set the field for margin. defaultbuyprice="+defaultbuyprice); |
683 | 683 | |
684 | 684 | var i = 0; |
@@ -33,60 +33,60 @@ discard block |
||
33 | 33 | */ |
34 | 34 | |
35 | 35 | // Protection to avoid direct call of template |
36 | -if (empty($object) || ! is_object($object)) |
|
36 | +if (empty($object) || !is_object($object)) |
|
37 | 37 | { |
38 | 38 | print "Error, template page can't be called as URL"; |
39 | 39 | exit; |
40 | 40 | } |
41 | 41 | |
42 | 42 | |
43 | -$usemargins=0; |
|
44 | -if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) |
|
43 | +$usemargins = 0; |
|
44 | +if (!empty($conf->margin->enabled) && !empty($object->element) && in_array($object->element, array('facture', 'propal', 'commande'))) |
|
45 | 45 | { |
46 | - $usemargins=1; |
|
46 | + $usemargins = 1; |
|
47 | 47 | } |
48 | 48 | |
49 | -if (! isset($dateSelector)) global $dateSelector; // Take global var only if not already defined into function calling (for example formAddObjectLine) |
|
49 | +if (!isset($dateSelector)) global $dateSelector; // Take global var only if not already defined into function calling (for example formAddObjectLine) |
|
50 | 50 | global $forceall, $forcetoshowtitlelines, $senderissupplier, $inputalsopricewithtax; |
51 | 51 | |
52 | -if (! isset($dateSelector)) $dateSelector=1; // For backward compatibility |
|
53 | -elseif (empty($dateSelector)) $dateSelector=0; |
|
54 | -if (empty($forceall)) $forceall=0; |
|
55 | -if (empty($senderissupplier)) $senderissupplier=0; |
|
56 | -if (empty($inputalsopricewithtax)) $inputalsopricewithtax=0; |
|
52 | +if (!isset($dateSelector)) $dateSelector = 1; // For backward compatibility |
|
53 | +elseif (empty($dateSelector)) $dateSelector = 0; |
|
54 | +if (empty($forceall)) $forceall = 0; |
|
55 | +if (empty($senderissupplier)) $senderissupplier = 0; |
|
56 | +if (empty($inputalsopricewithtax)) $inputalsopricewithtax = 0; |
|
57 | 57 | |
58 | 58 | |
59 | 59 | // Define colspan for button Add |
60 | -$colspan = 3; // Col total ht + col edit + col delete |
|
61 | -if (in_array($object->element,array('propal','commande','order','facture','facturerec','invoice','supplier_proposal','order_supplier','invoice_supplier'))) $colspan++; // With this, there is a column move button |
|
60 | +$colspan = 3; // Col total ht + col edit + col delete |
|
61 | +if (in_array($object->element, array('propal', 'commande', 'order', 'facture', 'facturerec', 'invoice', 'supplier_proposal', 'order_supplier', 'invoice_supplier'))) $colspan++; // With this, there is a column move button |
|
62 | 62 | //print $object->element; |
63 | 63 | |
64 | 64 | // Lines for extrafield |
65 | 65 | $objectline = null; |
66 | 66 | if (!empty($extrafieldsline)) |
67 | 67 | { |
68 | - if ($this->table_element_line=='commandedet') { |
|
68 | + if ($this->table_element_line == 'commandedet') { |
|
69 | 69 | $objectline = new OrderLine($this->db); |
70 | 70 | } |
71 | - elseif ($this->table_element_line=='propaldet') { |
|
71 | + elseif ($this->table_element_line == 'propaldet') { |
|
72 | 72 | $objectline = new PropaleLigne($this->db); |
73 | 73 | } |
74 | - elseif ($this->table_element_line=='supplier_proposaldet') { |
|
74 | + elseif ($this->table_element_line == 'supplier_proposaldet') { |
|
75 | 75 | $objectline = new SupplierProposalLine($this->db); |
76 | 76 | } |
77 | - elseif ($this->table_element_line=='facturedet') { |
|
77 | + elseif ($this->table_element_line == 'facturedet') { |
|
78 | 78 | $objectline = new FactureLigne($this->db); |
79 | 79 | } |
80 | - elseif ($this->table_element_line=='contratdet') { |
|
80 | + elseif ($this->table_element_line == 'contratdet') { |
|
81 | 81 | $objectline = new ContratLigne($this->db); |
82 | 82 | } |
83 | - elseif ($this->table_element_line=='commande_fournisseurdet') { |
|
83 | + elseif ($this->table_element_line == 'commande_fournisseurdet') { |
|
84 | 84 | $objectline = new CommandeFournisseurLigne($this->db); |
85 | 85 | } |
86 | - elseif ($this->table_element_line=='facture_fourn_det') { |
|
86 | + elseif ($this->table_element_line == 'facture_fourn_det') { |
|
87 | 87 | $objectline = new SupplierInvoiceLine($this->db); |
88 | 88 | } |
89 | - elseif ($this->table_element_line=='facturedet_rec') { |
|
89 | + elseif ($this->table_element_line == 'facturedet_rec') { |
|
90 | 90 | $objectline = new FactureLigneRec($this->db); |
91 | 91 | } |
92 | 92 | } |
@@ -95,11 +95,11 @@ discard block |
||
95 | 95 | |
96 | 96 | <!-- BEGIN PHP TEMPLATE objectline_create.tpl.php --> |
97 | 97 | <?php |
98 | -$nolinesbefore=(count($this->lines) == 0 || $forcetoshowtitlelines); |
|
98 | +$nolinesbefore = (count($this->lines) == 0 || $forcetoshowtitlelines); |
|
99 | 99 | if ($nolinesbefore) { |
100 | 100 | ?> |
101 | -<tr class="liste_titre<?php echo (($nolinesbefore || $object->element=='contrat')?'':' liste_titre_add_') ?> nodrag nodrop"> |
|
102 | - <?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?> |
|
101 | +<tr class="liste_titre<?php echo (($nolinesbefore || $object->element == 'contrat') ? '' : ' liste_titre_add_') ?> nodrag nodrop"> |
|
102 | + <?php if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?> |
|
103 | 103 | <td class="linecolnum" align="center"></td> |
104 | 104 | <?php } ?> |
105 | 105 | <td class="linecoldescription minwidth500imp"> |
@@ -113,15 +113,15 @@ discard block |
||
113 | 113 | <?php } ?> |
114 | 114 | <td class="linecolvat" align="right"><span id="title_vat"><?php echo $langs->trans('VAT'); ?></span></td> |
115 | 115 | <td class="linecoluht" align="right"><span id="title_up_ht"><?php echo $langs->trans('PriceUHT'); ?></span></td> |
116 | - <?php if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { $colspan++;?> |
|
116 | + <?php if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { $colspan++; ?> |
|
117 | 117 | <td class="linecoluht_currency" align="right"><span id="title_up_ht_currency"><?php echo $langs->trans('PriceUHTCurrency'); ?></span></td> |
118 | 118 | <?php } ?> |
119 | - <?php if (! empty($inputalsopricewithtax)) { ?> |
|
119 | + <?php if (!empty($inputalsopricewithtax)) { ?> |
|
120 | 120 | <td class="linecoluttc" align="right"><span id="title_up_ttc"><?php echo $langs->trans('PriceUTTC'); ?></span></td> |
121 | 121 | <?php } ?> |
122 | 122 | <td class="linecolqty" align="right"><?php echo $langs->trans('Qty'); ?></td> |
123 | 123 | <?php |
124 | - if($conf->global->PRODUCT_USE_UNITS) |
|
124 | + if ($conf->global->PRODUCT_USE_UNITS) |
|
125 | 125 | { |
126 | 126 | print '<td class="linecoluseunit" align="left">'; |
127 | 127 | print '<span id="title_units">'; |
@@ -132,9 +132,9 @@ discard block |
||
132 | 132 | <td class="linecoldiscount" align="right"><?php echo $langs->trans('ReductionShort'); ?></td> |
133 | 133 | <?php |
134 | 134 | if ($this->situation_cycle_ref) { |
135 | - print '<td class="linecolcycleref" align="right">' . $langs->trans('Progress') . '</td>'; |
|
135 | + print '<td class="linecolcycleref" align="right">'.$langs->trans('Progress').'</td>'; |
|
136 | 136 | } |
137 | - if (! empty($usemargins)) |
|
137 | + if (!empty($usemargins)) |
|
138 | 138 | { |
139 | 139 | if (!empty($user->rights->margins->creer)) { |
140 | 140 | ?> |
@@ -150,8 +150,8 @@ discard block |
||
150 | 150 | ?> |
151 | 151 | </td> |
152 | 152 | <?php |
153 | - if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARGIN_RATES)) echo '<td align="right" class="margininfos linecolmargin2"><span class="np_marginRate">'.$langs->trans('MarginRate').'</span></td>'; |
|
154 | - if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARK_RATES)) echo '<td align="right" class="margininfos linecolmargin2"><span class="np_markRate">'.$langs->trans('MarkRate').'</span></td>'; |
|
153 | + if ($user->rights->margins->creer && !empty($conf->global->DISPLAY_MARGIN_RATES)) echo '<td align="right" class="margininfos linecolmargin2"><span class="np_marginRate">'.$langs->trans('MarginRate').'</span></td>'; |
|
154 | + if ($user->rights->margins->creer && !empty($conf->global->DISPLAY_MARK_RATES)) echo '<td align="right" class="margininfos linecolmargin2"><span class="np_markRate">'.$langs->trans('MarkRate').'</span></td>'; |
|
155 | 155 | } |
156 | 156 | ?> |
157 | 157 | <td class="linecoledit" colspan="<?php echo $colspan; ?>"> </td> |
@@ -159,17 +159,17 @@ discard block |
||
159 | 159 | <?php |
160 | 160 | } |
161 | 161 | ?> |
162 | -<tr class="pair nodrag nodrop nohoverpair<?php echo ($nolinesbefore || $object->element=='contrat')?'':' liste_titre_create'; ?>"> |
|
162 | +<tr class="pair nodrag nodrop nohoverpair<?php echo ($nolinesbefore || $object->element == 'contrat') ? '' : ' liste_titre_create'; ?>"> |
|
163 | 163 | <?php |
164 | 164 | // Adds a line numbering column |
165 | -if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { |
|
166 | - $coldisplay=2; |
|
165 | +if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { |
|
166 | + $coldisplay = 2; |
|
167 | 167 | ?> |
168 | 168 | <td class="nobottom linecolnum" align="center" width="5"></td> |
169 | 169 | <?php |
170 | 170 | } |
171 | 171 | else { |
172 | - $coldisplay=0; |
|
172 | + $coldisplay = 0; |
|
173 | 173 | } |
174 | 174 | ?> |
175 | 175 | |
@@ -181,22 +181,22 @@ discard block |
||
181 | 181 | if (empty($conf->global->MAIN_DISABLE_FREE_LINES)) |
182 | 182 | { |
183 | 183 | $freelines = true; |
184 | - $forceall=1; // We always force all type for free lines (module product or service means we use predefined product or service) |
|
184 | + $forceall = 1; // We always force all type for free lines (module product or service means we use predefined product or service) |
|
185 | 185 | if ($object->element == 'contrat') |
186 | 186 | { |
187 | - if (empty($conf->product->enabled) && empty($conf->service->enabled) && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $forceall=-1; // With contract, by default, no choice at all, except if CONTRACT_SUPPORT_PRODUCTS is set |
|
188 | - else if (empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $forceall=3; |
|
187 | + if (empty($conf->product->enabled) && empty($conf->service->enabled) && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $forceall = -1; // With contract, by default, no choice at all, except if CONTRACT_SUPPORT_PRODUCTS is set |
|
188 | + else if (empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $forceall = 3; |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | // Free line |
192 | 192 | echo '<span class="prod_entry_mode_free">'; |
193 | 193 | // Show radio free line |
194 | - if ($forceall >= 0 && (! empty($conf->product->enabled) || ! empty($conf->service->enabled))) |
|
194 | + if ($forceall >= 0 && (!empty($conf->product->enabled) || !empty($conf->service->enabled))) |
|
195 | 195 | { |
196 | 196 | echo '<label for="prod_entry_mode_free">'; |
197 | 197 | echo '<input type="radio" class="prod_entry_mode_free" name="prod_entry_mode" id="prod_entry_mode_free" value="free"'; |
198 | 198 | //echo (GETPOST('prod_entry_mode')=='free' ? ' checked' : ((empty($forceall) && (empty($conf->product->enabled) || empty($conf->service->enabled)))?' checked':'') ); |
199 | - echo (GETPOST('prod_entry_mode')=='free' ? ' checked' : ''); |
|
199 | + echo (GETPOST('prod_entry_mode') == 'free' ? ' checked' : ''); |
|
200 | 200 | echo '> '; |
201 | 201 | // Show type selector |
202 | 202 | echo $langs->trans("FreeLineOfType"); |
@@ -215,39 +215,39 @@ discard block |
||
215 | 215 | } |
216 | 216 | } |
217 | 217 | |
218 | - echo $form->select_type_of_lines(isset($_POST["type"])?GETPOST("type",'alpha',2):-1,'type',1,1,$forceall); |
|
218 | + echo $form->select_type_of_lines(isset($_POST["type"]) ?GETPOST("type", 'alpha', 2) : -1, 'type', 1, 1, $forceall); |
|
219 | 219 | |
220 | 220 | echo '</span>'; |
221 | 221 | } |
222 | 222 | |
223 | 223 | // Predefined product/service |
224 | - if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) |
|
224 | + if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) |
|
225 | 225 | { |
226 | 226 | if ($forceall >= 0 && $freelines) echo '<br>'; |
227 | 227 | echo '<span class="prod_entry_mode_predef">'; |
228 | 228 | echo '<label for="prod_entry_mode_predef">'; |
229 | - echo '<input type="radio" class="prod_entry_mode_predef" name="prod_entry_mode" id="prod_entry_mode_predef" value="predef"'.(GETPOST('prod_entry_mode')=='predef'?' checked':'').'> '; |
|
229 | + echo '<input type="radio" class="prod_entry_mode_predef" name="prod_entry_mode" id="prod_entry_mode_predef" value="predef"'.(GETPOST('prod_entry_mode') == 'predef' ? ' checked' : '').'> '; |
|
230 | 230 | if (empty($senderissupplier)) |
231 | 231 | { |
232 | - if (! empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToSell'); |
|
233 | - else if ((empty($conf->product->enabled) && ! empty($conf->service->enabled)) || ($object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))) echo $langs->trans('PredefinedServicesToSell'); |
|
232 | + if (!empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToSell'); |
|
233 | + else if ((empty($conf->product->enabled) && !empty($conf->service->enabled)) || ($object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))) echo $langs->trans('PredefinedServicesToSell'); |
|
234 | 234 | else echo $langs->trans('PredefinedProductsAndServicesToSell'); |
235 | 235 | } |
236 | 236 | else |
237 | 237 | { |
238 | - if (! empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToPurchase'); |
|
239 | - else if (empty($conf->product->enabled) && ! empty($conf->service->enabled)) echo $langs->trans('PredefinedServicesToPurchase'); |
|
238 | + if (!empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToPurchase'); |
|
239 | + else if (empty($conf->product->enabled) && !empty($conf->service->enabled)) echo $langs->trans('PredefinedServicesToPurchase'); |
|
240 | 240 | else echo $langs->trans('PredefinedProductsAndServicesToPurchase'); |
241 | 241 | } |
242 | 242 | echo '</label>'; |
243 | 243 | echo ' '; |
244 | 244 | |
245 | - $filtertype=''; |
|
246 | - if (! empty($object->element) && $object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $filtertype='1'; |
|
245 | + $filtertype = ''; |
|
246 | + if (!empty($object->element) && $object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $filtertype = '1'; |
|
247 | 247 | |
248 | 248 | if (empty($senderissupplier)) |
249 | 249 | { |
250 | - if (! empty($conf->global->ENTREPOT_EXTRA_STATUS)) |
|
250 | + if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) |
|
251 | 251 | { |
252 | 252 | // hide products in closed warehouse, but show products for internal transfer |
253 | 253 | $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth300', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array')); |
@@ -262,17 +262,17 @@ discard block |
||
262 | 262 | // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum |
263 | 263 | if ($senderissupplier != 2) |
264 | 264 | { |
265 | - $ajaxoptions=array( |
|
266 | - 'update' => array('qty'=>'qty','remise_percent' => 'discount','idprod' => 'idprod'), // html id tags that will be edited with which ajax json response key |
|
267 | - 'option_disabled' => 'idthatdoesnotexists', // html id to disable once select is done |
|
265 | + $ajaxoptions = array( |
|
266 | + 'update' => array('qty'=>'qty', 'remise_percent' => 'discount', 'idprod' => 'idprod'), // html id tags that will be edited with which ajax json response key |
|
267 | + 'option_disabled' => 'idthatdoesnotexists', // html id to disable once select is done |
|
268 | 268 | 'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'warning' (for exemple shown we select a disabled option into combo) |
269 | 269 | ); |
270 | - $alsoproductwithnosupplierprice=0; |
|
270 | + $alsoproductwithnosupplierprice = 0; |
|
271 | 271 | } |
272 | 272 | else |
273 | 273 | { |
274 | 274 | $ajaxoptions = array(); |
275 | - $alsoproductwithnosupplierprice=1; |
|
275 | + $alsoproductwithnosupplierprice = 1; |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | $form->select_produits_fournisseurs($object->socid, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1, $alsoproductwithnosupplierprice); |
@@ -283,23 +283,23 @@ discard block |
||
283 | 283 | |
284 | 284 | if (is_object($hookmanager) && empty($senderissupplier)) |
285 | 285 | { |
286 | - $parameters=array('fk_parent_line'=>GETPOST('fk_parent_line','int')); |
|
287 | - $reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action); |
|
286 | + $parameters = array('fk_parent_line'=>GETPOST('fk_parent_line', 'int')); |
|
287 | + $reshook = $hookmanager->executeHooks('formCreateProductOptions', $parameters, $object, $action); |
|
288 | 288 | if (!empty($hookmanager->resPrint)) { |
289 | 289 | print $hookmanager->resPrint; |
290 | 290 | } |
291 | 291 | } |
292 | - if (is_object($hookmanager) && ! empty($senderissupplier)) |
|
292 | + if (is_object($hookmanager) && !empty($senderissupplier)) |
|
293 | 293 | { |
294 | - $parameters=array('htmlname'=>'addproduct'); |
|
295 | - $reshook=$hookmanager->executeHooks('formCreateProductSupplierOptions',$parameters,$object,$action); |
|
294 | + $parameters = array('htmlname'=>'addproduct'); |
|
295 | + $reshook = $hookmanager->executeHooks('formCreateProductSupplierOptions', $parameters, $object, $action); |
|
296 | 296 | if (!empty($hookmanager->resPrint)) { |
297 | 297 | print $hookmanager->resPrint; |
298 | 298 | } |
299 | 299 | } |
300 | 300 | |
301 | 301 | |
302 | - if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { |
|
302 | + if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { |
|
303 | 303 | |
304 | 304 | if (!empty($conf->variants->enabled)) { |
305 | 305 | echo '<div id="attributes_box"></div>'; |
@@ -310,16 +310,16 @@ discard block |
||
310 | 310 | |
311 | 311 | // Editor wysiwyg |
312 | 312 | require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
313 | - $nbrows=ROWS_2; |
|
314 | - $enabled=(! empty($conf->global->FCKEDITOR_ENABLE_DETAILS)?$conf->global->FCKEDITOR_ENABLE_DETAILS:0); |
|
315 | - if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; |
|
316 | - $toolbarname='dolibarr_details'; |
|
317 | - if (! empty($conf->global->FCKEDITOR_ENABLE_DETAILS_FULL)) $toolbarname='dolibarr_notes'; |
|
318 | - $doleditor=new DolEditor('dp_desc',GETPOST('dp_desc'),'',100,$toolbarname,'',false,true,$enabled,$nbrows,'98%'); |
|
313 | + $nbrows = ROWS_2; |
|
314 | + $enabled = (!empty($conf->global->FCKEDITOR_ENABLE_DETAILS) ? $conf->global->FCKEDITOR_ENABLE_DETAILS : 0); |
|
315 | + if (!empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows = $conf->global->MAIN_INPUT_DESC_HEIGHT; |
|
316 | + $toolbarname = 'dolibarr_details'; |
|
317 | + if (!empty($conf->global->FCKEDITOR_ENABLE_DETAILS_FULL)) $toolbarname = 'dolibarr_notes'; |
|
318 | + $doleditor = new DolEditor('dp_desc', GETPOST('dp_desc'), '', 100, $toolbarname, '', false, true, $enabled, $nbrows, '98%'); |
|
319 | 319 | $doleditor->Create(); |
320 | 320 | |
321 | 321 | // Show autofill date for recuring invoices |
322 | - if (! empty($conf->service->enabled) && $object->element == 'facturerec') |
|
322 | + if (!empty($conf->service->enabled) && $object->element == 'facturerec') |
|
323 | 323 | { |
324 | 324 | echo '<div class="divlinefordates"><br>'; |
325 | 325 | echo $langs->trans('AutoFillDateFrom').' '; |
@@ -336,60 +336,60 @@ discard block |
||
336 | 336 | if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines |
337 | 337 | { |
338 | 338 | ?> |
339 | - <td class="nobottom linecolresupplier"><input id="fourn_ref" name="fourn_ref" class="flat maxwidth75" value="<?php echo (isset($_POST["fourn_ref"])?GETPOST("fourn_ref",'alpha',2):''); ?>"></td> |
|
339 | + <td class="nobottom linecolresupplier"><input id="fourn_ref" name="fourn_ref" class="flat maxwidth75" value="<?php echo (isset($_POST["fourn_ref"]) ?GETPOST("fourn_ref", 'alpha', 2) : ''); ?>"></td> |
|
340 | 340 | <?php } ?> |
341 | 341 | |
342 | 342 | <td class="nobottom linecolvat" align="right"><?php |
343 | 343 | if ($seller->tva_assuj == "0") echo '<input type="hidden" name="tva_tx" id="tva_tx" value="0">'.vatrate(0, true); |
344 | - else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?GETPOST("tva_tx",'alpha',2):-1), $seller, $buyer, 0, 0, '', false, 1); |
|
344 | + else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"]) ?GETPOST("tva_tx", 'alpha', 2) : -1), $seller, $buyer, 0, 0, '', false, 1); |
|
345 | 345 | ?> |
346 | 346 | </td> |
347 | 347 | <td class="nobottom linecoluht" align="right"> |
348 | - <input type="text" size="5" name="price_ht" id="price_ht" class="flat right" value="<?php echo (isset($_POST["price_ht"])?GETPOST("price_ht",'alpha',2):''); ?>"> |
|
348 | + <input type="text" size="5" name="price_ht" id="price_ht" class="flat right" value="<?php echo (isset($_POST["price_ht"]) ?GETPOST("price_ht", 'alpha', 2) : ''); ?>"> |
|
349 | 349 | </td> |
350 | 350 | |
351 | - <?php if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { $colspan++;?> |
|
351 | + <?php if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { $colspan++; ?> |
|
352 | 352 | <td class="nobottom linecoluht_currency" align="right"> |
353 | - <input type="text" size="5" name="multicurrency_price_ht" id="multicurrency_price_ht" class="flat right" value="<?php echo (isset($_POST["multicurrency_price_ht"])?GETPOST("multicurrency_price_ht",'alpha',2):''); ?>"> |
|
353 | + <input type="text" size="5" name="multicurrency_price_ht" id="multicurrency_price_ht" class="flat right" value="<?php echo (isset($_POST["multicurrency_price_ht"]) ?GETPOST("multicurrency_price_ht", 'alpha', 2) : ''); ?>"> |
|
354 | 354 | </td> |
355 | 355 | <?php } ?> |
356 | 356 | |
357 | - <?php if (! empty($inputalsopricewithtax)) { ?> |
|
357 | + <?php if (!empty($inputalsopricewithtax)) { ?> |
|
358 | 358 | <td class="nobottom linecoluttc" align="right"> |
359 | - <input type="text" size="5" name="price_ttc" id="price_ttc" class="flat" value="<?php echo (isset($_POST["price_ttc"])?GETPOST("price_ttc",'alpha',2):''); ?>"> |
|
359 | + <input type="text" size="5" name="price_ttc" id="price_ttc" class="flat" value="<?php echo (isset($_POST["price_ttc"]) ?GETPOST("price_ttc", 'alpha', 2) : ''); ?>"> |
|
360 | 360 | </td> |
361 | 361 | <?php } ?> |
362 | - <td class="nobottom linecolqty" align="right"><input type="text" size="2" name="qty" id="qty" class="flat right" value="<?php echo (isset($_POST["qty"])?GETPOST("qty",'alpha',2):1); ?>"> |
|
362 | + <td class="nobottom linecolqty" align="right"><input type="text" size="2" name="qty" id="qty" class="flat right" value="<?php echo (isset($_POST["qty"]) ?GETPOST("qty", 'alpha', 2) : 1); ?>"> |
|
363 | 363 | </td> |
364 | 364 | <?php |
365 | - if($conf->global->PRODUCT_USE_UNITS) |
|
365 | + if ($conf->global->PRODUCT_USE_UNITS) |
|
366 | 366 | { |
367 | 367 | print '<td class="nobottom linecoluseunit" align="left">'; |
368 | 368 | print $form->selectUnits($line->fk_unit, "units"); |
369 | 369 | print '</td>'; |
370 | 370 | } |
371 | 371 | $remise_percent = $buyer->remise_percent; |
372 | - if($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') { |
|
372 | + if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') { |
|
373 | 373 | $remise_percent = $seller->remise_supplier_percent; |
374 | 374 | } |
375 | 375 | ?> |
376 | - <td class="nobottom nowrap linecoldiscount" align="right"><input type="text" size="1" name="remise_percent" id="remise_percent" class="flat right" value="<?php echo (isset($_POST["remise_percent"])?GETPOST("remise_percent",'alpha',2):$remise_percent); ?>"><span class="hideonsmartphone">%</span></td> |
|
376 | + <td class="nobottom nowrap linecoldiscount" align="right"><input type="text" size="1" name="remise_percent" id="remise_percent" class="flat right" value="<?php echo (isset($_POST["remise_percent"]) ?GETPOST("remise_percent", 'alpha', 2) : $remise_percent); ?>"><span class="hideonsmartphone">%</span></td> |
|
377 | 377 | <?php |
378 | 378 | if ($this->situation_cycle_ref) { |
379 | 379 | $coldisplay++; |
380 | 380 | print '<td class="nobottom nowrap" align="right"><input class="falt right" type="text" size="1" value="0" name="progress">%</td>'; |
381 | 381 | } |
382 | - if (! empty($usemargins)) |
|
382 | + if (!empty($usemargins)) |
|
383 | 383 | { |
384 | 384 | if (!empty($user->rights->margins->creer)) { |
385 | 385 | ?> |
386 | 386 | <td align="right" class="nobottom margininfos linecolmargin"> |
387 | 387 | <!-- For predef product --> |
388 | - <?php if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { ?> |
|
388 | + <?php if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { ?> |
|
389 | 389 | <select id="fournprice_predef" name="fournprice_predef" class="flat" style="display: none;"></select> |
390 | 390 | <?php } ?> |
391 | 391 | <!-- For free product --> |
392 | - <input type="text" size="5" id="buying_price" name="buying_price" class="flat right" value="<?php echo (isset($_POST["buying_price"])?GETPOST("buying_price",'alpha',2):''); ?>"> |
|
392 | + <input type="text" size="5" id="buying_price" name="buying_price" class="flat right" value="<?php echo (isset($_POST["buying_price"]) ?GETPOST("buying_price", 'alpha', 2) : ''); ?>"> |
|
393 | 393 | </td> |
394 | 394 | <?php |
395 | 395 | $coldisplay++; |
@@ -397,21 +397,21 @@ discard block |
||
397 | 397 | |
398 | 398 | if ($user->rights->margins->creer) |
399 | 399 | { |
400 | - if (! empty($conf->global->DISPLAY_MARGIN_RATES)) |
|
400 | + if (!empty($conf->global->DISPLAY_MARGIN_RATES)) |
|
401 | 401 | { |
402 | - echo '<td align="right" class="nobottom nowrap margininfos"><input class="flat right" type="text" size="2" id="np_marginRate" name="np_marginRate" value="'.(isset($_POST["np_marginRate"])?GETPOST("np_marginRate",'alpha',2):'').'"><span class="np_marginRate hideonsmartphone">%</span></td>'; |
|
402 | + echo '<td align="right" class="nobottom nowrap margininfos"><input class="flat right" type="text" size="2" id="np_marginRate" name="np_marginRate" value="'.(isset($_POST["np_marginRate"]) ?GETPOST("np_marginRate", 'alpha', 2) : '').'"><span class="np_marginRate hideonsmartphone">%</span></td>'; |
|
403 | 403 | $coldisplay++; |
404 | 404 | } |
405 | - if (! empty($conf->global->DISPLAY_MARK_RATES)) |
|
405 | + if (!empty($conf->global->DISPLAY_MARK_RATES)) |
|
406 | 406 | { |
407 | - echo '<td align="right" class="nobottom nowrap margininfos"><input class="flat right" type="text" size="2" id="np_markRate" name="np_markRate" value="'.(isset($_POST["np_markRate"])?GETPOST("np_markRate",'alpha',2):'').'"><span class="np_markRate hideonsmartphone">%</span></td>'; |
|
407 | + echo '<td align="right" class="nobottom nowrap margininfos"><input class="flat right" type="text" size="2" id="np_markRate" name="np_markRate" value="'.(isset($_POST["np_markRate"]) ?GETPOST("np_markRate", 'alpha', 2) : '').'"><span class="np_markRate hideonsmartphone">%</span></td>'; |
|
408 | 408 | $coldisplay++; |
409 | 409 | } |
410 | 410 | } |
411 | 411 | else |
412 | 412 | { |
413 | - if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $coldisplay++; |
|
414 | - if (! empty($conf->global->DISPLAY_MARK_RATES)) $coldisplay++; |
|
413 | + if (!empty($conf->global->DISPLAY_MARGIN_RATES)) $coldisplay++; |
|
414 | + if (!empty($conf->global->DISPLAY_MARK_RATES)) $coldisplay++; |
|
415 | 415 | } |
416 | 416 | } |
417 | 417 | ?> |
@@ -422,12 +422,12 @@ discard block |
||
422 | 422 | |
423 | 423 | <?php |
424 | 424 | if (is_object($objectline)) { |
425 | - print $objectline->showOptionals($extrafieldsline, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay+8), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); |
|
425 | + print $objectline->showOptionals($extrafieldsline, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay + 8), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD) ? 0 : 1); |
|
426 | 426 | } |
427 | 427 | ?> |
428 | 428 | |
429 | 429 | <?php |
430 | -if ((! empty($conf->service->enabled) || ($object->element == 'contrat')) && $dateSelector && GETPOST('type') != '0') // We show date field if required |
|
430 | +if ((!empty($conf->service->enabled) || ($object->element == 'contrat')) && $dateSelector && GETPOST('type') != '0') // We show date field if required |
|
431 | 431 | { |
432 | 432 | $colspan = 6; |
433 | 433 | |
@@ -465,35 +465,35 @@ discard block |
||
465 | 465 | } |
466 | 466 | } |
467 | 467 | |
468 | - if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) $colspan+=2; |
|
468 | + if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) $colspan += 2; |
|
469 | 469 | |
470 | - if (! empty($usemargins)) |
|
470 | + if (!empty($usemargins)) |
|
471 | 471 | { |
472 | 472 | if (!empty($user->rights->margins->creer)) $colspan++; // For the buying price |
473 | - if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; |
|
474 | - if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; |
|
473 | + if (!empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; |
|
474 | + if (!empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; |
|
475 | 475 | } |
476 | 476 | ?> |
477 | 477 | |
478 | 478 | <tr id="trlinefordates" <?php echo $bcnd[$var]; ?>> |
479 | - <?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { print '<td></td>'; } ?> |
|
479 | + <?php if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { print '<td></td>'; } ?> |
|
480 | 480 | <td colspan="<?php echo $colspan; ?>"> |
481 | 481 | <?php |
482 | - $date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); |
|
483 | - $date_end=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); |
|
484 | - if (! empty($object->element) && $object->element == 'contrat') |
|
482 | + $date_start = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); |
|
483 | + $date_end = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); |
|
484 | + if (!empty($object->element) && $object->element == 'contrat') |
|
485 | 485 | { |
486 | 486 | print $langs->trans("DateStartPlanned").' '; |
487 | - print $form->selectDate($date_start,"date_start",$usehm,$usehm,1,"addproduct"); |
|
487 | + print $form->selectDate($date_start, "date_start", $usehm, $usehm, 1, "addproduct"); |
|
488 | 488 | print ' '.$langs->trans("DateEndPlanned").' '; |
489 | - print $form->selectDate($date_end,"date_end",$usehm,$usehm,1,"addproduct"); |
|
489 | + print $form->selectDate($date_end, "date_end", $usehm, $usehm, 1, "addproduct"); |
|
490 | 490 | } |
491 | 491 | else |
492 | 492 | { |
493 | 493 | echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; |
494 | - print $form->selectDate($date_start, 'date_start', empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1, empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1, 1, "addproduct", 1, 0); |
|
494 | + print $form->selectDate($date_start, 'date_start', empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? 0 : 1, empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? 0 : 1, 1, "addproduct", 1, 0); |
|
495 | 495 | echo ' '.$langs->trans('to').' '; |
496 | - print $form->selectDate($date_end, 'date_end', empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1, empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1, 1, "addproduct", 1, 0); |
|
496 | + print $form->selectDate($date_end, 'date_end', empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? 0 : 1, empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? 0 : 1, 1, "addproduct", 1, 0); |
|
497 | 497 | }; |
498 | 498 | print '<script type="text/javascript">'; |
499 | 499 | if (!$date_start) { |
@@ -523,20 +523,20 @@ discard block |
||
523 | 523 | <script type="text/javascript"> |
524 | 524 | |
525 | 525 | <?php |
526 | -if (! empty($usemargins) && $user->rights->margins->creer) |
|
526 | +if (!empty($usemargins) && $user->rights->margins->creer) |
|
527 | 527 | { |
528 | 528 | ?> |
529 | 529 | |
530 | 530 | /* Some js test when we click on button "Add" */ |
531 | 531 | jQuery(document).ready(function() { |
532 | 532 | <?php |
533 | - if (! empty($conf->global->DISPLAY_MARGIN_RATES)) { ?> |
|
533 | + if (!empty($conf->global->DISPLAY_MARGIN_RATES)) { ?> |
|
534 | 534 | $("input[name='np_marginRate']:first").blur(function(e) { |
535 | 535 | return checkFreeLine(e, "np_marginRate"); |
536 | 536 | }); |
537 | 537 | <?php |
538 | 538 | } |
539 | - if (! empty($conf->global->DISPLAY_MARK_RATES)) { ?> |
|
539 | + if (!empty($conf->global->DISPLAY_MARK_RATES)) { ?> |
|
540 | 540 | $("input[name='np_markRate']:first").blur(function(e) { |
541 | 541 | return checkFreeLine(e, "np_markRate"); |
542 | 542 | }); |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | }); |
634 | 634 | |
635 | 635 | <?php |
636 | - if(!$freelines) { ?> |
|
636 | + if (!$freelines) { ?> |
|
637 | 637 | $("#prod_entry_mode_predef").click(); |
638 | 638 | <?php |
639 | 639 | } |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | jQuery('#trlinefordates').show(); |
650 | 650 | |
651 | 651 | <?php |
652 | - if (! empty($usemargins) && $user->rights->margins->creer) |
|
652 | + if (!empty($usemargins) && $user->rights->margins->creer) |
|
653 | 653 | { |
654 | 654 | $langs->load('stocks'); |
655 | 655 | ?> |
@@ -46,19 +46,36 @@ discard block |
||
46 | 46 | $usemargins=1; |
47 | 47 | } |
48 | 48 | |
49 | -if (! isset($dateSelector)) global $dateSelector; // Take global var only if not already defined into function calling (for example formAddObjectLine) |
|
49 | +if (! isset($dateSelector)) { |
|
50 | + global $dateSelector; |
|
51 | +} |
|
52 | +// Take global var only if not already defined into function calling (for example formAddObjectLine) |
|
50 | 53 | global $forceall, $forcetoshowtitlelines, $senderissupplier, $inputalsopricewithtax; |
51 | 54 | |
52 | -if (! isset($dateSelector)) $dateSelector=1; // For backward compatibility |
|
53 | -elseif (empty($dateSelector)) $dateSelector=0; |
|
54 | -if (empty($forceall)) $forceall=0; |
|
55 | -if (empty($senderissupplier)) $senderissupplier=0; |
|
56 | -if (empty($inputalsopricewithtax)) $inputalsopricewithtax=0; |
|
55 | +if (! isset($dateSelector)) { |
|
56 | + $dateSelector=1; |
|
57 | +} |
|
58 | +// For backward compatibility |
|
59 | +elseif (empty($dateSelector)) { |
|
60 | + $dateSelector=0; |
|
61 | +} |
|
62 | +if (empty($forceall)) { |
|
63 | + $forceall=0; |
|
64 | +} |
|
65 | +if (empty($senderissupplier)) { |
|
66 | + $senderissupplier=0; |
|
67 | +} |
|
68 | +if (empty($inputalsopricewithtax)) { |
|
69 | + $inputalsopricewithtax=0; |
|
70 | +} |
|
57 | 71 | |
58 | 72 | |
59 | 73 | // Define colspan for button Add |
60 | 74 | $colspan = 3; // Col total ht + col edit + col delete |
61 | -if (in_array($object->element,array('propal','commande','order','facture','facturerec','invoice','supplier_proposal','order_supplier','invoice_supplier'))) $colspan++; // With this, there is a column move button |
|
75 | +if (in_array($object->element,array('propal','commande','order','facture','facturerec','invoice','supplier_proposal','order_supplier','invoice_supplier'))) { |
|
76 | + $colspan++; |
|
77 | +} |
|
78 | +// With this, there is a column move button |
|
62 | 79 | //print $object->element; |
63 | 80 | |
64 | 81 | // Lines for extrafield |
@@ -67,26 +84,19 @@ discard block |
||
67 | 84 | { |
68 | 85 | if ($this->table_element_line=='commandedet') { |
69 | 86 | $objectline = new OrderLine($this->db); |
70 | - } |
|
71 | - elseif ($this->table_element_line=='propaldet') { |
|
87 | + } elseif ($this->table_element_line=='propaldet') { |
|
72 | 88 | $objectline = new PropaleLigne($this->db); |
73 | - } |
|
74 | - elseif ($this->table_element_line=='supplier_proposaldet') { |
|
89 | + } elseif ($this->table_element_line=='supplier_proposaldet') { |
|
75 | 90 | $objectline = new SupplierProposalLine($this->db); |
76 | - } |
|
77 | - elseif ($this->table_element_line=='facturedet') { |
|
91 | + } elseif ($this->table_element_line=='facturedet') { |
|
78 | 92 | $objectline = new FactureLigne($this->db); |
79 | - } |
|
80 | - elseif ($this->table_element_line=='contratdet') { |
|
93 | + } elseif ($this->table_element_line=='contratdet') { |
|
81 | 94 | $objectline = new ContratLigne($this->db); |
82 | - } |
|
83 | - elseif ($this->table_element_line=='commande_fournisseurdet') { |
|
95 | + } elseif ($this->table_element_line=='commande_fournisseurdet') { |
|
84 | 96 | $objectline = new CommandeFournisseurLigne($this->db); |
85 | - } |
|
86 | - elseif ($this->table_element_line=='facture_fourn_det') { |
|
97 | + } elseif ($this->table_element_line=='facture_fourn_det') { |
|
87 | 98 | $objectline = new SupplierInvoiceLine($this->db); |
88 | - } |
|
89 | - elseif ($this->table_element_line=='facturedet_rec') { |
|
99 | + } elseif ($this->table_element_line=='facturedet_rec') { |
|
90 | 100 | $objectline = new FactureLigneRec($this->db); |
91 | 101 | } |
92 | 102 | } |
@@ -106,10 +116,13 @@ discard block |
||
106 | 116 | <div id="add"></div><span class="hideonsmartphone"><?php echo $langs->trans('AddNewLine'); ?></span><?php // echo $langs->trans("FreeZone"); ?> |
107 | 117 | </td> |
108 | 118 | <?php |
109 | - if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines |
|
119 | + if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') { |
|
120 | + // We must have same test in printObjectLines |
|
110 | 121 | { |
111 | 122 | ?> |
112 | - <td class="linecolrefsupplier"><span id="title_fourn_ref"><?php echo $langs->trans('SupplierRef'); ?></span></td> |
|
123 | + <td class="linecolrefsupplier"><span id="title_fourn_ref"><?php echo $langs->trans('SupplierRef'); |
|
124 | + } |
|
125 | + ?></span></td> |
|
113 | 126 | <?php } ?> |
114 | 127 | <td class="linecolvat" align="right"><span id="title_vat"><?php echo $langs->trans('VAT'); ?></span></td> |
115 | 128 | <td class="linecoluht" align="right"><span id="title_up_ht"><?php echo $langs->trans('PriceUHT'); ?></span></td> |
@@ -140,18 +153,24 @@ discard block |
||
140 | 153 | ?> |
141 | 154 | <td align="right" class="margininfos linecolmargin1"> |
142 | 155 | <?php |
156 | + } else { |
|
157 | + $colspan++; |
|
143 | 158 | } |
144 | - else $colspan++; |
|
145 | 159 | |
146 | - if ($conf->global->MARGIN_TYPE == "1") |
|
147 | - echo $langs->trans('BuyingPrice'); |
|
148 | - else |
|
149 | - echo $langs->trans('CostPrice'); |
|
160 | + if ($conf->global->MARGIN_TYPE == "1") { |
|
161 | + echo $langs->trans('BuyingPrice'); |
|
162 | + } else { |
|
163 | + echo $langs->trans('CostPrice'); |
|
164 | + } |
|
150 | 165 | ?> |
151 | 166 | </td> |
152 | 167 | <?php |
153 | - if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARGIN_RATES)) echo '<td align="right" class="margininfos linecolmargin2"><span class="np_marginRate">'.$langs->trans('MarginRate').'</span></td>'; |
|
154 | - if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARK_RATES)) echo '<td align="right" class="margininfos linecolmargin2"><span class="np_markRate">'.$langs->trans('MarkRate').'</span></td>'; |
|
168 | + if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARGIN_RATES)) { |
|
169 | + echo '<td align="right" class="margininfos linecolmargin2"><span class="np_marginRate">'.$langs->trans('MarginRate').'</span></td>'; |
|
170 | + } |
|
171 | + if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARK_RATES)) { |
|
172 | + echo '<td align="right" class="margininfos linecolmargin2"><span class="np_markRate">'.$langs->trans('MarkRate').'</span></td>'; |
|
173 | + } |
|
155 | 174 | } |
156 | 175 | ?> |
157 | 176 | <td class="linecoledit" colspan="<?php echo $colspan; ?>"> </td> |
@@ -167,8 +186,7 @@ discard block |
||
167 | 186 | ?> |
168 | 187 | <td class="nobottom linecolnum" align="center" width="5"></td> |
169 | 188 | <?php |
170 | -} |
|
171 | -else { |
|
189 | +} else { |
|
172 | 190 | $coldisplay=0; |
173 | 191 | } |
174 | 192 | ?> |
@@ -184,8 +202,13 @@ discard block |
||
184 | 202 | $forceall=1; // We always force all type for free lines (module product or service means we use predefined product or service) |
185 | 203 | if ($object->element == 'contrat') |
186 | 204 | { |
187 | - if (empty($conf->product->enabled) && empty($conf->service->enabled) && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $forceall=-1; // With contract, by default, no choice at all, except if CONTRACT_SUPPORT_PRODUCTS is set |
|
188 | - else if (empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $forceall=3; |
|
205 | + if (empty($conf->product->enabled) && empty($conf->service->enabled) && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) { |
|
206 | + $forceall=-1; |
|
207 | + } |
|
208 | + // With contract, by default, no choice at all, except if CONTRACT_SUPPORT_PRODUCTS is set |
|
209 | + else if (empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) { |
|
210 | + $forceall=3; |
|
211 | + } |
|
189 | 212 | } |
190 | 213 | |
191 | 214 | // Free line |
@@ -202,15 +225,17 @@ discard block |
||
202 | 225 | echo $langs->trans("FreeLineOfType"); |
203 | 226 | echo '</label>'; |
204 | 227 | echo ' '; |
205 | - } |
|
206 | - else |
|
228 | + } else |
|
207 | 229 | { |
208 | 230 | echo '<input type="hidden" id="prod_entry_mode_free" name="prod_entry_mode" value="free">'; |
209 | 231 | // Show type selector |
210 | 232 | if ($forceall >= 0) |
211 | 233 | { |
212 | - if (empty($conf->product->enabled) || empty($conf->service->enabled)) echo $langs->trans("Type"); |
|
213 | - else echo $langs->trans("FreeLineOfType"); |
|
234 | + if (empty($conf->product->enabled) || empty($conf->service->enabled)) { |
|
235 | + echo $langs->trans("Type"); |
|
236 | + } else { |
|
237 | + echo $langs->trans("FreeLineOfType"); |
|
238 | + } |
|
214 | 239 | echo ' '; |
215 | 240 | } |
216 | 241 | } |
@@ -223,27 +248,38 @@ discard block |
||
223 | 248 | // Predefined product/service |
224 | 249 | if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) |
225 | 250 | { |
226 | - if ($forceall >= 0 && $freelines) echo '<br>'; |
|
251 | + if ($forceall >= 0 && $freelines) { |
|
252 | + echo '<br>'; |
|
253 | + } |
|
227 | 254 | echo '<span class="prod_entry_mode_predef">'; |
228 | 255 | echo '<label for="prod_entry_mode_predef">'; |
229 | 256 | echo '<input type="radio" class="prod_entry_mode_predef" name="prod_entry_mode" id="prod_entry_mode_predef" value="predef"'.(GETPOST('prod_entry_mode')=='predef'?' checked':'').'> '; |
230 | 257 | if (empty($senderissupplier)) |
231 | 258 | { |
232 | - if (! empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToSell'); |
|
233 | - else if ((empty($conf->product->enabled) && ! empty($conf->service->enabled)) || ($object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))) echo $langs->trans('PredefinedServicesToSell'); |
|
234 | - else echo $langs->trans('PredefinedProductsAndServicesToSell'); |
|
235 | - } |
|
236 | - else |
|
259 | + if (! empty($conf->product->enabled) && empty($conf->service->enabled)) { |
|
260 | + echo $langs->trans('PredefinedProductsToSell'); |
|
261 | + } else if ((empty($conf->product->enabled) && ! empty($conf->service->enabled)) || ($object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))) { |
|
262 | + echo $langs->trans('PredefinedServicesToSell'); |
|
263 | + } else { |
|
264 | + echo $langs->trans('PredefinedProductsAndServicesToSell'); |
|
265 | + } |
|
266 | + } else |
|
237 | 267 | { |
238 | - if (! empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToPurchase'); |
|
239 | - else if (empty($conf->product->enabled) && ! empty($conf->service->enabled)) echo $langs->trans('PredefinedServicesToPurchase'); |
|
240 | - else echo $langs->trans('PredefinedProductsAndServicesToPurchase'); |
|
268 | + if (! empty($conf->product->enabled) && empty($conf->service->enabled)) { |
|
269 | + echo $langs->trans('PredefinedProductsToPurchase'); |
|
270 | + } else if (empty($conf->product->enabled) && ! empty($conf->service->enabled)) { |
|
271 | + echo $langs->trans('PredefinedServicesToPurchase'); |
|
272 | + } else { |
|
273 | + echo $langs->trans('PredefinedProductsAndServicesToPurchase'); |
|
274 | + } |
|
241 | 275 | } |
242 | 276 | echo '</label>'; |
243 | 277 | echo ' '; |
244 | 278 | |
245 | 279 | $filtertype=''; |
246 | - if (! empty($object->element) && $object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $filtertype='1'; |
|
280 | + if (! empty($object->element) && $object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) { |
|
281 | + $filtertype='1'; |
|
282 | + } |
|
247 | 283 | |
248 | 284 | if (empty($senderissupplier)) |
249 | 285 | { |
@@ -251,13 +287,11 @@ discard block |
||
251 | 287 | { |
252 | 288 | // hide products in closed warehouse, but show products for internal transfer |
253 | 289 | $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth300', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array')); |
254 | - } |
|
255 | - else |
|
290 | + } else |
|
256 | 291 | { |
257 | 292 | $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth300', 0, '', GETPOST('combinations', 'array')); |
258 | 293 | } |
259 | - } |
|
260 | - else |
|
294 | + } else |
|
261 | 295 | { |
262 | 296 | // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum |
263 | 297 | if ($senderissupplier != 2) |
@@ -268,8 +302,7 @@ discard block |
||
268 | 302 | 'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'warning' (for exemple shown we select a disabled option into combo) |
269 | 303 | ); |
270 | 304 | $alsoproductwithnosupplierprice=0; |
271 | - } |
|
272 | - else |
|
305 | + } else |
|
273 | 306 | { |
274 | 307 | $ajaxoptions = array(); |
275 | 308 | $alsoproductwithnosupplierprice=1; |
@@ -312,9 +345,13 @@ discard block |
||
312 | 345 | require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
313 | 346 | $nbrows=ROWS_2; |
314 | 347 | $enabled=(! empty($conf->global->FCKEDITOR_ENABLE_DETAILS)?$conf->global->FCKEDITOR_ENABLE_DETAILS:0); |
315 | - if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; |
|
348 | + if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) { |
|
349 | + $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; |
|
350 | + } |
|
316 | 351 | $toolbarname='dolibarr_details'; |
317 | - if (! empty($conf->global->FCKEDITOR_ENABLE_DETAILS_FULL)) $toolbarname='dolibarr_notes'; |
|
352 | + if (! empty($conf->global->FCKEDITOR_ENABLE_DETAILS_FULL)) { |
|
353 | + $toolbarname='dolibarr_notes'; |
|
354 | + } |
|
318 | 355 | $doleditor=new DolEditor('dp_desc',GETPOST('dp_desc'),'',100,$toolbarname,'',false,true,$enabled,$nbrows,'98%'); |
319 | 356 | $doleditor->Create(); |
320 | 357 | |
@@ -333,15 +370,21 @@ discard block |
||
333 | 370 | </td> |
334 | 371 | |
335 | 372 | <?php |
336 | - if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines |
|
373 | + if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') { |
|
374 | + // We must have same test in printObjectLines |
|
337 | 375 | { |
338 | 376 | ?> |
339 | - <td class="nobottom linecolresupplier"><input id="fourn_ref" name="fourn_ref" class="flat maxwidth75" value="<?php echo (isset($_POST["fourn_ref"])?GETPOST("fourn_ref",'alpha',2):''); ?>"></td> |
|
377 | + <td class="nobottom linecolresupplier"><input id="fourn_ref" name="fourn_ref" class="flat maxwidth75" value="<?php echo (isset($_POST["fourn_ref"])?GETPOST("fourn_ref",'alpha',2):''); |
|
378 | + } |
|
379 | + ?>"></td> |
|
340 | 380 | <?php } ?> |
341 | 381 | |
342 | 382 | <td class="nobottom linecolvat" align="right"><?php |
343 | - if ($seller->tva_assuj == "0") echo '<input type="hidden" name="tva_tx" id="tva_tx" value="0">'.vatrate(0, true); |
|
344 | - else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?GETPOST("tva_tx",'alpha',2):-1), $seller, $buyer, 0, 0, '', false, 1); |
|
383 | + if ($seller->tva_assuj == "0") { |
|
384 | + echo '<input type="hidden" name="tva_tx" id="tva_tx" value="0">'.vatrate(0, true); |
|
385 | + } else { |
|
386 | + echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?GETPOST("tva_tx",'alpha',2):-1), $seller, $buyer, 0, 0, '', false, 1); |
|
387 | + } |
|
345 | 388 | ?> |
346 | 389 | </td> |
347 | 390 | <td class="nobottom linecoluht" align="right"> |
@@ -407,11 +450,14 @@ discard block |
||
407 | 450 | echo '<td align="right" class="nobottom nowrap margininfos"><input class="flat right" type="text" size="2" id="np_markRate" name="np_markRate" value="'.(isset($_POST["np_markRate"])?GETPOST("np_markRate",'alpha',2):'').'"><span class="np_markRate hideonsmartphone">%</span></td>'; |
408 | 451 | $coldisplay++; |
409 | 452 | } |
410 | - } |
|
411 | - else |
|
453 | + } else |
|
412 | 454 | { |
413 | - if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $coldisplay++; |
|
414 | - if (! empty($conf->global->DISPLAY_MARK_RATES)) $coldisplay++; |
|
455 | + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) { |
|
456 | + $coldisplay++; |
|
457 | + } |
|
458 | + if (! empty($conf->global->DISPLAY_MARK_RATES)) { |
|
459 | + $coldisplay++; |
|
460 | + } |
|
415 | 461 | } |
416 | 462 | } |
417 | 463 | ?> |
@@ -427,14 +473,18 @@ discard block |
||
427 | 473 | ?> |
428 | 474 | |
429 | 475 | <?php |
430 | -if ((! empty($conf->service->enabled) || ($object->element == 'contrat')) && $dateSelector && GETPOST('type') != '0') // We show date field if required |
|
476 | +if ((! empty($conf->service->enabled) || ($object->element == 'contrat')) && $dateSelector && GETPOST('type') != '0') { |
|
477 | + // We show date field if required |
|
431 | 478 | { |
432 | 479 | $colspan = 6; |
480 | +} |
|
433 | 481 | |
434 | - if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines |
|
482 | + if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') { |
|
483 | + // We must have same test in printObjectLines |
|
435 | 484 | { |
436 | 485 | $colspan++; |
437 | 486 | } |
487 | + } |
|
438 | 488 | if ($this->situation_cycle_ref) { |
439 | 489 | $colspan++; |
440 | 490 | } |
@@ -465,13 +515,22 @@ discard block |
||
465 | 515 | } |
466 | 516 | } |
467 | 517 | |
468 | - if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) $colspan+=2; |
|
518 | + if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { |
|
519 | + $colspan+=2; |
|
520 | + } |
|
469 | 521 | |
470 | 522 | if (! empty($usemargins)) |
471 | 523 | { |
472 | - if (!empty($user->rights->margins->creer)) $colspan++; // For the buying price |
|
473 | - if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; |
|
474 | - if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; |
|
524 | + if (!empty($user->rights->margins->creer)) { |
|
525 | + $colspan++; |
|
526 | + } |
|
527 | + // For the buying price |
|
528 | + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) { |
|
529 | + $colspan++; |
|
530 | + } |
|
531 | + if (! empty($conf->global->DISPLAY_MARK_RATES)) { |
|
532 | + $colspan++; |
|
533 | + } |
|
475 | 534 | } |
476 | 535 | ?> |
477 | 536 | |
@@ -487,8 +546,7 @@ discard block |
||
487 | 546 | print $form->selectDate($date_start,"date_start",$usehm,$usehm,1,"addproduct"); |
488 | 547 | print ' '.$langs->trans("DateEndPlanned").' '; |
489 | 548 | print $form->selectDate($date_end,"date_end",$usehm,$usehm,1,"addproduct"); |
490 | - } |
|
491 | - else |
|
549 | + } else |
|
492 | 550 | { |
493 | 551 | echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; |
494 | 552 | print $form->selectDate($date_start, 'date_start', empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1, empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1, 1, "addproduct", 1, 0); |
@@ -675,9 +733,15 @@ discard block |
||
675 | 733 | var defaultbuyprice = '<?php |
676 | 734 | if (isset($conf->global->MARGIN_TYPE)) |
677 | 735 | { |
678 | - if ($conf->global->MARGIN_TYPE == '1') print 'bestsupplierprice'; |
|
679 | - if ($conf->global->MARGIN_TYPE == 'pmp') print 'pmp'; |
|
680 | - if ($conf->global->MARGIN_TYPE == 'costprice') print 'costprice'; |
|
736 | + if ($conf->global->MARGIN_TYPE == '1') { |
|
737 | + print 'bestsupplierprice'; |
|
738 | + } |
|
739 | + if ($conf->global->MARGIN_TYPE == 'pmp') { |
|
740 | + print 'pmp'; |
|
741 | + } |
|
742 | + if ($conf->global->MARGIN_TYPE == 'costprice') { |
|
743 | + print 'costprice'; |
|
744 | + } |
|
681 | 745 | } ?>'; |
682 | 746 | console.log("we will set the field for margin. defaultbuyprice="+defaultbuyprice); |
683 | 747 |
@@ -20,8 +20,8 @@ |
||
20 | 20 | // Protection to avoid direct call of template |
21 | 21 | if (empty($blocname)) |
22 | 22 | { |
23 | - print "Error, template page can't be called as URL"; |
|
24 | - exit; |
|
23 | + print "Error, template page can't be called as URL"; |
|
24 | + exit; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | $hide = true; // Hide by default |
@@ -24,8 +24,8 @@ |
||
24 | 24 | exit; |
25 | 25 | } |
26 | 26 | |
27 | -$hide = true; // Hide by default |
|
28 | -if (isset($parameters['showblocbydefault'])) $hide=(empty($parameters['showblocbydefault']) ? true : false); |
|
27 | +$hide = true; // Hide by default |
|
28 | +if (isset($parameters['showblocbydefault'])) $hide = (empty($parameters['showblocbydefault']) ? true : false); |
|
29 | 29 | if (isset($object->extraparams[$blocname]['showhide'])) $hide = (empty($object->extraparams[$blocname]['showhide']) ? true : false); |
30 | 30 | |
31 | 31 | ?> |
@@ -25,8 +25,12 @@ |
||
25 | 25 | } |
26 | 26 | |
27 | 27 | $hide = true; // Hide by default |
28 | -if (isset($parameters['showblocbydefault'])) $hide=(empty($parameters['showblocbydefault']) ? true : false); |
|
29 | -if (isset($object->extraparams[$blocname]['showhide'])) $hide = (empty($object->extraparams[$blocname]['showhide']) ? true : false); |
|
28 | +if (isset($parameters['showblocbydefault'])) { |
|
29 | + $hide=(empty($parameters['showblocbydefault']) ? true : false); |
|
30 | +} |
|
31 | +if (isset($object->extraparams[$blocname]['showhide'])) { |
|
32 | + $hide = (empty($object->extraparams[$blocname]['showhide']) ? true : false); |
|
33 | +} |
|
30 | 34 | |
31 | 35 | ?> |
32 | 36 | <!-- BEGIN PHP TEMPLATE bloc_showhide.tpl.php --> |