@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | // Protection to avoid direct call of template |
| 25 | 25 | if (empty($object) || ! is_object($object)) |
| 26 | 26 | { |
| 27 | - print "Error, template page can't be called as URL"; |
|
| 28 | - exit; |
|
| 27 | + print "Error, template page can't be called as URL"; |
|
| 28 | + exit; |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | |
@@ -46,11 +46,11 @@ discard block |
||
| 46 | 46 | elseif ($module == 'project_task') { $permission=$user->rights->projet->creer; } |
| 47 | 47 | elseif (! isset($permission) && isset($user->rights->$module->creer)) |
| 48 | 48 | { |
| 49 | - $permission=$user->rights->$module->creer; |
|
| 49 | + $permission=$user->rights->$module->creer; |
|
| 50 | 50 | } |
| 51 | 51 | elseif (! isset($permission) && isset($user->rights->$module->write)) |
| 52 | 52 | { |
| 53 | - $permission=$user->rights->$module->write; |
|
| 53 | + $permission=$user->rights->$module->write; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | $formcompany= new FormCompany($db); |
@@ -79,10 +79,10 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | <?php |
| 81 | 81 | |
| 82 | - if (empty($hideaddcontactforuser)) |
|
| 83 | - { |
|
| 82 | + if (empty($hideaddcontactforuser)) |
|
| 83 | + { |
|
| 84 | 84 | |
| 85 | - ?> |
|
| 85 | + ?> |
|
| 86 | 86 | <form class="tagtr impair" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id; ?>" method="POST"> |
| 87 | 87 | <input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" /> |
| 88 | 88 | <input type="hidden" name="id" value="<?php echo $object->id; ?>" /> |
@@ -94,21 +94,21 @@ discard block |
||
| 94 | 94 | <div class="tagtd maxwidthonsmartphone"><?php echo $form->select_dolusers($user->id, 'userid', 0, (! empty($userAlreadySelected)?$userAlreadySelected:null), 0, null, null, 0, 56, '', 0, '', 'minwidth200imp'); ?></div> |
| 95 | 95 | <div class="tagtd maxwidthonsmartphone"> |
| 96 | 96 | <?php |
| 97 | - $tmpobject=$object; |
|
| 98 | - if (($object->element == 'shipping' || $object->element == 'reception') && is_object($objectsrc)) $tmpobject=$objectsrc; |
|
| 99 | - echo $formcompany->selectTypeContact($tmpobject, '', 'type','internal'); |
|
| 100 | - ?></div> |
|
| 97 | + $tmpobject=$object; |
|
| 98 | + if (($object->element == 'shipping' || $object->element == 'reception') && is_object($objectsrc)) $tmpobject=$objectsrc; |
|
| 99 | + echo $formcompany->selectTypeContact($tmpobject, '', 'type','internal'); |
|
| 100 | + ?></div> |
|
| 101 | 101 | <div class="tagtd"> </div> |
| 102 | 102 | <div class="tagtd center"><input type="submit" class="button" value="<?php echo $langs->trans("Add"); ?>"></div> |
| 103 | 103 | </form> |
| 104 | 104 | |
| 105 | 105 | <?php |
| 106 | - } |
|
| 106 | + } |
|
| 107 | 107 | |
| 108 | - if (empty($hideaddcontactforthirdparty)) |
|
| 109 | - { |
|
| 108 | + if (empty($hideaddcontactforthirdparty)) |
|
| 109 | + { |
|
| 110 | 110 | |
| 111 | - ?> |
|
| 111 | + ?> |
|
| 112 | 112 | |
| 113 | 113 | <form class="tagtr pair" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id; ?>" method="POST"> |
| 114 | 114 | <input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" /> |
@@ -120,12 +120,12 @@ discard block |
||
| 120 | 120 | <div class="tagtd nowrap maxwidthonsmartphone noborderbottom"> |
| 121 | 121 | <?php $selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$object->socid; ?> |
| 122 | 122 | <?php |
| 123 | - // add company icon before select list |
|
| 124 | - if ($selectedCompany) |
|
| 125 | - { |
|
| 126 | - echo img_object('', 'company', 'class="hideonsmartphone"'); |
|
| 127 | - } |
|
| 128 | - ?> |
|
| 123 | + // add company icon before select list |
|
| 124 | + if ($selectedCompany) |
|
| 125 | + { |
|
| 126 | + echo img_object('', 'company', 'class="hideonsmartphone"'); |
|
| 127 | + } |
|
| 128 | + ?> |
|
| 129 | 129 | <?php $selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', '', 0, '', 'minwidth300imp'); ?> |
| 130 | 130 | </div> |
| 131 | 131 | <div class="tagtd maxwidthonsmartphone noborderbottom"> |
@@ -133,9 +133,9 @@ discard block |
||
| 133 | 133 | </div> |
| 134 | 134 | <div class="tagtd maxwidthonsmartphone noborderbottom"> |
| 135 | 135 | <?php |
| 136 | - $tmpobject=$object; |
|
| 137 | - if (($object->element == 'shipping'|| $object->element == 'reception') && is_object($objectsrc)) $tmpobject=$objectsrc; |
|
| 138 | - $formcompany->selectTypeContact($tmpobject, '', 'type','external', 'position', 0, 'minwidth100imp'); ?> |
|
| 136 | + $tmpobject=$object; |
|
| 137 | + if (($object->element == 'shipping'|| $object->element == 'reception') && is_object($objectsrc)) $tmpobject=$objectsrc; |
|
| 138 | + $formcompany->selectTypeContact($tmpobject, '', 'type','external', 'position', 0, 'minwidth100imp'); ?> |
|
| 139 | 139 | </div> |
| 140 | 140 | <div class="tagtd noborderbottom"> </div> |
| 141 | 141 | <div class="tagtd center noborderbottom"> |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | </form> |
| 145 | 145 | |
| 146 | 146 | <?php |
| 147 | - } |
|
| 147 | + } |
|
| 148 | 148 | } |
| 149 | 149 | ?> |
| 150 | 150 | |
@@ -158,18 +158,18 @@ discard block |
||
| 158 | 158 | </form> |
| 159 | 159 | |
| 160 | 160 | <?php |
| 161 | - $arrayofsource=array('internal','external'); // Show both link to user and thirdparties contacts |
|
| 162 | - foreach($arrayofsource as $source) { |
|
| 161 | + $arrayofsource=array('internal','external'); // Show both link to user and thirdparties contacts |
|
| 162 | + foreach($arrayofsource as $source) { |
|
| 163 | 163 | |
| 164 | - $tmpobject=$object; |
|
| 165 | - if (($object->element == 'shipping'|| $object->element == 'reception') && is_object($objectsrc)) $tmpobject=$objectsrc; |
|
| 164 | + $tmpobject=$object; |
|
| 165 | + if (($object->element == 'shipping'|| $object->element == 'reception') && is_object($objectsrc)) $tmpobject=$objectsrc; |
|
| 166 | 166 | |
| 167 | - $tab = $tmpobject->liste_contact(-1,$source); |
|
| 168 | - $num=count($tab); |
|
| 167 | + $tab = $tmpobject->liste_contact(-1,$source); |
|
| 168 | + $num=count($tab); |
|
| 169 | 169 | |
| 170 | - $i = 0; |
|
| 171 | - while ($i < $num) { |
|
| 172 | - ?> |
|
| 170 | + $i = 0; |
|
| 171 | + while ($i < $num) { |
|
| 172 | + ?> |
|
| 173 | 173 | |
| 174 | 174 | <form class="tagtr oddeven"> |
| 175 | 175 | <div class="tagtd" align="left"> |
@@ -178,50 +178,50 @@ discard block |
||
| 178 | 178 | </div> |
| 179 | 179 | <div class="tagtd" align="left"> |
| 180 | 180 | <?php |
| 181 | - if ($tab[$i]['socid'] > 0) |
|
| 182 | - { |
|
| 183 | - $companystatic->fetch($tab[$i]['socid']); |
|
| 184 | - echo $companystatic->getNomUrl(1); |
|
| 185 | - } |
|
| 186 | - if ($tab[$i]['socid'] < 0) |
|
| 187 | - { |
|
| 188 | - echo $conf->global->MAIN_INFO_SOCIETE_NOM; |
|
| 189 | - } |
|
| 190 | - if (! $tab[$i]['socid']) |
|
| 191 | - { |
|
| 192 | - echo ' '; |
|
| 193 | - } |
|
| 194 | - ?> |
|
| 181 | + if ($tab[$i]['socid'] > 0) |
|
| 182 | + { |
|
| 183 | + $companystatic->fetch($tab[$i]['socid']); |
|
| 184 | + echo $companystatic->getNomUrl(1); |
|
| 185 | + } |
|
| 186 | + if ($tab[$i]['socid'] < 0) |
|
| 187 | + { |
|
| 188 | + echo $conf->global->MAIN_INFO_SOCIETE_NOM; |
|
| 189 | + } |
|
| 190 | + if (! $tab[$i]['socid']) |
|
| 191 | + { |
|
| 192 | + echo ' '; |
|
| 193 | + } |
|
| 194 | + ?> |
|
| 195 | 195 | </div> |
| 196 | 196 | <div class="tagtd"> |
| 197 | 197 | <?php |
| 198 | - $statusofcontact = $tab[$i]['status']; |
|
| 199 | - |
|
| 200 | - if ($tab[$i]['source']=='internal') |
|
| 201 | - { |
|
| 202 | - $userstatic->fetch($tab[$i]['id']); |
|
| 203 | - echo $userstatic->getNomUrl(-1, '', 0, 0, 0, 0, '', 'valignmiddle'); |
|
| 204 | - } |
|
| 205 | - if ($tab[$i]['source']=='external') |
|
| 206 | - { |
|
| 207 | - $contactstatic->fetch($tab[$i]['id']); |
|
| 208 | - echo $contactstatic->getNomUrl(1, '', 0, 0, 0, 0, '', 'valignmiddle'); |
|
| 209 | - } |
|
| 210 | - ?> |
|
| 198 | + $statusofcontact = $tab[$i]['status']; |
|
| 199 | + |
|
| 200 | + if ($tab[$i]['source']=='internal') |
|
| 201 | + { |
|
| 202 | + $userstatic->fetch($tab[$i]['id']); |
|
| 203 | + echo $userstatic->getNomUrl(-1, '', 0, 0, 0, 0, '', 'valignmiddle'); |
|
| 204 | + } |
|
| 205 | + if ($tab[$i]['source']=='external') |
|
| 206 | + { |
|
| 207 | + $contactstatic->fetch($tab[$i]['id']); |
|
| 208 | + echo $contactstatic->getNomUrl(1, '', 0, 0, 0, 0, '', 'valignmiddle'); |
|
| 209 | + } |
|
| 210 | + ?> |
|
| 211 | 211 | </div> |
| 212 | 212 | <div class="tagtd"><?php echo $tab[$i]['libelle']; ?></div> |
| 213 | 213 | <div class="tagtd center"> |
| 214 | 214 | <?php //if ($object->statut >= 0) echo '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=swapstatut&ligne='.$tab[$i]['rowid'].'">'; ?> |
| 215 | 215 | <?php |
| 216 | - if ($tab[$i]['source']=='internal') |
|
| 217 | - { |
|
| 218 | - echo $userstatic->LibStatut($tab[$i]['statuscontact'],3); |
|
| 219 | - } |
|
| 220 | - if ($tab[$i]['source']=='external') |
|
| 221 | - { |
|
| 222 | - echo $contactstatic->LibStatut($tab[$i]['statuscontact'],3); |
|
| 223 | - } |
|
| 224 | - ?> |
|
| 216 | + if ($tab[$i]['source']=='internal') |
|
| 217 | + { |
|
| 218 | + echo $userstatic->LibStatut($tab[$i]['statuscontact'],3); |
|
| 219 | + } |
|
| 220 | + if ($tab[$i]['source']=='external') |
|
| 221 | + { |
|
| 222 | + echo $contactstatic->LibStatut($tab[$i]['statuscontact'],3); |
|
| 223 | + } |
|
| 224 | + ?> |
|
| 225 | 225 | <?php //if ($object->statut >= 0) echo '</a>'; ?> |
| 226 | 226 | </div> |
| 227 | 227 | <div class="tagtd nowrap right"> |
@@ -238,11 +238,11 @@ discard block |
||
| 238 | 238 | </div> |
| 239 | 239 | <!-- TEMPLATE CONTACTS HOOK BEGIN HERE --> |
| 240 | 240 | <?php |
| 241 | - if (is_object($hookmanager)) |
|
| 242 | - { |
|
| 243 | - $hookmanager->initHooks(array('contacttpl')); |
|
| 244 | - $parameters=array(); |
|
| 245 | - $reshook=$hookmanager->executeHooks('formContactTpl',$parameters,$object,$action); |
|
| 246 | - } |
|
| 241 | + if (is_object($hookmanager)) |
|
| 242 | + { |
|
| 243 | + $hookmanager->initHooks(array('contacttpl')); |
|
| 244 | + $parameters=array(); |
|
| 245 | + $reshook=$hookmanager->executeHooks('formContactTpl',$parameters,$object,$action); |
|
| 246 | + } |
|
| 247 | 247 | ?> |
| 248 | 248 | <!-- END PHP TEMPLATE CONTACTS --> |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | |
| 24 | 24 | // Protection to avoid direct call of template |
| 25 | -if (empty($object) || ! is_object($object)) |
|
| 25 | +if (empty($object) || !is_object($object)) |
|
| 26 | 26 | { |
| 27 | 27 | print "Error, template page can't be called as URL"; |
| 28 | 28 | exit; |
@@ -35,28 +35,28 @@ discard block |
||
| 35 | 35 | $module = $object->element; |
| 36 | 36 | |
| 37 | 37 | // Special cases |
| 38 | -if ($module == 'propal') { $permission=$user->rights->propale->creer; } |
|
| 39 | -elseif ($module == 'fichinter') { $permission=$user->rights->ficheinter->creer; } |
|
| 40 | -elseif ($module == 'order_supplier') { $permission=$user->rights->fournisseur->commande->creer; } |
|
| 41 | -elseif ($module == 'invoice_supplier') { $permission=$user->rights->fournisseur->facture->creer; } |
|
| 42 | -elseif ($module == 'project') { $permission=$user->rights->projet->creer; } |
|
| 43 | -elseif ($module == 'action') { $permission=$user->rights->agenda->myactions->create; } |
|
| 44 | -elseif ($module == 'shipping') { $permission=$user->rights->expedition->creer; } |
|
| 45 | -elseif ($module == 'reception') { $permission=$user->rights->reception->creer; } |
|
| 46 | -elseif ($module == 'project_task') { $permission=$user->rights->projet->creer; } |
|
| 47 | -elseif (! isset($permission) && isset($user->rights->$module->creer)) |
|
| 38 | +if ($module == 'propal') { $permission = $user->rights->propale->creer; } |
|
| 39 | +elseif ($module == 'fichinter') { $permission = $user->rights->ficheinter->creer; } |
|
| 40 | +elseif ($module == 'order_supplier') { $permission = $user->rights->fournisseur->commande->creer; } |
|
| 41 | +elseif ($module == 'invoice_supplier') { $permission = $user->rights->fournisseur->facture->creer; } |
|
| 42 | +elseif ($module == 'project') { $permission = $user->rights->projet->creer; } |
|
| 43 | +elseif ($module == 'action') { $permission = $user->rights->agenda->myactions->create; } |
|
| 44 | +elseif ($module == 'shipping') { $permission = $user->rights->expedition->creer; } |
|
| 45 | +elseif ($module == 'reception') { $permission = $user->rights->reception->creer; } |
|
| 46 | +elseif ($module == 'project_task') { $permission = $user->rights->projet->creer; } |
|
| 47 | +elseif (!isset($permission) && isset($user->rights->$module->creer)) |
|
| 48 | 48 | { |
| 49 | - $permission=$user->rights->$module->creer; |
|
| 49 | + $permission = $user->rights->$module->creer; |
|
| 50 | 50 | } |
| 51 | -elseif (! isset($permission) && isset($user->rights->$module->write)) |
|
| 51 | +elseif (!isset($permission) && isset($user->rights->$module->write)) |
|
| 52 | 52 | { |
| 53 | - $permission=$user->rights->$module->write; |
|
| 53 | + $permission = $user->rights->$module->write; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | -$formcompany= new FormCompany($db); |
|
| 57 | -$companystatic=new Societe($db); |
|
| 58 | -$contactstatic=new Contact($db); |
|
| 59 | -$userstatic=new User($db); |
|
| 56 | +$formcompany = new FormCompany($db); |
|
| 57 | +$companystatic = new Societe($db); |
|
| 58 | +$contactstatic = new Contact($db); |
|
| 59 | +$userstatic = new User($db); |
|
| 60 | 60 | |
| 61 | 61 | ?> |
| 62 | 62 | |
@@ -89,14 +89,14 @@ discard block |
||
| 89 | 89 | <input type="hidden" name="action" value="addcontact" /> |
| 90 | 90 | <input type="hidden" name="source" value="internal" /> |
| 91 | 91 | <?php if ($withproject) print '<input type="hidden" name="withproject" value="'.$withproject.'">'; ?> |
| 92 | - <div class="nowrap tagtd"><?php echo img_object('','user').' '.$langs->trans("Users"); ?></div> |
|
| 92 | + <div class="nowrap tagtd"><?php echo img_object('', 'user').' '.$langs->trans("Users"); ?></div> |
|
| 93 | 93 | <div class="tagtd"><?php echo $conf->global->MAIN_INFO_SOCIETE_NOM; ?></div> |
| 94 | - <div class="tagtd maxwidthonsmartphone"><?php echo $form->select_dolusers($user->id, 'userid', 0, (! empty($userAlreadySelected)?$userAlreadySelected:null), 0, null, null, 0, 56, '', 0, '', 'minwidth200imp'); ?></div> |
|
| 94 | + <div class="tagtd maxwidthonsmartphone"><?php echo $form->select_dolusers($user->id, 'userid', 0, (!empty($userAlreadySelected) ? $userAlreadySelected : null), 0, null, null, 0, 56, '', 0, '', 'minwidth200imp'); ?></div> |
|
| 95 | 95 | <div class="tagtd maxwidthonsmartphone"> |
| 96 | 96 | <?php |
| 97 | - $tmpobject=$object; |
|
| 98 | - if (($object->element == 'shipping' || $object->element == 'reception') && is_object($objectsrc)) $tmpobject=$objectsrc; |
|
| 99 | - echo $formcompany->selectTypeContact($tmpobject, '', 'type','internal'); |
|
| 97 | + $tmpobject = $object; |
|
| 98 | + if (($object->element == 'shipping' || $object->element == 'reception') && is_object($objectsrc)) $tmpobject = $objectsrc; |
|
| 99 | + echo $formcompany->selectTypeContact($tmpobject, '', 'type', 'internal'); |
|
| 100 | 100 | ?></div> |
| 101 | 101 | <div class="tagtd"> </div> |
| 102 | 102 | <div class="tagtd center"><input type="submit" class="button" value="<?php echo $langs->trans("Add"); ?>"></div> |
@@ -116,9 +116,9 @@ discard block |
||
| 116 | 116 | <input type="hidden" name="action" value="addcontact" /> |
| 117 | 117 | <input type="hidden" name="source" value="external" /> |
| 118 | 118 | <?php if ($withproject) print '<input type="hidden" name="withproject" value="'.$withproject.'">'; ?> |
| 119 | - <div class="tagtd nowrap noborderbottom"><?php echo img_object('','contact').' '.$langs->trans("ThirdPartyContacts"); ?></div> |
|
| 119 | + <div class="tagtd nowrap noborderbottom"><?php echo img_object('', 'contact').' '.$langs->trans("ThirdPartyContacts"); ?></div> |
|
| 120 | 120 | <div class="tagtd nowrap maxwidthonsmartphone noborderbottom"> |
| 121 | - <?php $selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$object->socid; ?> |
|
| 121 | + <?php $selectedCompany = isset($_GET["newcompany"]) ? $_GET["newcompany"] : $object->socid; ?> |
|
| 122 | 122 | <?php |
| 123 | 123 | // add company icon before select list |
| 124 | 124 | if ($selectedCompany) |
@@ -129,17 +129,17 @@ discard block |
||
| 129 | 129 | <?php $selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', '', 0, '', 'minwidth300imp'); ?> |
| 130 | 130 | </div> |
| 131 | 131 | <div class="tagtd maxwidthonsmartphone noborderbottom"> |
| 132 | - <?php $nbofcontacts=$form->select_contacts(($selectedCompany > 0 ? $selectedCompany : -1), '', 'contactid', 3, '', '', 0, 'minwidth100imp'); ?> |
|
| 132 | + <?php $nbofcontacts = $form->select_contacts(($selectedCompany > 0 ? $selectedCompany : -1), '', 'contactid', 3, '', '', 0, 'minwidth100imp'); ?> |
|
| 133 | 133 | </div> |
| 134 | 134 | <div class="tagtd maxwidthonsmartphone noborderbottom"> |
| 135 | 135 | <?php |
| 136 | - $tmpobject=$object; |
|
| 137 | - if (($object->element == 'shipping'|| $object->element == 'reception') && is_object($objectsrc)) $tmpobject=$objectsrc; |
|
| 138 | - $formcompany->selectTypeContact($tmpobject, '', 'type','external', 'position', 0, 'minwidth100imp'); ?> |
|
| 136 | + $tmpobject = $object; |
|
| 137 | + if (($object->element == 'shipping' || $object->element == 'reception') && is_object($objectsrc)) $tmpobject = $objectsrc; |
|
| 138 | + $formcompany->selectTypeContact($tmpobject, '', 'type', 'external', 'position', 0, 'minwidth100imp'); ?> |
|
| 139 | 139 | </div> |
| 140 | 140 | <div class="tagtd noborderbottom"> </div> |
| 141 | 141 | <div class="tagtd center noborderbottom"> |
| 142 | - <input type="submit" id="add-customer-contact" class="button" value="<?php echo $langs->trans("Add"); ?>"<?php if (! $nbofcontacts) echo ' disabled'; ?>> |
|
| 142 | + <input type="submit" id="add-customer-contact" class="button" value="<?php echo $langs->trans("Add"); ?>"<?php if (!$nbofcontacts) echo ' disabled'; ?>> |
|
| 143 | 143 | </div> |
| 144 | 144 | </form> |
| 145 | 145 | |
@@ -158,14 +158,14 @@ discard block |
||
| 158 | 158 | </form> |
| 159 | 159 | |
| 160 | 160 | <?php |
| 161 | - $arrayofsource=array('internal','external'); // Show both link to user and thirdparties contacts |
|
| 162 | - foreach($arrayofsource as $source) { |
|
| 161 | + $arrayofsource = array('internal', 'external'); // Show both link to user and thirdparties contacts |
|
| 162 | + foreach ($arrayofsource as $source) { |
|
| 163 | 163 | |
| 164 | - $tmpobject=$object; |
|
| 165 | - if (($object->element == 'shipping'|| $object->element == 'reception') && is_object($objectsrc)) $tmpobject=$objectsrc; |
|
| 164 | + $tmpobject = $object; |
|
| 165 | + if (($object->element == 'shipping' || $object->element == 'reception') && is_object($objectsrc)) $tmpobject = $objectsrc; |
|
| 166 | 166 | |
| 167 | - $tab = $tmpobject->liste_contact(-1,$source); |
|
| 168 | - $num=count($tab); |
|
| 167 | + $tab = $tmpobject->liste_contact(-1, $source); |
|
| 168 | + $num = count($tab); |
|
| 169 | 169 | |
| 170 | 170 | $i = 0; |
| 171 | 171 | while ($i < $num) { |
@@ -173,8 +173,8 @@ discard block |
||
| 173 | 173 | |
| 174 | 174 | <form class="tagtr oddeven"> |
| 175 | 175 | <div class="tagtd" align="left"> |
| 176 | - <?php if ($tab[$i]['source']=='internal') echo $langs->trans("User"); ?> |
|
| 177 | - <?php if ($tab[$i]['source']=='external') echo $langs->trans("ThirdPartyContact"); ?> |
|
| 176 | + <?php if ($tab[$i]['source'] == 'internal') echo $langs->trans("User"); ?> |
|
| 177 | + <?php if ($tab[$i]['source'] == 'external') echo $langs->trans("ThirdPartyContact"); ?> |
|
| 178 | 178 | </div> |
| 179 | 179 | <div class="tagtd" align="left"> |
| 180 | 180 | <?php |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | { |
| 188 | 188 | echo $conf->global->MAIN_INFO_SOCIETE_NOM; |
| 189 | 189 | } |
| 190 | - if (! $tab[$i]['socid']) |
|
| 190 | + if (!$tab[$i]['socid']) |
|
| 191 | 191 | { |
| 192 | 192 | echo ' '; |
| 193 | 193 | } |
@@ -197,12 +197,12 @@ discard block |
||
| 197 | 197 | <?php |
| 198 | 198 | $statusofcontact = $tab[$i]['status']; |
| 199 | 199 | |
| 200 | - if ($tab[$i]['source']=='internal') |
|
| 200 | + if ($tab[$i]['source'] == 'internal') |
|
| 201 | 201 | { |
| 202 | 202 | $userstatic->fetch($tab[$i]['id']); |
| 203 | 203 | echo $userstatic->getNomUrl(-1, '', 0, 0, 0, 0, '', 'valignmiddle'); |
| 204 | 204 | } |
| 205 | - if ($tab[$i]['source']=='external') |
|
| 205 | + if ($tab[$i]['source'] == 'external') |
|
| 206 | 206 | { |
| 207 | 207 | $contactstatic->fetch($tab[$i]['id']); |
| 208 | 208 | echo $contactstatic->getNomUrl(1, '', 0, 0, 0, 0, '', 'valignmiddle'); |
@@ -213,13 +213,13 @@ discard block |
||
| 213 | 213 | <div class="tagtd center"> |
| 214 | 214 | <?php //if ($object->statut >= 0) echo '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=swapstatut&ligne='.$tab[$i]['rowid'].'">'; ?> |
| 215 | 215 | <?php |
| 216 | - if ($tab[$i]['source']=='internal') |
|
| 216 | + if ($tab[$i]['source'] == 'internal') |
|
| 217 | 217 | { |
| 218 | - echo $userstatic->LibStatut($tab[$i]['statuscontact'],3); |
|
| 218 | + echo $userstatic->LibStatut($tab[$i]['statuscontact'], 3); |
|
| 219 | 219 | } |
| 220 | - if ($tab[$i]['source']=='external') |
|
| 220 | + if ($tab[$i]['source'] == 'external') |
|
| 221 | 221 | { |
| 222 | - echo $contactstatic->LibStatut($tab[$i]['statuscontact'],3); |
|
| 222 | + echo $contactstatic->LibStatut($tab[$i]['statuscontact'], 3); |
|
| 223 | 223 | } |
| 224 | 224 | ?> |
| 225 | 225 | <?php //if ($object->statut >= 0) echo '</a>'; ?> |
@@ -241,8 +241,8 @@ discard block |
||
| 241 | 241 | if (is_object($hookmanager)) |
| 242 | 242 | { |
| 243 | 243 | $hookmanager->initHooks(array('contacttpl')); |
| 244 | - $parameters=array(); |
|
| 245 | - $reshook=$hookmanager->executeHooks('formContactTpl',$parameters,$object,$action); |
|
| 244 | + $parameters = array(); |
|
| 245 | + $reshook = $hookmanager->executeHooks('formContactTpl', $parameters, $object, $action); |
|
| 246 | 246 | } |
| 247 | 247 | ?> |
| 248 | 248 | <!-- END PHP TEMPLATE CONTACTS --> |
@@ -35,20 +35,10 @@ discard block |
||
| 35 | 35 | $module = $object->element; |
| 36 | 36 | |
| 37 | 37 | // Special cases |
| 38 | -if ($module == 'propal') { $permission=$user->rights->propale->creer; } |
|
| 39 | -elseif ($module == 'fichinter') { $permission=$user->rights->ficheinter->creer; } |
|
| 40 | -elseif ($module == 'order_supplier') { $permission=$user->rights->fournisseur->commande->creer; } |
|
| 41 | -elseif ($module == 'invoice_supplier') { $permission=$user->rights->fournisseur->facture->creer; } |
|
| 42 | -elseif ($module == 'project') { $permission=$user->rights->projet->creer; } |
|
| 43 | -elseif ($module == 'action') { $permission=$user->rights->agenda->myactions->create; } |
|
| 44 | -elseif ($module == 'shipping') { $permission=$user->rights->expedition->creer; } |
|
| 45 | -elseif ($module == 'reception') { $permission=$user->rights->reception->creer; } |
|
| 46 | -elseif ($module == 'project_task') { $permission=$user->rights->projet->creer; } |
|
| 47 | -elseif (! isset($permission) && isset($user->rights->$module->creer)) |
|
| 38 | +if ($module == 'propal') { $permission=$user->rights->propale->creer; } elseif ($module == 'fichinter') { $permission=$user->rights->ficheinter->creer; } elseif ($module == 'order_supplier') { $permission=$user->rights->fournisseur->commande->creer; } elseif ($module == 'invoice_supplier') { $permission=$user->rights->fournisseur->facture->creer; } elseif ($module == 'project') { $permission=$user->rights->projet->creer; } elseif ($module == 'action') { $permission=$user->rights->agenda->myactions->create; } elseif ($module == 'shipping') { $permission=$user->rights->expedition->creer; } elseif ($module == 'reception') { $permission=$user->rights->reception->creer; } elseif ($module == 'project_task') { $permission=$user->rights->projet->creer; } elseif (! isset($permission) && isset($user->rights->$module->creer)) |
|
| 48 | 39 | { |
| 49 | 40 | $permission=$user->rights->$module->creer; |
| 50 | -} |
|
| 51 | -elseif (! isset($permission) && isset($user->rights->$module->write)) |
|
| 41 | +} elseif (! isset($permission) && isset($user->rights->$module->write)) |
|
| 52 | 42 | { |
| 53 | 43 | $permission=$user->rights->$module->write; |
| 54 | 44 | } |
@@ -88,14 +78,19 @@ discard block |
||
| 88 | 78 | <input type="hidden" name="id" value="<?php echo $object->id; ?>" /> |
| 89 | 79 | <input type="hidden" name="action" value="addcontact" /> |
| 90 | 80 | <input type="hidden" name="source" value="internal" /> |
| 91 | - <?php if ($withproject) print '<input type="hidden" name="withproject" value="'.$withproject.'">'; ?> |
|
| 81 | + <?php if ($withproject) { |
|
| 82 | + print '<input type="hidden" name="withproject" value="'.$withproject.'">'; |
|
| 83 | +} |
|
| 84 | +?> |
|
| 92 | 85 | <div class="nowrap tagtd"><?php echo img_object('','user').' '.$langs->trans("Users"); ?></div> |
| 93 | 86 | <div class="tagtd"><?php echo $conf->global->MAIN_INFO_SOCIETE_NOM; ?></div> |
| 94 | 87 | <div class="tagtd maxwidthonsmartphone"><?php echo $form->select_dolusers($user->id, 'userid', 0, (! empty($userAlreadySelected)?$userAlreadySelected:null), 0, null, null, 0, 56, '', 0, '', 'minwidth200imp'); ?></div> |
| 95 | 88 | <div class="tagtd maxwidthonsmartphone"> |
| 96 | 89 | <?php |
| 97 | 90 | $tmpobject=$object; |
| 98 | - if (($object->element == 'shipping' || $object->element == 'reception') && is_object($objectsrc)) $tmpobject=$objectsrc; |
|
| 91 | + if (($object->element == 'shipping' || $object->element == 'reception') && is_object($objectsrc)) { |
|
| 92 | + $tmpobject=$objectsrc; |
|
| 93 | + } |
|
| 99 | 94 | echo $formcompany->selectTypeContact($tmpobject, '', 'type','internal'); |
| 100 | 95 | ?></div> |
| 101 | 96 | <div class="tagtd"> </div> |
@@ -115,7 +110,10 @@ discard block |
||
| 115 | 110 | <input type="hidden" name="id" value="<?php echo $object->id; ?>" /> |
| 116 | 111 | <input type="hidden" name="action" value="addcontact" /> |
| 117 | 112 | <input type="hidden" name="source" value="external" /> |
| 118 | - <?php if ($withproject) print '<input type="hidden" name="withproject" value="'.$withproject.'">'; ?> |
|
| 113 | + <?php if ($withproject) { |
|
| 114 | + print '<input type="hidden" name="withproject" value="'.$withproject.'">'; |
|
| 115 | +} |
|
| 116 | +?> |
|
| 119 | 117 | <div class="tagtd nowrap noborderbottom"><?php echo img_object('','contact').' '.$langs->trans("ThirdPartyContacts"); ?></div> |
| 120 | 118 | <div class="tagtd nowrap maxwidthonsmartphone noborderbottom"> |
| 121 | 119 | <?php $selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$object->socid; ?> |
@@ -134,12 +132,17 @@ discard block |
||
| 134 | 132 | <div class="tagtd maxwidthonsmartphone noborderbottom"> |
| 135 | 133 | <?php |
| 136 | 134 | $tmpobject=$object; |
| 137 | - if (($object->element == 'shipping'|| $object->element == 'reception') && is_object($objectsrc)) $tmpobject=$objectsrc; |
|
| 135 | + if (($object->element == 'shipping'|| $object->element == 'reception') && is_object($objectsrc)) { |
|
| 136 | + $tmpobject=$objectsrc; |
|
| 137 | + } |
|
| 138 | 138 | $formcompany->selectTypeContact($tmpobject, '', 'type','external', 'position', 0, 'minwidth100imp'); ?> |
| 139 | 139 | </div> |
| 140 | 140 | <div class="tagtd noborderbottom"> </div> |
| 141 | 141 | <div class="tagtd center noborderbottom"> |
| 142 | - <input type="submit" id="add-customer-contact" class="button" value="<?php echo $langs->trans("Add"); ?>"<?php if (! $nbofcontacts) echo ' disabled'; ?>> |
|
| 142 | + <input type="submit" id="add-customer-contact" class="button" value="<?php echo $langs->trans("Add"); ?>"<?php if (! $nbofcontacts) { |
|
| 143 | + echo ' disabled'; |
|
| 144 | +} |
|
| 145 | +?>> |
|
| 143 | 146 | </div> |
| 144 | 147 | </form> |
| 145 | 148 | |
@@ -162,7 +165,9 @@ discard block |
||
| 162 | 165 | foreach($arrayofsource as $source) { |
| 163 | 166 | |
| 164 | 167 | $tmpobject=$object; |
| 165 | - if (($object->element == 'shipping'|| $object->element == 'reception') && is_object($objectsrc)) $tmpobject=$objectsrc; |
|
| 168 | + if (($object->element == 'shipping'|| $object->element == 'reception') && is_object($objectsrc)) { |
|
| 169 | + $tmpobject=$objectsrc; |
|
| 170 | + } |
|
| 166 | 171 | |
| 167 | 172 | $tab = $tmpobject->liste_contact(-1,$source); |
| 168 | 173 | $num=count($tab); |
@@ -173,8 +178,14 @@ discard block |
||
| 173 | 178 | |
| 174 | 179 | <form class="tagtr oddeven"> |
| 175 | 180 | <div class="tagtd" align="left"> |
| 176 | - <?php if ($tab[$i]['source']=='internal') echo $langs->trans("User"); ?> |
|
| 177 | - <?php if ($tab[$i]['source']=='external') echo $langs->trans("ThirdPartyContact"); ?> |
|
| 181 | + <?php if ($tab[$i]['source']=='internal') { |
|
| 182 | + echo $langs->trans("User"); |
|
| 183 | +} |
|
| 184 | +?> |
|
| 185 | + <?php if ($tab[$i]['source']=='external') { |
|
| 186 | + echo $langs->trans("ThirdPartyContact"); |
|
| 187 | +} |
|
| 188 | +?> |
|
| 178 | 189 | </div> |
| 179 | 190 | <div class="tagtd" align="left"> |
| 180 | 191 | <?php |
@@ -29,203 +29,203 @@ |
||
| 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 | |
| 37 | 37 | if ($action == 'presend') |
| 38 | 38 | { |
| 39 | - $langs->load("mails"); |
|
| 40 | - |
|
| 41 | - $titreform='SendMail'; |
|
| 42 | - |
|
| 43 | - $object->fetch_projet(); |
|
| 44 | - |
|
| 45 | - if (! in_array($object->element, array('societe', 'user', 'member'))) |
|
| 46 | - { |
|
| 47 | - // TODO get also the main_lastdoc field of $object. If not found, try to guess with following code |
|
| 48 | - |
|
| 49 | - $ref = dol_sanitizeFileName($object->ref); |
|
| 50 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
| 51 | - $fileparams = dol_most_recent_file($diroutput . '/' . $ref, preg_quote($ref, '/').'[^\-]+'); |
|
| 52 | - // |
|
| 53 | - if ($object->element == 'invoice_supplier') |
|
| 54 | - { |
|
| 55 | - $fileparams = dol_most_recent_file($diroutput . '/' . get_exdir($object->id,2,0,0,$object,$object->element).$ref, preg_quote($ref,'/').'([^\-])+'); |
|
| 56 | - } |
|
| 57 | - |
|
| 58 | - $file = $fileparams['fullname']; |
|
| 59 | - } |
|
| 60 | - |
|
| 61 | - // Define output language |
|
| 62 | - $outputlangs = $langs; |
|
| 63 | - $newlang = ''; |
|
| 64 | - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) |
|
| 65 | - { |
|
| 66 | - $newlang = $_REQUEST['lang_id']; |
|
| 67 | - } |
|
| 68 | - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) |
|
| 69 | - { |
|
| 70 | - $newlang = $object->thirdparty->default_lang; |
|
| 71 | - } |
|
| 72 | - |
|
| 73 | - if (!empty($newlang)) |
|
| 74 | - { |
|
| 75 | - $outputlangs = new Translate('', $conf); |
|
| 76 | - $outputlangs->setDefaultLang($newlang); |
|
| 77 | - // Load traductions files requiredby by page |
|
| 78 | - $outputlangs->loadLangs(array('commercial','bills','orders','contracts','members','propal','products','supplier_proposal','interventions')); |
|
| 79 | - } |
|
| 80 | - |
|
| 81 | - $topicmail=''; |
|
| 82 | - if (empty($object->ref_client)) { |
|
| 83 | - $topicmail = $outputlangs->trans($defaulttopic, '__REF__'); |
|
| 84 | - } else if (! empty($object->ref_client)) { |
|
| 85 | - $topicmail = $outputlangs->trans($defaulttopic, '__REF__ (__REFCLIENT__)'); |
|
| 86 | - } |
|
| 87 | - |
|
| 88 | - // Build document if it not exists |
|
| 89 | - if (! in_array($object->element, array('societe', 'user', 'member'))) |
|
| 90 | - { |
|
| 91 | - if ((! $file || ! is_readable($file)) && method_exists($object, 'generateDocument')) |
|
| 92 | - { |
|
| 93 | - $result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); |
|
| 94 | - if ($result <= 0) { |
|
| 95 | - dol_print_error($db, $object->error, $object->errors); |
|
| 96 | - exit(); |
|
| 97 | - } |
|
| 98 | - $fileparams = dol_most_recent_file($diroutput . '/' . $ref, preg_quote($ref, '/').'[^\-]+'); |
|
| 99 | - $file = $fileparams['fullname']; |
|
| 100 | - } |
|
| 101 | - } |
|
| 102 | - |
|
| 103 | - print '<div id="formmailbeforetitle" name="formmailbeforetitle"></div>'; |
|
| 104 | - print '<div class="clearboth"></div>'; |
|
| 105 | - print '<br>'; |
|
| 106 | - print load_fiche_titre($langs->trans($titreform)); |
|
| 107 | - |
|
| 108 | - dol_fiche_head(''); |
|
| 109 | - |
|
| 110 | - // Create form for email |
|
| 111 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
| 112 | - $formmail = new FormMail($db); |
|
| 113 | - |
|
| 114 | - $formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang); |
|
| 115 | - $formmail->fromtype = (GETPOST('fromtype')?GETPOST('fromtype'):(!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)?$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE:'user')); |
|
| 116 | - |
|
| 117 | - if ($formmail->fromtype === 'user') |
|
| 118 | - { |
|
| 119 | - $formmail->fromid = $user->id; |
|
| 120 | - } |
|
| 121 | - $formmail->trackid=$trackid; |
|
| 122 | - if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set |
|
| 123 | - { |
|
| 124 | - include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
|
| 125 | - $formmail->frommail=dolAddEmailTrackId($formmail->frommail, $trackid); |
|
| 126 | - } |
|
| 127 | - $formmail->withfrom = 1; |
|
| 128 | - |
|
| 129 | - // Fill list of recipient with email inside <>. |
|
| 130 | - $liste = array(); |
|
| 131 | - if ($object->element == 'expensereport') |
|
| 132 | - { |
|
| 133 | - $fuser = new User($db); |
|
| 134 | - $fuser->fetch($object->fk_user_author); |
|
| 135 | - $liste['thirdparty'] = $fuser->getFullName($langs)." <".$fuser->email.">"; |
|
| 136 | - } |
|
| 137 | - elseif ($object->element == 'societe') |
|
| 138 | - { |
|
| 139 | - foreach ($object->thirdparty_and_contact_email_array(1) as $key => $value) { |
|
| 140 | - $liste[$key] = $value; |
|
| 141 | - } |
|
| 142 | - } |
|
| 143 | - elseif ($object->element == 'contact') |
|
| 144 | - { |
|
| 145 | - $liste['contact'] = $object->getFullName($langs)." <".$object->email.">"; |
|
| 146 | - } |
|
| 147 | - elseif ($object->element == 'user' || $object->element == 'member') |
|
| 148 | - { |
|
| 149 | - $liste['thirdparty'] = $object->getFullName($langs)." <".$object->email.">"; |
|
| 150 | - } |
|
| 151 | - else |
|
| 152 | - { |
|
| 153 | - if (is_object($object->thirdparty)) |
|
| 154 | - { |
|
| 155 | - foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key => $value) { |
|
| 156 | - $liste[$key] = $value; |
|
| 157 | - } |
|
| 158 | - } |
|
| 159 | - } |
|
| 160 | - if (!empty($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT)) { |
|
| 161 | - $listeuser=array(); |
|
| 162 | - $fuserdest = new User($db); |
|
| 163 | - |
|
| 164 | - $result= $fuserdest->fetchAll('ASC', 't.lastname', 0, 0, array('customsql'=>'t.statut=1 AND t.employee=1 AND t.email IS NOT NULL AND t.email<>\'\'')); |
|
| 165 | - if ($result>0 && is_array($fuserdest->users) && count($fuserdest->users)>0) { |
|
| 166 | - foreach($fuserdest->users as $uuserdest) { |
|
| 167 | - $listeuser[$uuserdest->id] = $uuserdest->user_get_property($uuserdest->id,'email'); |
|
| 168 | - } |
|
| 169 | - } elseif ($result<0) { |
|
| 170 | - setEventMessages(null, $fuserdest->errors,'errors'); |
|
| 171 | - } |
|
| 172 | - if (count($listeuser)>0) { |
|
| 173 | - $formmail->withtouser = $listeuser; |
|
| 174 | - $formmail->withtoccuser = $listeuser; |
|
| 175 | - } |
|
| 176 | - } |
|
| 177 | - |
|
| 178 | - $formmail->withto = GETPOST('sendto') ? GETPOST('sendto') : $liste; |
|
| 179 | - $formmail->withtocc = $liste; |
|
| 180 | - $formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC; |
|
| 181 | - $formmail->withtopic = $topicmail; |
|
| 182 | - $formmail->withfile = 2; |
|
| 183 | - $formmail->withbody = 1; |
|
| 184 | - $formmail->withdeliveryreceipt = 1; |
|
| 185 | - $formmail->withcancel = 1; |
|
| 186 | - |
|
| 187 | - //$arrayoffamiliestoexclude=array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...); |
|
| 188 | - if (! isset($arrayoffamiliestoexclude)) $arrayoffamiliestoexclude=null; |
|
| 189 | - |
|
| 190 | - // Make substitution in email content |
|
| 191 | - $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object); |
|
| 192 | - $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"/>' : ''; |
|
| 193 | - $substitutionarray['__PERSONALIZED__'] = ''; // deprecated |
|
| 194 | - $substitutionarray['__CONTACTCIVNAME__'] = ''; |
|
| 195 | - $parameters = array( |
|
| 196 | - 'mode' => 'formemail' |
|
| 197 | - ); |
|
| 198 | - complete_substitutions_array($substitutionarray, $outputlangs, $object, $parameters); |
|
| 199 | - |
|
| 200 | - // Find the good contact adress |
|
| 201 | - $custcontact = ''; |
|
| 202 | - $contactarr = array(); |
|
| 203 | - $contactarr = $object->liste_contact(- 1, 'external'); |
|
| 204 | - |
|
| 205 | - if (is_array($contactarr) && count($contactarr) > 0) { |
|
| 206 | - require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
| 39 | + $langs->load("mails"); |
|
| 40 | + |
|
| 41 | + $titreform='SendMail'; |
|
| 42 | + |
|
| 43 | + $object->fetch_projet(); |
|
| 44 | + |
|
| 45 | + if (! in_array($object->element, array('societe', 'user', 'member'))) |
|
| 46 | + { |
|
| 47 | + // TODO get also the main_lastdoc field of $object. If not found, try to guess with following code |
|
| 48 | + |
|
| 49 | + $ref = dol_sanitizeFileName($object->ref); |
|
| 50 | + include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
| 51 | + $fileparams = dol_most_recent_file($diroutput . '/' . $ref, preg_quote($ref, '/').'[^\-]+'); |
|
| 52 | + // |
|
| 53 | + if ($object->element == 'invoice_supplier') |
|
| 54 | + { |
|
| 55 | + $fileparams = dol_most_recent_file($diroutput . '/' . get_exdir($object->id,2,0,0,$object,$object->element).$ref, preg_quote($ref,'/').'([^\-])+'); |
|
| 56 | + } |
|
| 57 | + |
|
| 58 | + $file = $fileparams['fullname']; |
|
| 59 | + } |
|
| 60 | + |
|
| 61 | + // Define output language |
|
| 62 | + $outputlangs = $langs; |
|
| 63 | + $newlang = ''; |
|
| 64 | + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) |
|
| 65 | + { |
|
| 66 | + $newlang = $_REQUEST['lang_id']; |
|
| 67 | + } |
|
| 68 | + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) |
|
| 69 | + { |
|
| 70 | + $newlang = $object->thirdparty->default_lang; |
|
| 71 | + } |
|
| 72 | + |
|
| 73 | + if (!empty($newlang)) |
|
| 74 | + { |
|
| 75 | + $outputlangs = new Translate('', $conf); |
|
| 76 | + $outputlangs->setDefaultLang($newlang); |
|
| 77 | + // Load traductions files requiredby by page |
|
| 78 | + $outputlangs->loadLangs(array('commercial','bills','orders','contracts','members','propal','products','supplier_proposal','interventions')); |
|
| 79 | + } |
|
| 80 | + |
|
| 81 | + $topicmail=''; |
|
| 82 | + if (empty($object->ref_client)) { |
|
| 83 | + $topicmail = $outputlangs->trans($defaulttopic, '__REF__'); |
|
| 84 | + } else if (! empty($object->ref_client)) { |
|
| 85 | + $topicmail = $outputlangs->trans($defaulttopic, '__REF__ (__REFCLIENT__)'); |
|
| 86 | + } |
|
| 87 | + |
|
| 88 | + // Build document if it not exists |
|
| 89 | + if (! in_array($object->element, array('societe', 'user', 'member'))) |
|
| 90 | + { |
|
| 91 | + if ((! $file || ! is_readable($file)) && method_exists($object, 'generateDocument')) |
|
| 92 | + { |
|
| 93 | + $result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); |
|
| 94 | + if ($result <= 0) { |
|
| 95 | + dol_print_error($db, $object->error, $object->errors); |
|
| 96 | + exit(); |
|
| 97 | + } |
|
| 98 | + $fileparams = dol_most_recent_file($diroutput . '/' . $ref, preg_quote($ref, '/').'[^\-]+'); |
|
| 99 | + $file = $fileparams['fullname']; |
|
| 100 | + } |
|
| 101 | + } |
|
| 102 | + |
|
| 103 | + print '<div id="formmailbeforetitle" name="formmailbeforetitle"></div>'; |
|
| 104 | + print '<div class="clearboth"></div>'; |
|
| 105 | + print '<br>'; |
|
| 106 | + print load_fiche_titre($langs->trans($titreform)); |
|
| 107 | + |
|
| 108 | + dol_fiche_head(''); |
|
| 109 | + |
|
| 110 | + // Create form for email |
|
| 111 | + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
| 112 | + $formmail = new FormMail($db); |
|
| 113 | + |
|
| 114 | + $formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang); |
|
| 115 | + $formmail->fromtype = (GETPOST('fromtype')?GETPOST('fromtype'):(!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)?$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE:'user')); |
|
| 116 | + |
|
| 117 | + if ($formmail->fromtype === 'user') |
|
| 118 | + { |
|
| 119 | + $formmail->fromid = $user->id; |
|
| 120 | + } |
|
| 121 | + $formmail->trackid=$trackid; |
|
| 122 | + if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set |
|
| 123 | + { |
|
| 124 | + include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
|
| 125 | + $formmail->frommail=dolAddEmailTrackId($formmail->frommail, $trackid); |
|
| 126 | + } |
|
| 127 | + $formmail->withfrom = 1; |
|
| 128 | + |
|
| 129 | + // Fill list of recipient with email inside <>. |
|
| 130 | + $liste = array(); |
|
| 131 | + if ($object->element == 'expensereport') |
|
| 132 | + { |
|
| 133 | + $fuser = new User($db); |
|
| 134 | + $fuser->fetch($object->fk_user_author); |
|
| 135 | + $liste['thirdparty'] = $fuser->getFullName($langs)." <".$fuser->email.">"; |
|
| 136 | + } |
|
| 137 | + elseif ($object->element == 'societe') |
|
| 138 | + { |
|
| 139 | + foreach ($object->thirdparty_and_contact_email_array(1) as $key => $value) { |
|
| 140 | + $liste[$key] = $value; |
|
| 141 | + } |
|
| 142 | + } |
|
| 143 | + elseif ($object->element == 'contact') |
|
| 144 | + { |
|
| 145 | + $liste['contact'] = $object->getFullName($langs)." <".$object->email.">"; |
|
| 146 | + } |
|
| 147 | + elseif ($object->element == 'user' || $object->element == 'member') |
|
| 148 | + { |
|
| 149 | + $liste['thirdparty'] = $object->getFullName($langs)." <".$object->email.">"; |
|
| 150 | + } |
|
| 151 | + else |
|
| 152 | + { |
|
| 153 | + if (is_object($object->thirdparty)) |
|
| 154 | + { |
|
| 155 | + foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key => $value) { |
|
| 156 | + $liste[$key] = $value; |
|
| 157 | + } |
|
| 158 | + } |
|
| 159 | + } |
|
| 160 | + if (!empty($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT)) { |
|
| 161 | + $listeuser=array(); |
|
| 162 | + $fuserdest = new User($db); |
|
| 163 | + |
|
| 164 | + $result= $fuserdest->fetchAll('ASC', 't.lastname', 0, 0, array('customsql'=>'t.statut=1 AND t.employee=1 AND t.email IS NOT NULL AND t.email<>\'\'')); |
|
| 165 | + if ($result>0 && is_array($fuserdest->users) && count($fuserdest->users)>0) { |
|
| 166 | + foreach($fuserdest->users as $uuserdest) { |
|
| 167 | + $listeuser[$uuserdest->id] = $uuserdest->user_get_property($uuserdest->id,'email'); |
|
| 168 | + } |
|
| 169 | + } elseif ($result<0) { |
|
| 170 | + setEventMessages(null, $fuserdest->errors,'errors'); |
|
| 171 | + } |
|
| 172 | + if (count($listeuser)>0) { |
|
| 173 | + $formmail->withtouser = $listeuser; |
|
| 174 | + $formmail->withtoccuser = $listeuser; |
|
| 175 | + } |
|
| 176 | + } |
|
| 177 | + |
|
| 178 | + $formmail->withto = GETPOST('sendto') ? GETPOST('sendto') : $liste; |
|
| 179 | + $formmail->withtocc = $liste; |
|
| 180 | + $formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC; |
|
| 181 | + $formmail->withtopic = $topicmail; |
|
| 182 | + $formmail->withfile = 2; |
|
| 183 | + $formmail->withbody = 1; |
|
| 184 | + $formmail->withdeliveryreceipt = 1; |
|
| 185 | + $formmail->withcancel = 1; |
|
| 186 | + |
|
| 187 | + //$arrayoffamiliestoexclude=array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...); |
|
| 188 | + if (! isset($arrayoffamiliestoexclude)) $arrayoffamiliestoexclude=null; |
|
| 189 | + |
|
| 190 | + // Make substitution in email content |
|
| 191 | + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object); |
|
| 192 | + $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"/>' : ''; |
|
| 193 | + $substitutionarray['__PERSONALIZED__'] = ''; // deprecated |
|
| 194 | + $substitutionarray['__CONTACTCIVNAME__'] = ''; |
|
| 195 | + $parameters = array( |
|
| 196 | + 'mode' => 'formemail' |
|
| 197 | + ); |
|
| 198 | + complete_substitutions_array($substitutionarray, $outputlangs, $object, $parameters); |
|
| 199 | + |
|
| 200 | + // Find the good contact adress |
|
| 201 | + $custcontact = ''; |
|
| 202 | + $contactarr = array(); |
|
| 203 | + $contactarr = $object->liste_contact(- 1, 'external'); |
|
| 204 | + |
|
| 205 | + if (is_array($contactarr) && count($contactarr) > 0) { |
|
| 206 | + require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
| 207 | 207 | $contactstatic = new Contact($db); |
| 208 | 208 | |
| 209 | - foreach ($contactarr as $contact) { |
|
| 209 | + foreach ($contactarr as $contact) { |
|
| 210 | 210 | $contactstatic->fetch($contact['id']); |
| 211 | 211 | $substitutionarray['__CONTACT_NAME_'.$contact['code'].'__'] = $contactstatic->getFullName($langs, 1); |
| 212 | - } |
|
| 213 | - } |
|
| 212 | + } |
|
| 213 | + } |
|
| 214 | 214 | |
| 215 | - // Tableau des substitutions |
|
| 216 | - $formmail->substit = $substitutionarray; |
|
| 215 | + // Tableau des substitutions |
|
| 216 | + $formmail->substit = $substitutionarray; |
|
| 217 | 217 | |
| 218 | - // Tableau des parametres complementaires |
|
| 219 | - $formmail->param['action'] = 'send'; |
|
| 220 | - $formmail->param['models'] = $modelmail; |
|
| 221 | - $formmail->param['models_id']=GETPOST('modelmailselected','int'); |
|
| 222 | - $formmail->param['id'] = $object->id; |
|
| 223 | - $formmail->param['returnurl'] = $_SERVER["PHP_SELF"] . '?id=' . $object->id; |
|
| 224 | - $formmail->param['fileinit'] = array($file); |
|
| 218 | + // Tableau des parametres complementaires |
|
| 219 | + $formmail->param['action'] = 'send'; |
|
| 220 | + $formmail->param['models'] = $modelmail; |
|
| 221 | + $formmail->param['models_id']=GETPOST('modelmailselected','int'); |
|
| 222 | + $formmail->param['id'] = $object->id; |
|
| 223 | + $formmail->param['returnurl'] = $_SERVER["PHP_SELF"] . '?id=' . $object->id; |
|
| 224 | + $formmail->param['fileinit'] = array($file); |
|
| 225 | 225 | |
| 226 | - // Show form |
|
| 227 | - print $formmail->get_form(); |
|
| 226 | + // Show form |
|
| 227 | + print $formmail->get_form(); |
|
| 228 | 228 | |
| 229 | - dol_fiche_end(); |
|
| 229 | + dol_fiche_end(); |
|
| 230 | 230 | } |
| 231 | 231 | |
@@ -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; |
@@ -38,21 +38,21 @@ discard block |
||
| 38 | 38 | { |
| 39 | 39 | $langs->load("mails"); |
| 40 | 40 | |
| 41 | - $titreform='SendMail'; |
|
| 41 | + $titreform = 'SendMail'; |
|
| 42 | 42 | |
| 43 | 43 | $object->fetch_projet(); |
| 44 | 44 | |
| 45 | - if (! in_array($object->element, array('societe', 'user', 'member'))) |
|
| 45 | + if (!in_array($object->element, array('societe', 'user', 'member'))) |
|
| 46 | 46 | { |
| 47 | 47 | // TODO get also the main_lastdoc field of $object. If not found, try to guess with following code |
| 48 | 48 | |
| 49 | 49 | $ref = dol_sanitizeFileName($object->ref); |
| 50 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
| 51 | - $fileparams = dol_most_recent_file($diroutput . '/' . $ref, preg_quote($ref, '/').'[^\-]+'); |
|
| 50 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
| 51 | + $fileparams = dol_most_recent_file($diroutput.'/'.$ref, preg_quote($ref, '/').'[^\-]+'); |
|
| 52 | 52 | // |
| 53 | 53 | if ($object->element == 'invoice_supplier') |
| 54 | 54 | { |
| 55 | - $fileparams = dol_most_recent_file($diroutput . '/' . get_exdir($object->id,2,0,0,$object,$object->element).$ref, preg_quote($ref,'/').'([^\-])+'); |
|
| 55 | + $fileparams = dol_most_recent_file($diroutput.'/'.get_exdir($object->id, 2, 0, 0, $object, $object->element).$ref, preg_quote($ref, '/').'([^\-])+'); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | $file = $fileparams['fullname']; |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | // Define output language |
| 62 | 62 | $outputlangs = $langs; |
| 63 | 63 | $newlang = ''; |
| 64 | - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) |
|
| 64 | + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && !empty($_REQUEST['lang_id'])) |
|
| 65 | 65 | { |
| 66 | 66 | $newlang = $_REQUEST['lang_id']; |
| 67 | 67 | } |
@@ -75,27 +75,27 @@ discard block |
||
| 75 | 75 | $outputlangs = new Translate('', $conf); |
| 76 | 76 | $outputlangs->setDefaultLang($newlang); |
| 77 | 77 | // Load traductions files requiredby by page |
| 78 | - $outputlangs->loadLangs(array('commercial','bills','orders','contracts','members','propal','products','supplier_proposal','interventions')); |
|
| 78 | + $outputlangs->loadLangs(array('commercial', 'bills', 'orders', 'contracts', 'members', 'propal', 'products', 'supplier_proposal', 'interventions')); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - $topicmail=''; |
|
| 81 | + $topicmail = ''; |
|
| 82 | 82 | if (empty($object->ref_client)) { |
| 83 | 83 | $topicmail = $outputlangs->trans($defaulttopic, '__REF__'); |
| 84 | - } else if (! empty($object->ref_client)) { |
|
| 84 | + } else if (!empty($object->ref_client)) { |
|
| 85 | 85 | $topicmail = $outputlangs->trans($defaulttopic, '__REF__ (__REFCLIENT__)'); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | // Build document if it not exists |
| 89 | - if (! in_array($object->element, array('societe', 'user', 'member'))) |
|
| 89 | + if (!in_array($object->element, array('societe', 'user', 'member'))) |
|
| 90 | 90 | { |
| 91 | - if ((! $file || ! is_readable($file)) && method_exists($object, 'generateDocument')) |
|
| 91 | + if ((!$file || !is_readable($file)) && method_exists($object, 'generateDocument')) |
|
| 92 | 92 | { |
| 93 | 93 | $result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); |
| 94 | 94 | if ($result <= 0) { |
| 95 | 95 | dol_print_error($db, $object->error, $object->errors); |
| 96 | 96 | exit(); |
| 97 | 97 | } |
| 98 | - $fileparams = dol_most_recent_file($diroutput . '/' . $ref, preg_quote($ref, '/').'[^\-]+'); |
|
| 98 | + $fileparams = dol_most_recent_file($diroutput.'/'.$ref, preg_quote($ref, '/').'[^\-]+'); |
|
| 99 | 99 | $file = $fileparams['fullname']; |
| 100 | 100 | } |
| 101 | 101 | } |
@@ -108,21 +108,21 @@ discard block |
||
| 108 | 108 | dol_fiche_head(''); |
| 109 | 109 | |
| 110 | 110 | // Create form for email |
| 111 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
| 111 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
| 112 | 112 | $formmail = new FormMail($db); |
| 113 | 113 | |
| 114 | - $formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang); |
|
| 115 | - $formmail->fromtype = (GETPOST('fromtype')?GETPOST('fromtype'):(!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)?$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE:'user')); |
|
| 114 | + $formmail->param['langsmodels'] = (empty($newlang) ? $langs->defaultlang : $newlang); |
|
| 115 | + $formmail->fromtype = (GETPOST('fromtype') ?GETPOST('fromtype') : (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) ? $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE : 'user')); |
|
| 116 | 116 | |
| 117 | 117 | if ($formmail->fromtype === 'user') |
| 118 | 118 | { |
| 119 | 119 | $formmail->fromid = $user->id; |
| 120 | 120 | } |
| 121 | - $formmail->trackid=$trackid; |
|
| 122 | - if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set |
|
| 121 | + $formmail->trackid = $trackid; |
|
| 122 | + if (!empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set |
|
| 123 | 123 | { |
| 124 | 124 | include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
| 125 | - $formmail->frommail=dolAddEmailTrackId($formmail->frommail, $trackid); |
|
| 125 | + $formmail->frommail = dolAddEmailTrackId($formmail->frommail, $trackid); |
|
| 126 | 126 | } |
| 127 | 127 | $formmail->withfrom = 1; |
| 128 | 128 | |
@@ -158,18 +158,18 @@ discard block |
||
| 158 | 158 | } |
| 159 | 159 | } |
| 160 | 160 | if (!empty($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT)) { |
| 161 | - $listeuser=array(); |
|
| 161 | + $listeuser = array(); |
|
| 162 | 162 | $fuserdest = new User($db); |
| 163 | 163 | |
| 164 | - $result= $fuserdest->fetchAll('ASC', 't.lastname', 0, 0, array('customsql'=>'t.statut=1 AND t.employee=1 AND t.email IS NOT NULL AND t.email<>\'\'')); |
|
| 165 | - if ($result>0 && is_array($fuserdest->users) && count($fuserdest->users)>0) { |
|
| 166 | - foreach($fuserdest->users as $uuserdest) { |
|
| 167 | - $listeuser[$uuserdest->id] = $uuserdest->user_get_property($uuserdest->id,'email'); |
|
| 164 | + $result = $fuserdest->fetchAll('ASC', 't.lastname', 0, 0, array('customsql'=>'t.statut=1 AND t.employee=1 AND t.email IS NOT NULL AND t.email<>\'\'')); |
|
| 165 | + if ($result > 0 && is_array($fuserdest->users) && count($fuserdest->users) > 0) { |
|
| 166 | + foreach ($fuserdest->users as $uuserdest) { |
|
| 167 | + $listeuser[$uuserdest->id] = $uuserdest->user_get_property($uuserdest->id, 'email'); |
|
| 168 | 168 | } |
| 169 | - } elseif ($result<0) { |
|
| 170 | - setEventMessages(null, $fuserdest->errors,'errors'); |
|
| 169 | + } elseif ($result < 0) { |
|
| 170 | + setEventMessages(null, $fuserdest->errors, 'errors'); |
|
| 171 | 171 | } |
| 172 | - if (count($listeuser)>0) { |
|
| 172 | + if (count($listeuser) > 0) { |
|
| 173 | 173 | $formmail->withtouser = $listeuser; |
| 174 | 174 | $formmail->withtoccuser = $listeuser; |
| 175 | 175 | } |
@@ -185,12 +185,12 @@ discard block |
||
| 185 | 185 | $formmail->withcancel = 1; |
| 186 | 186 | |
| 187 | 187 | //$arrayoffamiliestoexclude=array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...); |
| 188 | - if (! isset($arrayoffamiliestoexclude)) $arrayoffamiliestoexclude=null; |
|
| 188 | + if (!isset($arrayoffamiliestoexclude)) $arrayoffamiliestoexclude = null; |
|
| 189 | 189 | |
| 190 | 190 | // Make substitution in email content |
| 191 | 191 | $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object); |
| 192 | - $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"/>' : ''; |
|
| 193 | - $substitutionarray['__PERSONALIZED__'] = ''; // deprecated |
|
| 192 | + $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"/>' : ''; |
|
| 193 | + $substitutionarray['__PERSONALIZED__'] = ''; // deprecated |
|
| 194 | 194 | $substitutionarray['__CONTACTCIVNAME__'] = ''; |
| 195 | 195 | $parameters = array( |
| 196 | 196 | 'mode' => 'formemail' |
@@ -200,10 +200,10 @@ discard block |
||
| 200 | 200 | // Find the good contact adress |
| 201 | 201 | $custcontact = ''; |
| 202 | 202 | $contactarr = array(); |
| 203 | - $contactarr = $object->liste_contact(- 1, 'external'); |
|
| 203 | + $contactarr = $object->liste_contact(-1, 'external'); |
|
| 204 | 204 | |
| 205 | 205 | if (is_array($contactarr) && count($contactarr) > 0) { |
| 206 | - require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
| 206 | + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
| 207 | 207 | $contactstatic = new Contact($db); |
| 208 | 208 | |
| 209 | 209 | foreach ($contactarr as $contact) { |
@@ -218,9 +218,9 @@ discard block |
||
| 218 | 218 | // Tableau des parametres complementaires |
| 219 | 219 | $formmail->param['action'] = 'send'; |
| 220 | 220 | $formmail->param['models'] = $modelmail; |
| 221 | - $formmail->param['models_id']=GETPOST('modelmailselected','int'); |
|
| 221 | + $formmail->param['models_id'] = GETPOST('modelmailselected', 'int'); |
|
| 222 | 222 | $formmail->param['id'] = $object->id; |
| 223 | - $formmail->param['returnurl'] = $_SERVER["PHP_SELF"] . '?id=' . $object->id; |
|
| 223 | + $formmail->param['returnurl'] = $_SERVER["PHP_SELF"].'?id='.$object->id; |
|
| 224 | 224 | $formmail->param['fileinit'] = array($file); |
| 225 | 225 | |
| 226 | 226 | // Show form |
@@ -119,9 +119,11 @@ discard block |
||
| 119 | 119 | $formmail->fromid = $user->id; |
| 120 | 120 | } |
| 121 | 121 | $formmail->trackid=$trackid; |
| 122 | - if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set |
|
| 122 | + if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) { |
|
| 123 | + // If bit 2 is set |
|
| 123 | 124 | { |
| 124 | 125 | include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
| 126 | + } |
|
| 125 | 127 | $formmail->frommail=dolAddEmailTrackId($formmail->frommail, $trackid); |
| 126 | 128 | } |
| 127 | 129 | $formmail->withfrom = 1; |
@@ -133,22 +135,18 @@ discard block |
||
| 133 | 135 | $fuser = new User($db); |
| 134 | 136 | $fuser->fetch($object->fk_user_author); |
| 135 | 137 | $liste['thirdparty'] = $fuser->getFullName($langs)." <".$fuser->email.">"; |
| 136 | - } |
|
| 137 | - elseif ($object->element == 'societe') |
|
| 138 | + } elseif ($object->element == 'societe') |
|
| 138 | 139 | { |
| 139 | 140 | foreach ($object->thirdparty_and_contact_email_array(1) as $key => $value) { |
| 140 | 141 | $liste[$key] = $value; |
| 141 | 142 | } |
| 142 | - } |
|
| 143 | - elseif ($object->element == 'contact') |
|
| 143 | + } elseif ($object->element == 'contact') |
|
| 144 | 144 | { |
| 145 | 145 | $liste['contact'] = $object->getFullName($langs)." <".$object->email.">"; |
| 146 | - } |
|
| 147 | - elseif ($object->element == 'user' || $object->element == 'member') |
|
| 146 | + } elseif ($object->element == 'user' || $object->element == 'member') |
|
| 148 | 147 | { |
| 149 | 148 | $liste['thirdparty'] = $object->getFullName($langs)." <".$object->email.">"; |
| 150 | - } |
|
| 151 | - else |
|
| 149 | + } else |
|
| 152 | 150 | { |
| 153 | 151 | if (is_object($object->thirdparty)) |
| 154 | 152 | { |
@@ -185,7 +183,9 @@ discard block |
||
| 185 | 183 | $formmail->withcancel = 1; |
| 186 | 184 | |
| 187 | 185 | //$arrayoffamiliestoexclude=array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...); |
| 188 | - if (! isset($arrayoffamiliestoexclude)) $arrayoffamiliestoexclude=null; |
|
| 186 | + if (! isset($arrayoffamiliestoexclude)) { |
|
| 187 | + $arrayoffamiliestoexclude=null; |
|
| 188 | + } |
|
| 189 | 189 | |
| 190 | 190 | // Make substitution in email content |
| 191 | 191 | $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object); |
@@ -30,8 +30,8 @@ discard block |
||
| 30 | 30 | // Protection to avoid direct call of template |
| 31 | 31 | if (empty($conf) || ! is_object($conf)) |
| 32 | 32 | { |
| 33 | - print "Error, template page can't be called as URL"; |
|
| 34 | - exit; |
|
| 33 | + print "Error, template page can't be called as URL"; |
|
| 34 | + exit; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | |
@@ -55,17 +55,17 @@ discard block |
||
| 55 | 55 | var list = jQuery("#list"); |
| 56 | 56 | var totalizable = jQuery("#totalizable"); |
| 57 | 57 | <?php |
| 58 | - if ((GETPOST('type','alpha') != "select") && (GETPOST('type','alpha') != "sellist")) |
|
| 59 | - { |
|
| 60 | - print 'jQuery("#value_choice").hide();'; |
|
| 61 | - } |
|
| 62 | - |
|
| 63 | - if (GETPOST('type','alpha') == "separate") |
|
| 64 | - { |
|
| 65 | - print "jQuery('#size, #default_value, #langfile').val('').prop('disabled', true);"; |
|
| 66 | - print 'jQuery("#value_choice").hide();'; |
|
| 67 | - } |
|
| 68 | - ?> |
|
| 58 | + if ((GETPOST('type','alpha') != "select") && (GETPOST('type','alpha') != "sellist")) |
|
| 59 | + { |
|
| 60 | + print 'jQuery("#value_choice").hide();'; |
|
| 61 | + } |
|
| 62 | + |
|
| 63 | + if (GETPOST('type','alpha') == "separate") |
|
| 64 | + { |
|
| 65 | + print "jQuery('#size, #default_value, #langfile').val('').prop('disabled', true);"; |
|
| 66 | + print 'jQuery("#value_choice").hide();'; |
|
| 67 | + } |
|
| 68 | + ?> |
|
| 69 | 69 | |
| 70 | 70 | // Case of computed field |
| 71 | 71 | console.log(type); |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | |
| 30 | 30 | // Protection to avoid direct call of template |
| 31 | -if (empty($conf) || ! is_object($conf)) |
|
| 31 | +if (empty($conf) || !is_object($conf)) |
|
| 32 | 32 | { |
| 33 | 33 | print "Error, template page can't be called as URL"; |
| 34 | 34 | exit; |
@@ -55,12 +55,12 @@ discard block |
||
| 55 | 55 | var list = jQuery("#list"); |
| 56 | 56 | var totalizable = jQuery("#totalizable"); |
| 57 | 57 | <?php |
| 58 | - if ((GETPOST('type','alpha') != "select") && (GETPOST('type','alpha') != "sellist")) |
|
| 58 | + if ((GETPOST('type', 'alpha') != "select") && (GETPOST('type', 'alpha') != "sellist")) |
|
| 59 | 59 | { |
| 60 | 60 | print 'jQuery("#value_choice").hide();'; |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - if (GETPOST('type','alpha') == "separate") |
|
| 63 | + if (GETPOST('type', 'alpha') == "separate") |
|
| 64 | 64 | { |
| 65 | 65 | print "jQuery('#size, #default_value, #langfile').val('').prop('disabled', true);"; |
| 66 | 66 | print 'jQuery("#value_choice").hide();'; |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | langfile.removeAttr('disabled');required.removeAttr('disabled'); alwayseditable.removeAttr('disabled'); list.removeAttr('disabled'); |
| 127 | 127 | } |
| 128 | 128 | } |
| 129 | - init_typeoffields('<?php echo GETPOST('type','alpha'); ?>'); |
|
| 129 | + init_typeoffields('<?php echo GETPOST('type', 'alpha'); ?>'); |
|
| 130 | 130 | jQuery("#type").change(function() { |
| 131 | 131 | init_typeoffields($(this).val()); |
| 132 | 132 | }); |
@@ -146,15 +146,15 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | <table summary="listofattributes" class="border centpercent"> |
| 148 | 148 | <!-- Label --> |
| 149 | -<tr><td class="titlefield fieldrequired"><?php echo $langs->trans("LabelOrTranslationKey"); ?></td><td class="valeur"><input type="text" name="label" size="40" value="<?php echo GETPOST('label','alpha'); ?>"></td></tr> |
|
| 149 | +<tr><td class="titlefield fieldrequired"><?php echo $langs->trans("LabelOrTranslationKey"); ?></td><td class="valeur"><input type="text" name="label" size="40" value="<?php echo GETPOST('label', 'alpha'); ?>"></td></tr> |
|
| 150 | 150 | <!-- Code --> |
| 151 | -<tr><td class="fieldrequired"><?php echo $langs->trans("AttributeCode"); ?></td><td class="valeur"><input type="text" name="attrname" id="attrname" size="10" value="<?php echo GETPOST('attrname','alpha'); ?>"> (<?php echo $langs->trans("AlphaNumOnlyLowerCharsAndNoSpace"); ?>)</td></tr> |
|
| 151 | +<tr><td class="fieldrequired"><?php echo $langs->trans("AttributeCode"); ?></td><td class="valeur"><input type="text" name="attrname" id="attrname" size="10" value="<?php echo GETPOST('attrname', 'alpha'); ?>"> (<?php echo $langs->trans("AlphaNumOnlyLowerCharsAndNoSpace"); ?>)</td></tr> |
|
| 152 | 152 | <!-- Type --> |
| 153 | 153 | <tr><td class="fieldrequired"><?php echo $langs->trans("Type"); ?></td><td class="valeur"> |
| 154 | -<?php print $form->selectarray('type',$type2label,GETPOST('type','alpha')); ?> |
|
| 154 | +<?php print $form->selectarray('type', $type2label, GETPOST('type', 'alpha')); ?> |
|
| 155 | 155 | </td></tr> |
| 156 | 156 | <!-- Size --> |
| 157 | -<tr class="extra_size"><td class="fieldrequired"><?php echo $langs->trans("Size"); ?></td><td class="valeur"><input id="size" type="text" name="size" size="5" value="<?php echo (GETPOST('size','alpha')?GETPOST('size','alpha'):''); ?>"></td></tr> |
|
| 157 | +<tr class="extra_size"><td class="fieldrequired"><?php echo $langs->trans("Size"); ?></td><td class="valeur"><input id="size" type="text" name="size" size="5" value="<?php echo (GETPOST('size', 'alpha') ?GETPOST('size', 'alpha') : ''); ?>"></td></tr> |
|
| 158 | 158 | <!-- Default Value (for select list / radio/ checkbox) --> |
| 159 | 159 | <tr id="value_choice"> |
| 160 | 160 | <td> |
@@ -163,41 +163,41 @@ discard block |
||
| 163 | 163 | <td> |
| 164 | 164 | <table class="nobordernopadding"> |
| 165 | 165 | <tr><td> |
| 166 | - <textarea name="param" id="param" cols="80" rows="<?php echo ROWS_4 ?>"><?php echo GETPOST('param','alpha'); ?></textarea> |
|
| 166 | + <textarea name="param" id="param" cols="80" rows="<?php echo ROWS_4 ?>"><?php echo GETPOST('param', 'alpha'); ?></textarea> |
|
| 167 | 167 | </td><td> |
| 168 | - <span id="helpselect"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"),1,0,'', 0, 2, 'helpvalue1')?></span> |
|
| 169 | - <span id="helpsellist"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"),1,0,'', 0, 2, 'helpvalue2')?></span> |
|
| 170 | - <span id="helpchkbxlst"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"),1,0,'', 0, 2, 'helpvalue3')?></span> |
|
| 171 | - <span id="helplink"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelplink"),1,0,'', 0, 2, 'helpvalue4')?></span> |
|
| 172 | - <span id="helppassword"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"),1,0,'', 0, 2, 'helpvalue5')?></span> |
|
| 168 | + <span id="helpselect"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"), 1, 0, '', 0, 2, 'helpvalue1')?></span> |
|
| 169 | + <span id="helpsellist"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"), 1, 0, '', 0, 2, 'helpvalue2')?></span> |
|
| 170 | + <span id="helpchkbxlst"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"), 1, 0, '', 0, 2, 'helpvalue3')?></span> |
|
| 171 | + <span id="helplink"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelplink"), 1, 0, '', 0, 2, 'helpvalue4')?></span> |
|
| 172 | + <span id="helppassword"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"), 1, 0, '', 0, 2, 'helpvalue5')?></span> |
|
| 173 | 173 | </td></tr> |
| 174 | 174 | </table> |
| 175 | 175 | </td> |
| 176 | 176 | </tr> |
| 177 | 177 | <!-- Position --> |
| 178 | -<tr><td class="titlefield"><?php echo $langs->trans("Position"); ?></td><td class="valeur"><input type="text" name="pos" size="5" value="<?php echo GETPOSTISSET('pos')?GETPOST('pos','int'):100; ?>"></td></tr> |
|
| 178 | +<tr><td class="titlefield"><?php echo $langs->trans("Position"); ?></td><td class="valeur"><input type="text" name="pos" size="5" value="<?php echo GETPOSTISSET('pos') ?GETPOST('pos', 'int') : 100; ?>"></td></tr> |
|
| 179 | 179 | <!-- Language file --> |
| 180 | -<tr><td class="titlefield"><?php echo $langs->trans("LanguageFile"); ?></td><td class="valeur"><input type="text" id="langfile" name="langfile" class="minwidth200" value="<?php echo dol_escape_htmltag(GETPOST('langfile','alpha')); ?>"></td></tr> |
|
| 180 | +<tr><td class="titlefield"><?php echo $langs->trans("LanguageFile"); ?></td><td class="valeur"><input type="text" id="langfile" name="langfile" class="minwidth200" value="<?php echo dol_escape_htmltag(GETPOST('langfile', 'alpha')); ?>"></td></tr> |
|
| 181 | 181 | <!-- Computed Value --> |
| 182 | -<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" type="text" name="computed_value" class="quatrevingtpercent" value="<?php echo (GETPOST('computed_value','none')?GETPOST('computed_value','none'):''); ?>"></td></tr> |
|
| 182 | +<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" type="text" name="computed_value" class="quatrevingtpercent" value="<?php echo (GETPOST('computed_value', 'none') ?GETPOST('computed_value', 'none') : ''); ?>"></td></tr> |
|
| 183 | 183 | <!-- Default Value (at sql setup level) --> |
| 184 | -<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 (GETPOST('default_value','alpha')?GETPOST('default_value','alpha'):''); ?>"></td></tr> |
|
| 184 | +<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 (GETPOST('default_value', 'alpha') ?GETPOST('default_value', 'alpha') : ''); ?>"></td></tr> |
|
| 185 | 185 | <!-- Unique --> |
| 186 | -<tr class="extra_unique"><td><?php echo $langs->trans("Unique"); ?></td><td class="valeur"><input id="unique" type="checkbox" name="unique"<?php echo (GETPOST('unique','alpha')?' checked':''); ?>></td></tr> |
|
| 186 | +<tr class="extra_unique"><td><?php echo $langs->trans("Unique"); ?></td><td class="valeur"><input id="unique" type="checkbox" name="unique"<?php echo (GETPOST('unique', 'alpha') ? ' checked' : ''); ?>></td></tr> |
|
| 187 | 187 | <!-- Required --> |
| 188 | -<tr class="extra_required"><td><?php echo $langs->trans("Required"); ?></td><td class="valeur"><input id="required" type="checkbox" name="required"<?php echo (GETPOST('required','alpha')?' checked':''); ?>></td></tr> |
|
| 188 | +<tr class="extra_required"><td><?php echo $langs->trans("Required"); ?></td><td class="valeur"><input id="required" type="checkbox" name="required"<?php echo (GETPOST('required', 'alpha') ? ' checked' : ''); ?>></td></tr> |
|
| 189 | 189 | <!-- Always editable --> |
| 190 | -<tr class="extra_alwayseditable"><td><?php echo $langs->trans("AlwaysEditable"); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable"<?php echo ((GETPOST('alwayseditable','alpha') || ! GETPOST('button','alpha'))?' checked':''); ?>></td></tr> |
|
| 190 | +<tr class="extra_alwayseditable"><td><?php echo $langs->trans("AlwaysEditable"); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable"<?php echo ((GETPOST('alwayseditable', 'alpha') || !GETPOST('button', 'alpha')) ? ' checked' : ''); ?>></td></tr> |
|
| 191 | 191 | <!-- Visibility --> |
| 192 | 192 | <tr><td class="extra_list"><?php echo $form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?> |
| 193 | -</td><td class="valeur"><input id="list" class="minwidth100" type="text" name="list" value="<?php echo GETPOST('list','int')!='' ? GETPOST('list','int') : '1'; ?>"></td></tr> |
|
| 193 | +</td><td class="valeur"><input id="list" class="minwidth100" type="text" name="list" value="<?php echo GETPOST('list', 'int') != '' ? GETPOST('list', 'int') : '1'; ?>"></td></tr> |
|
| 194 | 194 | <!-- Totalizable --> |
| 195 | -<tr class="extra_totalizable"><td><?php echo $langs->trans("Totalizable"); ?></td><td class="valeur"><input id="totalizable" type="checkbox" name="totalizable"<?php echo ((GETPOST('totalizable','alpha') || GETPOST('button','alpha'))?' checked':''); ?>></td></tr> |
|
| 195 | +<tr class="extra_totalizable"><td><?php echo $langs->trans("Totalizable"); ?></td><td class="valeur"><input id="totalizable" type="checkbox" name="totalizable"<?php echo ((GETPOST('totalizable', 'alpha') || GETPOST('button', 'alpha')) ? ' checked' : ''); ?>></td></tr> |
|
| 196 | 196 | <!-- Help tooltip --> |
| 197 | 197 | <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> |
| 198 | 198 | <?php if ($conf->multicompany->enabled) { ?> |
| 199 | 199 | <!-- Multicompany entity --> |
| 200 | - <tr><td><?php echo $langs->trans("AllEntities"); ?></td><td class="valeur"><input id="entitycurrentorall" type="checkbox" name="entitycurrentorall"<?php echo (GETPOST('entitycurrentorall','alpha') ? '':' checked'); ?>></td></tr> |
|
| 200 | + <tr><td><?php echo $langs->trans("AllEntities"); ?></td><td class="valeur"><input id="entitycurrentorall" type="checkbox" name="entitycurrentorall"<?php echo (GETPOST('entitycurrentorall', 'alpha') ? '' : ' checked'); ?>></td></tr> |
|
| 201 | 201 | <?php } ?> |
| 202 | 202 | </table> |
| 203 | 203 | |
@@ -3,8 +3,8 @@ discard block |
||
| 3 | 3 | // Protection to avoid direct call of template |
| 4 | 4 | if (empty($conf) || ! is_object($conf)) |
| 5 | 5 | { |
| 6 | - print "Error, template page can't be called as URL"; |
|
| 7 | - exit; |
|
| 6 | + print "Error, template page can't be called as URL"; |
|
| 7 | + exit; |
|
| 8 | 8 | } |
| 9 | 9 | |
| 10 | 10 | // Require |
@@ -56,59 +56,59 @@ discard block |
||
| 56 | 56 | // List of comments |
| 57 | 57 | if (!empty($object->comments)) |
| 58 | 58 | { |
| 59 | - // Default color for current user |
|
| 60 | - $TColors = array($user->id => array('bgcolor'=>'efefef','color'=>'555')); |
|
| 61 | - $first = true; |
|
| 62 | - foreach($object->comments as $comment) |
|
| 63 | - { |
|
| 64 | - $fk_user = $comment->fk_user_author; |
|
| 65 | - $userstatic->fetch($fk_user); |
|
| 66 | - |
|
| 67 | - if(empty($TColors[$fk_user])) { |
|
| 68 | - $bgcolor = random_color(180,240); |
|
| 69 | - if(!empty($userstatic->color)) { |
|
| 70 | - $bgcolor = $userstatic->color; |
|
| 71 | - } |
|
| 72 | - $color = (colorIsLight($bgcolor))?'555':'fff'; |
|
| 73 | - $TColors[$fk_user] = array('bgcolor'=>$bgcolor,'color'=>$color); |
|
| 74 | - } |
|
| 75 | - print '<div class="width100p" style="color:#'.$TColors[$fk_user]['color'].'">'; |
|
| 76 | - if ($fk_user != $user->id) { |
|
| 77 | - print '<div class="width25p float"> </div>'; |
|
| 78 | - } |
|
| 79 | - |
|
| 80 | - print '<div class="width75p float comment comment-table" style="background-color:#'.$TColors[$fk_user]['bgcolor'].'">'; |
|
| 81 | - print '<div class="comment-info comment-cell">'; |
|
| 82 | - if (! empty($user->photo)) |
|
| 83 | - { |
|
| 84 | - print Form::showphoto('userphoto', $userstatic, 80, 0, 0, '', 'small', 0, 1).'<br/>'; |
|
| 85 | - } |
|
| 86 | - print $langs->trans('User').' : '.$userstatic->getNomUrl().'<br/>'; |
|
| 87 | - print $langs->trans('Date').' : '.dol_print_date($comment->datec,'dayhoursec'); |
|
| 88 | - print '</div>'; // End comment-info |
|
| 89 | - |
|
| 90 | - print '<div class="comment-cell comment-right">'; |
|
| 91 | - print '<div class="comment-table width100p">'; |
|
| 92 | - print '<div class="comment-description comment-cell">'; |
|
| 93 | - print $comment->description; |
|
| 94 | - print '</div>'; // End comment-description |
|
| 95 | - if(($first && $fk_user == $user->id) || $user->admin == 1) { |
|
| 96 | - print '<a class="comment-delete comment-cell" href="'.$varpage.'?action=deletecomment&id='.$id.'&withproject=1&idcomment='.$comment->id.'" title="'.$langs->trans('Delete').'">'; |
|
| 97 | - print img_picto('', 'delete.png'); |
|
| 98 | - print '</a>'; |
|
| 99 | - } |
|
| 100 | - print '</div>'; // End comment-table |
|
| 101 | - print '</div>'; // End comment-right |
|
| 102 | - print '</div>'; // End comment |
|
| 103 | - |
|
| 104 | - if($fk_user == $user->id) { |
|
| 105 | - print '<div class="width25p float"> </div>'; |
|
| 106 | - } |
|
| 107 | - print '<div class="clearboth"></div>'; |
|
| 108 | - print '</div>'; // end 100p |
|
| 109 | - |
|
| 110 | - $first = false; |
|
| 111 | - } |
|
| 59 | + // Default color for current user |
|
| 60 | + $TColors = array($user->id => array('bgcolor'=>'efefef','color'=>'555')); |
|
| 61 | + $first = true; |
|
| 62 | + foreach($object->comments as $comment) |
|
| 63 | + { |
|
| 64 | + $fk_user = $comment->fk_user_author; |
|
| 65 | + $userstatic->fetch($fk_user); |
|
| 66 | + |
|
| 67 | + if(empty($TColors[$fk_user])) { |
|
| 68 | + $bgcolor = random_color(180,240); |
|
| 69 | + if(!empty($userstatic->color)) { |
|
| 70 | + $bgcolor = $userstatic->color; |
|
| 71 | + } |
|
| 72 | + $color = (colorIsLight($bgcolor))?'555':'fff'; |
|
| 73 | + $TColors[$fk_user] = array('bgcolor'=>$bgcolor,'color'=>$color); |
|
| 74 | + } |
|
| 75 | + print '<div class="width100p" style="color:#'.$TColors[$fk_user]['color'].'">'; |
|
| 76 | + if ($fk_user != $user->id) { |
|
| 77 | + print '<div class="width25p float"> </div>'; |
|
| 78 | + } |
|
| 79 | + |
|
| 80 | + print '<div class="width75p float comment comment-table" style="background-color:#'.$TColors[$fk_user]['bgcolor'].'">'; |
|
| 81 | + print '<div class="comment-info comment-cell">'; |
|
| 82 | + if (! empty($user->photo)) |
|
| 83 | + { |
|
| 84 | + print Form::showphoto('userphoto', $userstatic, 80, 0, 0, '', 'small', 0, 1).'<br/>'; |
|
| 85 | + } |
|
| 86 | + print $langs->trans('User').' : '.$userstatic->getNomUrl().'<br/>'; |
|
| 87 | + print $langs->trans('Date').' : '.dol_print_date($comment->datec,'dayhoursec'); |
|
| 88 | + print '</div>'; // End comment-info |
|
| 89 | + |
|
| 90 | + print '<div class="comment-cell comment-right">'; |
|
| 91 | + print '<div class="comment-table width100p">'; |
|
| 92 | + print '<div class="comment-description comment-cell">'; |
|
| 93 | + print $comment->description; |
|
| 94 | + print '</div>'; // End comment-description |
|
| 95 | + if(($first && $fk_user == $user->id) || $user->admin == 1) { |
|
| 96 | + print '<a class="comment-delete comment-cell" href="'.$varpage.'?action=deletecomment&id='.$id.'&withproject=1&idcomment='.$comment->id.'" title="'.$langs->trans('Delete').'">'; |
|
| 97 | + print img_picto('', 'delete.png'); |
|
| 98 | + print '</a>'; |
|
| 99 | + } |
|
| 100 | + print '</div>'; // End comment-table |
|
| 101 | + print '</div>'; // End comment-right |
|
| 102 | + print '</div>'; // End comment |
|
| 103 | + |
|
| 104 | + if($fk_user == $user->id) { |
|
| 105 | + print '<div class="width25p float"> </div>'; |
|
| 106 | + } |
|
| 107 | + print '<div class="clearboth"></div>'; |
|
| 108 | + print '</div>'; // end 100p |
|
| 109 | + |
|
| 110 | + $first = false; |
|
| 111 | + } |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | print '<br>'; |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | // Protection to avoid direct call of template |
| 4 | -if (empty($conf) || ! is_object($conf)) |
|
| 4 | +if (empty($conf) || !is_object($conf)) |
|
| 5 | 5 | { |
| 6 | 6 | print "Error, template page can't be called as URL"; |
| 7 | 7 | exit; |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | // Vars |
| 16 | 16 | $userstatic = new User($db); |
| 17 | -$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; |
|
| 17 | +$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
|
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | // Add comment |
@@ -57,20 +57,20 @@ discard block |
||
| 57 | 57 | if (!empty($object->comments)) |
| 58 | 58 | { |
| 59 | 59 | // Default color for current user |
| 60 | - $TColors = array($user->id => array('bgcolor'=>'efefef','color'=>'555')); |
|
| 60 | + $TColors = array($user->id => array('bgcolor'=>'efefef', 'color'=>'555')); |
|
| 61 | 61 | $first = true; |
| 62 | - foreach($object->comments as $comment) |
|
| 62 | + foreach ($object->comments as $comment) |
|
| 63 | 63 | { |
| 64 | 64 | $fk_user = $comment->fk_user_author; |
| 65 | 65 | $userstatic->fetch($fk_user); |
| 66 | 66 | |
| 67 | - if(empty($TColors[$fk_user])) { |
|
| 68 | - $bgcolor = random_color(180,240); |
|
| 69 | - if(!empty($userstatic->color)) { |
|
| 67 | + if (empty($TColors[$fk_user])) { |
|
| 68 | + $bgcolor = random_color(180, 240); |
|
| 69 | + if (!empty($userstatic->color)) { |
|
| 70 | 70 | $bgcolor = $userstatic->color; |
| 71 | 71 | } |
| 72 | - $color = (colorIsLight($bgcolor))?'555':'fff'; |
|
| 73 | - $TColors[$fk_user] = array('bgcolor'=>$bgcolor,'color'=>$color); |
|
| 72 | + $color = (colorIsLight($bgcolor)) ? '555' : 'fff'; |
|
| 73 | + $TColors[$fk_user] = array('bgcolor'=>$bgcolor, 'color'=>$color); |
|
| 74 | 74 | } |
| 75 | 75 | print '<div class="width100p" style="color:#'.$TColors[$fk_user]['color'].'">'; |
| 76 | 76 | if ($fk_user != $user->id) { |
@@ -79,12 +79,12 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | print '<div class="width75p float comment comment-table" style="background-color:#'.$TColors[$fk_user]['bgcolor'].'">'; |
| 81 | 81 | print '<div class="comment-info comment-cell">'; |
| 82 | - if (! empty($user->photo)) |
|
| 82 | + if (!empty($user->photo)) |
|
| 83 | 83 | { |
| 84 | 84 | print Form::showphoto('userphoto', $userstatic, 80, 0, 0, '', 'small', 0, 1).'<br/>'; |
| 85 | 85 | } |
| 86 | 86 | print $langs->trans('User').' : '.$userstatic->getNomUrl().'<br/>'; |
| 87 | - print $langs->trans('Date').' : '.dol_print_date($comment->datec,'dayhoursec'); |
|
| 87 | + print $langs->trans('Date').' : '.dol_print_date($comment->datec, 'dayhoursec'); |
|
| 88 | 88 | print '</div>'; // End comment-info |
| 89 | 89 | |
| 90 | 90 | print '<div class="comment-cell comment-right">'; |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | print '<div class="comment-description comment-cell">'; |
| 93 | 93 | print $comment->description; |
| 94 | 94 | print '</div>'; // End comment-description |
| 95 | - if(($first && $fk_user == $user->id) || $user->admin == 1) { |
|
| 95 | + if (($first && $fk_user == $user->id) || $user->admin == 1) { |
|
| 96 | 96 | print '<a class="comment-delete comment-cell" href="'.$varpage.'?action=deletecomment&id='.$id.'&withproject=1&idcomment='.$comment->id.'" title="'.$langs->trans('Delete').'">'; |
| 97 | 97 | print img_picto('', 'delete.png'); |
| 98 | 98 | print '</a>'; |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | print '</div>'; // End comment-right |
| 102 | 102 | print '</div>'; // End comment |
| 103 | 103 | |
| 104 | - if($fk_user == $user->id) { |
|
| 104 | + if ($fk_user == $user->id) { |
|
| 105 | 105 | print '<div class="width25p float"> </div>'; |
| 106 | 106 | } |
| 107 | 107 | print '<div class="clearboth"></div>'; |
@@ -47,484 +47,484 @@ |
||
| 47 | 47 | </script>'; |
| 48 | 48 | |
| 49 | 49 | |
| 50 | - print_fiche_titre($langs->trans("AdvTgtTitle")); |
|
| 51 | - |
|
| 52 | - print '<div class="tabBar">' . "\n"; |
|
| 53 | - print '<form name="find_customer" id="find_customer" action="' . $_SERVER['PHP_SELF'] . '?id=' . $id . '" method="POST">' . "\n"; |
|
| 54 | - print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">' . "\n"; |
|
| 55 | - print '<input type="hidden" name="action" value="">' . "\n"; |
|
| 56 | - print '<table class="border" width="100%">' . "\n"; |
|
| 57 | - |
|
| 58 | - print '<tr>' . "\n"; |
|
| 59 | - print '<td colspan="3" align="right">' . "\n"; |
|
| 60 | - |
|
| 61 | - print '<input type="button" name="addcontact" id="addcontact" value="' . $langs->trans('AdvTgtAddContact') . '" class="butAction"/>' . "\n"; |
|
| 62 | - |
|
| 63 | - print '</td>' . "\n"; |
|
| 64 | - print '</tr>' . "\n"; |
|
| 65 | - |
|
| 66 | - print '<tr><td>' . $langs->trans('AdvTgtNameTemplate') . '</td><td>'; |
|
| 67 | - if (! empty($template_id)) { |
|
| 68 | - $default_template = $template_id; |
|
| 69 | - } else { |
|
| 70 | - $default_template = $advTarget->id; |
|
| 71 | - } |
|
| 72 | - print $formadvtargetemaling->selectAdvtargetemailingTemplate('template_id', $default_template,0,$advTarget->type_element); |
|
| 73 | - print '<input type="button" name="loadfilter" id="loadfilter" value="' . $langs->trans('AdvTgtLoadFilter') . '" class="butAction"/>'; |
|
| 74 | - print '<input type="button" name="deletefilter" id="deletefilter" value="' . $langs->trans('AdvTgtDeleteFilter') . '" class="butAction"/>'; |
|
| 75 | - print '<input type="button" name="savefilter" id="savefilter" value="' . $langs->trans('AdvTgtSaveFilter') . '" class="butAction"/>'; |
|
| 76 | - print $langs->trans('AdvTgtOrCreateNewFilter'); |
|
| 77 | - print '<input type="text" name="template_name" id="template_name" value=""/>'; |
|
| 78 | - print '<input type="button" name="createfilter" id="createfilter" value="' . $langs->trans('AdvTgtCreateFilter') . '" class="butAction"/>'; |
|
| 79 | - print '</td><td>' . "\n"; |
|
| 80 | - print '</td></tr>' . "\n"; |
|
| 81 | - |
|
| 82 | - print '<tr><td>' . $langs->trans('AdvTgtTypeOfIncude') . '</td><td>'; |
|
| 83 | - print $form->selectarray('type_of_target', $advTarget->select_target_type, $array_query['type_of_target']); |
|
| 84 | - print '</td><td>' . "\n"; |
|
| 85 | - print $form->textwithpicto('', $langs->trans("AdvTgtTypeOfIncudeHelp"), 1, 'help'); |
|
| 86 | - print '</td></tr>' . "\n"; |
|
| 87 | - |
|
| 88 | - // Customer name |
|
| 89 | - print '<tr><td>' . $langs->trans('ThirdPartyName'); |
|
| 90 | - if (! empty($array_query['cust_name'])) { |
|
| 91 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 92 | - } |
|
| 93 | - print '</td><td><input type="text" name="cust_name" value="' . $array_query['cust_name'] . '"/></td><td>' . "\n"; |
|
| 94 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
| 95 | - print '</td></tr>' . "\n"; |
|
| 96 | - |
|
| 97 | - // Code Client |
|
| 98 | - print '<tr><td>' . $langs->trans('CustomerCode'); |
|
| 99 | - if (! empty($array_query['cust_code'])) { |
|
| 100 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 101 | - } |
|
| 102 | - print '</td><td><input type="text" name="cust_code" value="' . $array_query['cust_code'] . '"/></td><td>' . "\n"; |
|
| 103 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
| 104 | - print '</td></tr>' . "\n"; |
|
| 105 | - |
|
| 106 | - // Address Client |
|
| 107 | - print '<tr><td>' . $langs->trans('Address'); |
|
| 108 | - if (! empty($array_query['cust_adress'])) { |
|
| 109 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 110 | - } |
|
| 111 | - print '</td><td><input type="text" name="cust_adress" value="' . $array_query['cust_adress'] . '"/></td><td>' . "\n"; |
|
| 112 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
| 113 | - print '</td></tr>' . "\n"; |
|
| 114 | - |
|
| 115 | - // Zip Client |
|
| 116 | - print '<tr><td>' . $langs->trans('Zip'); |
|
| 117 | - if (! empty($array_query['cust_zip'])) { |
|
| 118 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 119 | - } |
|
| 120 | - print '</td><td><input type="text" name="cust_zip" value="' . $array_query['cust_zip'] . '"/></td><td>' . "\n"; |
|
| 121 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
| 122 | - print '</td></tr>' . "\n"; |
|
| 123 | - |
|
| 124 | - // City Client |
|
| 125 | - print '<tr><td>' . $langs->trans('Town'); |
|
| 126 | - if (! empty($array_query['cust_city'])) { |
|
| 127 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 128 | - } |
|
| 129 | - print '</td><td><input type="text" name="cust_city" value="' . $array_query['cust_city'] . '"/></td><td>' . "\n"; |
|
| 130 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
| 131 | - print '</td></tr>' . "\n"; |
|
| 132 | - |
|
| 133 | - // Customer Country |
|
| 134 | - print '<tr><td>' . $langs->trans("Country"); |
|
| 135 | - if (count($array_query['cust_country']) > 0) { |
|
| 136 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 137 | - } |
|
| 138 | - print '</td><td>' . "\n"; |
|
| 139 | - print $formadvtargetemaling->multiselectCountry('cust_country', $array_query['cust_country']); |
|
| 140 | - print '</td><td>' . "\n"; |
|
| 141 | - print '</td></tr>' . "\n"; |
|
| 142 | - |
|
| 143 | - // State Customer |
|
| 144 | - print '<tr><td>' . $langs->trans('Status') . ' ' . $langs->trans('ThirdParty'); |
|
| 145 | - if (count($array_query['cust_status']) > 0) { |
|
| 146 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 147 | - } |
|
| 148 | - print '</td><td>'; |
|
| 149 | - print $formadvtargetemaling->advMultiselectarray('cust_status', array ( |
|
| 150 | - '0' => $langs->trans('ActivityCeased'), |
|
| 151 | - '1' => $langs->trans('InActivity') |
|
| 152 | - ), $array_query['cust_status']); |
|
| 153 | - print '</td><td>' . "\n"; |
|
| 154 | - print '</td></tr>' . "\n"; |
|
| 155 | - |
|
| 156 | - // Mother Company |
|
| 157 | - print '<tr><td>' . $langs->trans("Maison mère"); |
|
| 158 | - if (! empty($array_query['cust_mothercompany'])) { |
|
| 159 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 160 | - } |
|
| 161 | - print '</td><td>' . "\n"; |
|
| 162 | - print '<input type="text" name="cust_mothercompany" value="' . $array_query['cust_mothercompany'] . '"/>'; |
|
| 163 | - print '</td><td>' . "\n"; |
|
| 164 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
| 165 | - print '</td></tr>' . "\n"; |
|
| 166 | - |
|
| 167 | - // Prospect/Customer |
|
| 168 | - $selected = $array_query['cust_typecust']; |
|
| 169 | - print '<tr><td>' . $langs->trans('ProspectCustomer') . ' ' . $langs->trans('ThirdParty'); |
|
| 170 | - if (count($array_query['cust_typecust']) > 0) { |
|
| 171 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 172 | - } |
|
| 173 | - print '</td><td>'; |
|
| 174 | - $options_array = array ( |
|
| 175 | - 2 => $langs->trans('Prospect'), |
|
| 176 | - 3 => $langs->trans('ProspectCustomer'), |
|
| 177 | - 1 => $langs->trans('Customer'), |
|
| 178 | - 0 => $langs->trans('NorProspectNorCustomer') |
|
| 179 | - ); |
|
| 180 | - print $formadvtargetemaling->advMultiselectarray('cust_typecust', $options_array, $array_query['cust_typecust']); |
|
| 181 | - print '</td><td>' . "\n"; |
|
| 182 | - print '</td></tr>' . "\n"; |
|
| 183 | - |
|
| 184 | - // Prospection status |
|
| 185 | - print '<tr><td>' . $langs->trans('ProspectLevel'); |
|
| 186 | - if (count($array_query['cust_prospect_status']) > 0) { |
|
| 187 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 188 | - } |
|
| 189 | - print '</td><td>'; |
|
| 190 | - print $formadvtargetemaling->multiselectProspectionStatus($array_query['cust_prospect_status'], 'cust_prospect_status', 1); |
|
| 191 | - print '</td><td>' . "\n"; |
|
| 192 | - print '</td></tr>' . "\n"; |
|
| 193 | - |
|
| 194 | - // Prospection comm status |
|
| 195 | - print '<tr><td>' . $langs->trans('StatusProsp'); |
|
| 196 | - if (count($array_query['cust_comm_status']) > 0) { |
|
| 197 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 198 | - } |
|
| 199 | - print '</td><td>'; |
|
| 200 | - print $formadvtargetemaling->advMultiselectarray('cust_comm_status', $advTarget->type_statuscommprospect, $array_query['cust_comm_status']); |
|
| 201 | - print '</td><td>' . "\n"; |
|
| 202 | - print '</td></tr>' . "\n"; |
|
| 203 | - |
|
| 204 | - // Customer Type |
|
| 205 | - print '<tr><td>' . $langs->trans("ThirdPartyType"); |
|
| 206 | - if (count($array_query['cust_typeent']) > 0) { |
|
| 207 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 208 | - } |
|
| 209 | - print '</td><td>' . "\n"; |
|
| 210 | - print $formadvtargetemaling->advMultiselectarray('cust_typeent', $formcompany->typent_array(0, " AND id <> 0"), $array_query['cust_typeent']); |
|
| 211 | - print '</td><td>' . "\n"; |
|
| 212 | - print '</td></tr>' . "\n"; |
|
| 213 | - |
|
| 214 | - // Staff number |
|
| 215 | - print '<td>' . $langs->trans("Staff"); |
|
| 216 | - if (count($array_query['cust_effectif_id']) > 0) { |
|
| 217 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 218 | - } |
|
| 219 | - print '</td><td>'; |
|
| 220 | - print $formadvtargetemaling->advMultiselectarray("cust_effectif_id", $formcompany->effectif_array(0, " AND id <> 0"), $array_query['cust_effectif_id']); |
|
| 221 | - print '</td><td>' . "\n"; |
|
| 222 | - print '</td></tr>' . "\n"; |
|
| 223 | - |
|
| 224 | - // Sales manager |
|
| 225 | - print '<tr><td>' . $langs->trans("SalesRepresentatives"); |
|
| 226 | - if (count($array_query['cust_saleman']) > 0) { |
|
| 227 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 228 | - } |
|
| 229 | - print '</td><td>' . "\n"; |
|
| 230 | - print $formadvtargetemaling->multiselectselectSalesRepresentatives('cust_saleman', $array_query['cust_saleman'], $user); |
|
| 231 | - print '</td><td>' . "\n"; |
|
| 232 | - print '</td></tr>' . "\n"; |
|
| 233 | - |
|
| 234 | - // Customer Default Langauge |
|
| 235 | - if (! empty($conf->global->MAIN_MULTILANGS)) { |
|
| 236 | - |
|
| 237 | - print '<tr><td>' . $langs->trans("DefaultLang"); |
|
| 238 | - if (count($array_query['cust_language']) > 0) { |
|
| 239 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 240 | - } |
|
| 241 | - print '</td><td>' . "\n"; |
|
| 242 | - print $formadvtargetemaling->multiselectselectLanguage('cust_language', $array_query['cust_language']); |
|
| 243 | - print '</td><td>' . "\n"; |
|
| 244 | - print '</td></tr>' . "\n"; |
|
| 245 | - } |
|
| 246 | - |
|
| 247 | - if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) { |
|
| 248 | - // Customer Categories |
|
| 249 | - print '<tr><td>' . $langs->trans("CustomersCategoryShort"); |
|
| 250 | - if (count($array_query['cust_categ']) > 0) { |
|
| 251 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 252 | - } |
|
| 253 | - print '</td><td>' . "\n"; |
|
| 254 | - print $formadvtargetemaling->multiselectCustomerCategories('cust_categ', $array_query['cust_categ']); |
|
| 255 | - print '</td><td>' . "\n"; |
|
| 256 | - print '</td></tr>' . "\n"; |
|
| 257 | - } |
|
| 258 | - |
|
| 259 | - // Standard Extrafield feature |
|
| 260 | - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { |
|
| 261 | - // fetch optionals attributes and labels |
|
| 262 | - dol_include_once('/core/class/extrafields.class.php'); |
|
| 263 | - $extrafields = new ExtraFields($db); |
|
| 264 | - $extralabels = $extrafields->fetch_name_optionals_label('societe'); |
|
| 265 | - foreach ( $extralabels as $key => $val ) { |
|
| 266 | - if ($key != 'ts_nameextra' && $key != 'ts_payeur') { |
|
| 267 | - print '<tr><td>' . $extrafields->attribute_label[$key]; |
|
| 268 | - if (! empty($array_query['options_' . $key]) || (is_array($array_query['options_' . $key]) && count($array_query['options_' . $key]) > 0)) { |
|
| 269 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 270 | - } |
|
| 271 | - print '</td><td>'; |
|
| 272 | - if (($extrafields->attribute_type[$key] == 'varchar') || ($extrafields->attribute_type[$key] == 'text')) { |
|
| 273 | - print '<input type="text" name="options_' . $key . '"/></td><td>' . "\n"; |
|
| 274 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
| 275 | - } elseif (($extrafields->attribute_type[$key] == 'int') || ($extrafields->attribute_type[$key] == 'double')) { |
|
| 276 | - print $langs->trans("AdvTgtMinVal") . '<input type="text" name="options' . $key . '_min"/>'; |
|
| 277 | - print $langs->trans("AdvTgtMaxVal") . '<input type="text" name="options' . $key . '_max"/>'; |
|
| 278 | - print '</td><td>' . "\n"; |
|
| 279 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchIntHelp"), 1, 'help'); |
|
| 280 | - } elseif (($extrafields->attribute_type[$key] == 'date') || ($extrafields->attribute_type[$key] == 'datetime')) { |
|
| 281 | - |
|
| 282 | - print '<table class="nobordernopadding"><tr>'; |
|
| 283 | - print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
| 284 | - print $form->selectDate('', 'options_' . $key . '_st_dt'); |
|
| 285 | - print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
| 286 | - print $form->selectDate('', 'options_' . $key . '_end_dt'); |
|
| 287 | - print '</td></tr></table>'; |
|
| 288 | - |
|
| 289 | - print '</td><td>' . "\n"; |
|
| 290 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help'); |
|
| 291 | - } elseif (($extrafields->attribute_type[$key] == 'boolean')) { |
|
| 292 | - print $form->selectarray('options_' . $key, array ( |
|
| 293 | - '' => '', |
|
| 294 | - '1' => $langs->trans('Yes'), |
|
| 295 | - '0' => $langs->trans('No') |
|
| 296 | - ), $array_query['options_' . $key]); |
|
| 297 | - print '</td><td>' . "\n"; |
|
| 298 | - } elseif (($extrafields->attribute_type[$key] == 'select')) { |
|
| 299 | - print $formadvtargetemaling->advMultiselectarray('options_' . $key, $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key]); |
|
| 300 | - print '</td><td>' . "\n"; |
|
| 301 | - } elseif (($extrafields->attribute_type[$key] == 'sellist')) { |
|
| 302 | - print $formadvtargetemaling->advMultiselectarraySelllist('options_' . $key, $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key]); |
|
| 303 | - print '</td><td>' . "\n"; |
|
| 304 | - } else { |
|
| 305 | - |
|
| 306 | - print '<table class="nobordernopadding"><tr>'; |
|
| 307 | - print '<td></td><td>'; |
|
| 308 | - if (is_array($array_query['options_' . $key])) { |
|
| 309 | - print $extrafields->showInputField($key, implode(',', $array_query['options_' . $key])); |
|
| 310 | - } else { |
|
| 311 | - print $extrafields->showInputField($key, $array_query['options_' . $key]); |
|
| 312 | - } |
|
| 313 | - print '</td></tr></table>'; |
|
| 314 | - |
|
| 315 | - print '</td><td>' . "\n"; |
|
| 316 | - } |
|
| 317 | - print '</td></tr>' . "\n"; |
|
| 318 | - } |
|
| 319 | - } |
|
| 320 | - } else { |
|
| 321 | - $std_soc = new Societe($db); |
|
| 322 | - $action_search = 'query'; |
|
| 323 | - |
|
| 324 | - // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context |
|
| 325 | - include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; |
|
| 326 | - $hookmanager = new HookManager($db); |
|
| 327 | - $hookmanager->initHooks(array ('thirdpartycard')); |
|
| 328 | - |
|
| 329 | - $parameters=array(); |
|
| 330 | - if (! empty($advTarget->id)) { |
|
| 331 | - $parameters = array('array_query' => $advTarget->filtervalue); |
|
| 332 | - } |
|
| 333 | - // Other attributes |
|
| 334 | - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $std_soc, $action_search); |
|
| 50 | + print_fiche_titre($langs->trans("AdvTgtTitle")); |
|
| 51 | + |
|
| 52 | + print '<div class="tabBar">' . "\n"; |
|
| 53 | + print '<form name="find_customer" id="find_customer" action="' . $_SERVER['PHP_SELF'] . '?id=' . $id . '" method="POST">' . "\n"; |
|
| 54 | + print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">' . "\n"; |
|
| 55 | + print '<input type="hidden" name="action" value="">' . "\n"; |
|
| 56 | + print '<table class="border" width="100%">' . "\n"; |
|
| 57 | + |
|
| 58 | + print '<tr>' . "\n"; |
|
| 59 | + print '<td colspan="3" align="right">' . "\n"; |
|
| 60 | + |
|
| 61 | + print '<input type="button" name="addcontact" id="addcontact" value="' . $langs->trans('AdvTgtAddContact') . '" class="butAction"/>' . "\n"; |
|
| 62 | + |
|
| 63 | + print '</td>' . "\n"; |
|
| 64 | + print '</tr>' . "\n"; |
|
| 65 | + |
|
| 66 | + print '<tr><td>' . $langs->trans('AdvTgtNameTemplate') . '</td><td>'; |
|
| 67 | + if (! empty($template_id)) { |
|
| 68 | + $default_template = $template_id; |
|
| 69 | + } else { |
|
| 70 | + $default_template = $advTarget->id; |
|
| 71 | + } |
|
| 72 | + print $formadvtargetemaling->selectAdvtargetemailingTemplate('template_id', $default_template,0,$advTarget->type_element); |
|
| 73 | + print '<input type="button" name="loadfilter" id="loadfilter" value="' . $langs->trans('AdvTgtLoadFilter') . '" class="butAction"/>'; |
|
| 74 | + print '<input type="button" name="deletefilter" id="deletefilter" value="' . $langs->trans('AdvTgtDeleteFilter') . '" class="butAction"/>'; |
|
| 75 | + print '<input type="button" name="savefilter" id="savefilter" value="' . $langs->trans('AdvTgtSaveFilter') . '" class="butAction"/>'; |
|
| 76 | + print $langs->trans('AdvTgtOrCreateNewFilter'); |
|
| 77 | + print '<input type="text" name="template_name" id="template_name" value=""/>'; |
|
| 78 | + print '<input type="button" name="createfilter" id="createfilter" value="' . $langs->trans('AdvTgtCreateFilter') . '" class="butAction"/>'; |
|
| 79 | + print '</td><td>' . "\n"; |
|
| 80 | + print '</td></tr>' . "\n"; |
|
| 81 | + |
|
| 82 | + print '<tr><td>' . $langs->trans('AdvTgtTypeOfIncude') . '</td><td>'; |
|
| 83 | + print $form->selectarray('type_of_target', $advTarget->select_target_type, $array_query['type_of_target']); |
|
| 84 | + print '</td><td>' . "\n"; |
|
| 85 | + print $form->textwithpicto('', $langs->trans("AdvTgtTypeOfIncudeHelp"), 1, 'help'); |
|
| 86 | + print '</td></tr>' . "\n"; |
|
| 87 | + |
|
| 88 | + // Customer name |
|
| 89 | + print '<tr><td>' . $langs->trans('ThirdPartyName'); |
|
| 90 | + if (! empty($array_query['cust_name'])) { |
|
| 91 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 92 | + } |
|
| 93 | + print '</td><td><input type="text" name="cust_name" value="' . $array_query['cust_name'] . '"/></td><td>' . "\n"; |
|
| 94 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
| 95 | + print '</td></tr>' . "\n"; |
|
| 96 | + |
|
| 97 | + // Code Client |
|
| 98 | + print '<tr><td>' . $langs->trans('CustomerCode'); |
|
| 99 | + if (! empty($array_query['cust_code'])) { |
|
| 100 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 101 | + } |
|
| 102 | + print '</td><td><input type="text" name="cust_code" value="' . $array_query['cust_code'] . '"/></td><td>' . "\n"; |
|
| 103 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
| 104 | + print '</td></tr>' . "\n"; |
|
| 105 | + |
|
| 106 | + // Address Client |
|
| 107 | + print '<tr><td>' . $langs->trans('Address'); |
|
| 108 | + if (! empty($array_query['cust_adress'])) { |
|
| 109 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 110 | + } |
|
| 111 | + print '</td><td><input type="text" name="cust_adress" value="' . $array_query['cust_adress'] . '"/></td><td>' . "\n"; |
|
| 112 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
| 113 | + print '</td></tr>' . "\n"; |
|
| 114 | + |
|
| 115 | + // Zip Client |
|
| 116 | + print '<tr><td>' . $langs->trans('Zip'); |
|
| 117 | + if (! empty($array_query['cust_zip'])) { |
|
| 118 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 119 | + } |
|
| 120 | + print '</td><td><input type="text" name="cust_zip" value="' . $array_query['cust_zip'] . '"/></td><td>' . "\n"; |
|
| 121 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
| 122 | + print '</td></tr>' . "\n"; |
|
| 123 | + |
|
| 124 | + // City Client |
|
| 125 | + print '<tr><td>' . $langs->trans('Town'); |
|
| 126 | + if (! empty($array_query['cust_city'])) { |
|
| 127 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 128 | + } |
|
| 129 | + print '</td><td><input type="text" name="cust_city" value="' . $array_query['cust_city'] . '"/></td><td>' . "\n"; |
|
| 130 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
| 131 | + print '</td></tr>' . "\n"; |
|
| 132 | + |
|
| 133 | + // Customer Country |
|
| 134 | + print '<tr><td>' . $langs->trans("Country"); |
|
| 135 | + if (count($array_query['cust_country']) > 0) { |
|
| 136 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 137 | + } |
|
| 138 | + print '</td><td>' . "\n"; |
|
| 139 | + print $formadvtargetemaling->multiselectCountry('cust_country', $array_query['cust_country']); |
|
| 140 | + print '</td><td>' . "\n"; |
|
| 141 | + print '</td></tr>' . "\n"; |
|
| 142 | + |
|
| 143 | + // State Customer |
|
| 144 | + print '<tr><td>' . $langs->trans('Status') . ' ' . $langs->trans('ThirdParty'); |
|
| 145 | + if (count($array_query['cust_status']) > 0) { |
|
| 146 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 147 | + } |
|
| 148 | + print '</td><td>'; |
|
| 149 | + print $formadvtargetemaling->advMultiselectarray('cust_status', array ( |
|
| 150 | + '0' => $langs->trans('ActivityCeased'), |
|
| 151 | + '1' => $langs->trans('InActivity') |
|
| 152 | + ), $array_query['cust_status']); |
|
| 153 | + print '</td><td>' . "\n"; |
|
| 154 | + print '</td></tr>' . "\n"; |
|
| 155 | + |
|
| 156 | + // Mother Company |
|
| 157 | + print '<tr><td>' . $langs->trans("Maison mère"); |
|
| 158 | + if (! empty($array_query['cust_mothercompany'])) { |
|
| 159 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 160 | + } |
|
| 161 | + print '</td><td>' . "\n"; |
|
| 162 | + print '<input type="text" name="cust_mothercompany" value="' . $array_query['cust_mothercompany'] . '"/>'; |
|
| 163 | + print '</td><td>' . "\n"; |
|
| 164 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
| 165 | + print '</td></tr>' . "\n"; |
|
| 166 | + |
|
| 167 | + // Prospect/Customer |
|
| 168 | + $selected = $array_query['cust_typecust']; |
|
| 169 | + print '<tr><td>' . $langs->trans('ProspectCustomer') . ' ' . $langs->trans('ThirdParty'); |
|
| 170 | + if (count($array_query['cust_typecust']) > 0) { |
|
| 171 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 172 | + } |
|
| 173 | + print '</td><td>'; |
|
| 174 | + $options_array = array ( |
|
| 175 | + 2 => $langs->trans('Prospect'), |
|
| 176 | + 3 => $langs->trans('ProspectCustomer'), |
|
| 177 | + 1 => $langs->trans('Customer'), |
|
| 178 | + 0 => $langs->trans('NorProspectNorCustomer') |
|
| 179 | + ); |
|
| 180 | + print $formadvtargetemaling->advMultiselectarray('cust_typecust', $options_array, $array_query['cust_typecust']); |
|
| 181 | + print '</td><td>' . "\n"; |
|
| 182 | + print '</td></tr>' . "\n"; |
|
| 183 | + |
|
| 184 | + // Prospection status |
|
| 185 | + print '<tr><td>' . $langs->trans('ProspectLevel'); |
|
| 186 | + if (count($array_query['cust_prospect_status']) > 0) { |
|
| 187 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 188 | + } |
|
| 189 | + print '</td><td>'; |
|
| 190 | + print $formadvtargetemaling->multiselectProspectionStatus($array_query['cust_prospect_status'], 'cust_prospect_status', 1); |
|
| 191 | + print '</td><td>' . "\n"; |
|
| 192 | + print '</td></tr>' . "\n"; |
|
| 193 | + |
|
| 194 | + // Prospection comm status |
|
| 195 | + print '<tr><td>' . $langs->trans('StatusProsp'); |
|
| 196 | + if (count($array_query['cust_comm_status']) > 0) { |
|
| 197 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 198 | + } |
|
| 199 | + print '</td><td>'; |
|
| 200 | + print $formadvtargetemaling->advMultiselectarray('cust_comm_status', $advTarget->type_statuscommprospect, $array_query['cust_comm_status']); |
|
| 201 | + print '</td><td>' . "\n"; |
|
| 202 | + print '</td></tr>' . "\n"; |
|
| 203 | + |
|
| 204 | + // Customer Type |
|
| 205 | + print '<tr><td>' . $langs->trans("ThirdPartyType"); |
|
| 206 | + if (count($array_query['cust_typeent']) > 0) { |
|
| 207 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 208 | + } |
|
| 209 | + print '</td><td>' . "\n"; |
|
| 210 | + print $formadvtargetemaling->advMultiselectarray('cust_typeent', $formcompany->typent_array(0, " AND id <> 0"), $array_query['cust_typeent']); |
|
| 211 | + print '</td><td>' . "\n"; |
|
| 212 | + print '</td></tr>' . "\n"; |
|
| 213 | + |
|
| 214 | + // Staff number |
|
| 215 | + print '<td>' . $langs->trans("Staff"); |
|
| 216 | + if (count($array_query['cust_effectif_id']) > 0) { |
|
| 217 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 218 | + } |
|
| 219 | + print '</td><td>'; |
|
| 220 | + print $formadvtargetemaling->advMultiselectarray("cust_effectif_id", $formcompany->effectif_array(0, " AND id <> 0"), $array_query['cust_effectif_id']); |
|
| 221 | + print '</td><td>' . "\n"; |
|
| 222 | + print '</td></tr>' . "\n"; |
|
| 223 | + |
|
| 224 | + // Sales manager |
|
| 225 | + print '<tr><td>' . $langs->trans("SalesRepresentatives"); |
|
| 226 | + if (count($array_query['cust_saleman']) > 0) { |
|
| 227 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 228 | + } |
|
| 229 | + print '</td><td>' . "\n"; |
|
| 230 | + print $formadvtargetemaling->multiselectselectSalesRepresentatives('cust_saleman', $array_query['cust_saleman'], $user); |
|
| 231 | + print '</td><td>' . "\n"; |
|
| 232 | + print '</td></tr>' . "\n"; |
|
| 233 | + |
|
| 234 | + // Customer Default Langauge |
|
| 235 | + if (! empty($conf->global->MAIN_MULTILANGS)) { |
|
| 236 | + |
|
| 237 | + print '<tr><td>' . $langs->trans("DefaultLang"); |
|
| 238 | + if (count($array_query['cust_language']) > 0) { |
|
| 239 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 240 | + } |
|
| 241 | + print '</td><td>' . "\n"; |
|
| 242 | + print $formadvtargetemaling->multiselectselectLanguage('cust_language', $array_query['cust_language']); |
|
| 243 | + print '</td><td>' . "\n"; |
|
| 244 | + print '</td></tr>' . "\n"; |
|
| 245 | + } |
|
| 246 | + |
|
| 247 | + if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) { |
|
| 248 | + // Customer Categories |
|
| 249 | + print '<tr><td>' . $langs->trans("CustomersCategoryShort"); |
|
| 250 | + if (count($array_query['cust_categ']) > 0) { |
|
| 251 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 252 | + } |
|
| 253 | + print '</td><td>' . "\n"; |
|
| 254 | + print $formadvtargetemaling->multiselectCustomerCategories('cust_categ', $array_query['cust_categ']); |
|
| 255 | + print '</td><td>' . "\n"; |
|
| 256 | + print '</td></tr>' . "\n"; |
|
| 257 | + } |
|
| 258 | + |
|
| 259 | + // Standard Extrafield feature |
|
| 260 | + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { |
|
| 261 | + // fetch optionals attributes and labels |
|
| 262 | + dol_include_once('/core/class/extrafields.class.php'); |
|
| 263 | + $extrafields = new ExtraFields($db); |
|
| 264 | + $extralabels = $extrafields->fetch_name_optionals_label('societe'); |
|
| 265 | + foreach ( $extralabels as $key => $val ) { |
|
| 266 | + if ($key != 'ts_nameextra' && $key != 'ts_payeur') { |
|
| 267 | + print '<tr><td>' . $extrafields->attribute_label[$key]; |
|
| 268 | + if (! empty($array_query['options_' . $key]) || (is_array($array_query['options_' . $key]) && count($array_query['options_' . $key]) > 0)) { |
|
| 269 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 270 | + } |
|
| 271 | + print '</td><td>'; |
|
| 272 | + if (($extrafields->attribute_type[$key] == 'varchar') || ($extrafields->attribute_type[$key] == 'text')) { |
|
| 273 | + print '<input type="text" name="options_' . $key . '"/></td><td>' . "\n"; |
|
| 274 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
| 275 | + } elseif (($extrafields->attribute_type[$key] == 'int') || ($extrafields->attribute_type[$key] == 'double')) { |
|
| 276 | + print $langs->trans("AdvTgtMinVal") . '<input type="text" name="options' . $key . '_min"/>'; |
|
| 277 | + print $langs->trans("AdvTgtMaxVal") . '<input type="text" name="options' . $key . '_max"/>'; |
|
| 278 | + print '</td><td>' . "\n"; |
|
| 279 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchIntHelp"), 1, 'help'); |
|
| 280 | + } elseif (($extrafields->attribute_type[$key] == 'date') || ($extrafields->attribute_type[$key] == 'datetime')) { |
|
| 281 | + |
|
| 282 | + print '<table class="nobordernopadding"><tr>'; |
|
| 283 | + print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
| 284 | + print $form->selectDate('', 'options_' . $key . '_st_dt'); |
|
| 285 | + print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
| 286 | + print $form->selectDate('', 'options_' . $key . '_end_dt'); |
|
| 287 | + print '</td></tr></table>'; |
|
| 288 | + |
|
| 289 | + print '</td><td>' . "\n"; |
|
| 290 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help'); |
|
| 291 | + } elseif (($extrafields->attribute_type[$key] == 'boolean')) { |
|
| 292 | + print $form->selectarray('options_' . $key, array ( |
|
| 293 | + '' => '', |
|
| 294 | + '1' => $langs->trans('Yes'), |
|
| 295 | + '0' => $langs->trans('No') |
|
| 296 | + ), $array_query['options_' . $key]); |
|
| 297 | + print '</td><td>' . "\n"; |
|
| 298 | + } elseif (($extrafields->attribute_type[$key] == 'select')) { |
|
| 299 | + print $formadvtargetemaling->advMultiselectarray('options_' . $key, $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key]); |
|
| 300 | + print '</td><td>' . "\n"; |
|
| 301 | + } elseif (($extrafields->attribute_type[$key] == 'sellist')) { |
|
| 302 | + print $formadvtargetemaling->advMultiselectarraySelllist('options_' . $key, $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key]); |
|
| 303 | + print '</td><td>' . "\n"; |
|
| 304 | + } else { |
|
| 305 | + |
|
| 306 | + print '<table class="nobordernopadding"><tr>'; |
|
| 307 | + print '<td></td><td>'; |
|
| 308 | + if (is_array($array_query['options_' . $key])) { |
|
| 309 | + print $extrafields->showInputField($key, implode(',', $array_query['options_' . $key])); |
|
| 310 | + } else { |
|
| 311 | + print $extrafields->showInputField($key, $array_query['options_' . $key]); |
|
| 312 | + } |
|
| 313 | + print '</td></tr></table>'; |
|
| 314 | + |
|
| 315 | + print '</td><td>' . "\n"; |
|
| 316 | + } |
|
| 317 | + print '</td></tr>' . "\n"; |
|
| 318 | + } |
|
| 319 | + } |
|
| 320 | + } else { |
|
| 321 | + $std_soc = new Societe($db); |
|
| 322 | + $action_search = 'query'; |
|
| 323 | + |
|
| 324 | + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context |
|
| 325 | + include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; |
|
| 326 | + $hookmanager = new HookManager($db); |
|
| 327 | + $hookmanager->initHooks(array ('thirdpartycard')); |
|
| 328 | + |
|
| 329 | + $parameters=array(); |
|
| 330 | + if (! empty($advTarget->id)) { |
|
| 331 | + $parameters = array('array_query' => $advTarget->filtervalue); |
|
| 332 | + } |
|
| 333 | + // Other attributes |
|
| 334 | + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $std_soc, $action_search); |
|
| 335 | 335 | print $hookmanager->resPrint; |
| 336 | - } |
|
| 337 | - |
|
| 338 | - // State Contact |
|
| 339 | - print '<tr><td>' . $langs->trans('Status') . ' ' . $langs->trans('Contact'); |
|
| 340 | - if (count($array_query['contact_status']) > 0) { |
|
| 341 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 342 | - } |
|
| 343 | - print '</td><td>'; |
|
| 344 | - print $formadvtargetemaling->advMultiselectarray('contact_status', array ( |
|
| 345 | - '0' => $langs->trans('ActivityCeased'), |
|
| 346 | - '1' => $langs->trans('InActivity') |
|
| 347 | - ), $array_query['contact_status']); |
|
| 348 | - print '</td><td>' . "\n"; |
|
| 349 | - print $form->textwithpicto('', $langs->trans("AdvTgtContactHelp"), 1, 'help'); |
|
| 350 | - print '</td></tr>' . "\n"; |
|
| 351 | - |
|
| 352 | - // Civility |
|
| 353 | - print '<tr><td width="15%">' . $langs->trans("UserTitle"); |
|
| 354 | - if (count($array_query['contact_civility']) > 0) { |
|
| 355 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 356 | - } |
|
| 357 | - print '</td><td>'; |
|
| 358 | - print $formadvtargetemaling->multiselectCivility('contact_civility', $array_query['contact_civility']); |
|
| 359 | - print '</td></tr>'; |
|
| 360 | - |
|
| 361 | - // contact name |
|
| 362 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans('Lastname'); |
|
| 363 | - if (! empty($array_query['contact_lastname'])) { |
|
| 364 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 365 | - } |
|
| 366 | - print '</td><td><input type="text" name="contact_lastname" value="' . $array_query['contact_lastname'] . '"/></td><td>' . "\n"; |
|
| 367 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
| 368 | - print '</td></tr>' . "\n"; |
|
| 369 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans('Firstname'); |
|
| 370 | - if (! empty($array_query['contact_firstname'])) { |
|
| 371 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 372 | - } |
|
| 373 | - print '</td><td><input type="text" name="contact_firstname" value="' . $array_query['contact_firstname'] . '"/></td><td>' . "\n"; |
|
| 374 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
| 375 | - print '</td></tr>' . "\n"; |
|
| 376 | - |
|
| 377 | - // Contact Country |
|
| 378 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("Country"); |
|
| 379 | - if (count($array_query['contact_country']) > 0) { |
|
| 380 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 381 | - } |
|
| 382 | - print '</td><td>' . "\n"; |
|
| 383 | - print $formadvtargetemaling->multiselectCountry('contact_country', $array_query['contact_country']); |
|
| 384 | - print '</td><td>' . "\n"; |
|
| 385 | - print '</td></tr>' . "\n"; |
|
| 386 | - |
|
| 387 | - // Never send mass mailing |
|
| 388 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("No_Email"); |
|
| 389 | - if (! empty($array_query['contact_no_email'])) { |
|
| 390 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 391 | - } |
|
| 392 | - print '</td><td>' . "\n"; |
|
| 393 | - print $form->selectarray('contact_no_email', array ( |
|
| 394 | - '' => '', |
|
| 395 | - '1' => $langs->trans('Yes'), |
|
| 396 | - '0' => $langs->trans('No') |
|
| 397 | - ), $array_query['contact_no_email']); |
|
| 398 | - print '</td><td>' . "\n"; |
|
| 399 | - print '</td></tr>' . "\n"; |
|
| 400 | - |
|
| 401 | - // Contact Date Create |
|
| 402 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("DateCreation"); |
|
| 403 | - if (! empty($array_query['contact_create_st_dt'])) { |
|
| 404 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 405 | - } |
|
| 406 | - print '</td><td>' . "\n"; |
|
| 407 | - print '<table class="nobordernopadding"><tr>'; |
|
| 408 | - print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
| 409 | - print $form->selectDate($array_query['contact_create_st_dt'], 'contact_create_st_dt', 0, 0, 1, 'find_customer', 1, 1); |
|
| 410 | - print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
| 411 | - print $form->selectDate($array_query['contact_create_end_dt'], 'contact_create_end_dt', 0, 0, 1, 'find_customer', 1, 1); |
|
| 412 | - print '</td></tr></table>'; |
|
| 413 | - print '</td><td>' . "\n"; |
|
| 414 | - print '</td></tr>' . "\n"; |
|
| 415 | - |
|
| 416 | - // Contact update Create |
|
| 417 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("DateLastModification"); |
|
| 418 | - if (! empty($array_query['contact_update_st_dt'])) { |
|
| 419 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 420 | - } |
|
| 421 | - print '</td><td>' . "\n"; |
|
| 422 | - print '<table class="nobordernopadding"><tr>'; |
|
| 423 | - print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
| 424 | - print $form->selectDate($array_query['contact_update_st_dt'], 'contact_update_st_dt', 0, 0, 1, 'find_customer', 1, 1); |
|
| 425 | - print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
| 426 | - print $form->selectDate($array_query['contact_update_end_dt'], 'contact_update_end_dt', 0, 0, 1, 'find_customer', 1, 1); |
|
| 427 | - print '</td></tr></table>'; |
|
| 428 | - print '</td><td>' . "\n"; |
|
| 429 | - print '</td></tr>' . "\n"; |
|
| 430 | - |
|
| 431 | - if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) { |
|
| 432 | - // Customer Categories |
|
| 433 | - print '<tr><td>' . $langs->trans("ContactCategoriesShort"); |
|
| 434 | - if (count($array_query['contact_categ']) > 0) { |
|
| 435 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 436 | - } |
|
| 437 | - print '</td><td>' . "\n"; |
|
| 438 | - print $formadvtargetemaling->multiselectContactCategories('contact_categ', $array_query['contact_categ']); |
|
| 439 | - print '</td><td>' . "\n"; |
|
| 440 | - print '</td></tr>' . "\n"; |
|
| 441 | - } |
|
| 442 | - |
|
| 443 | - // Standard Extrafield feature |
|
| 444 | - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { |
|
| 445 | - // fetch optionals attributes and labels |
|
| 446 | - dol_include_once('/core/class/extrafields.class.php'); |
|
| 447 | - $extrafields = new ExtraFields($db); |
|
| 448 | - $extralabels = $extrafields->fetch_name_optionals_label('socpeople'); |
|
| 336 | + } |
|
| 337 | + |
|
| 338 | + // State Contact |
|
| 339 | + print '<tr><td>' . $langs->trans('Status') . ' ' . $langs->trans('Contact'); |
|
| 340 | + if (count($array_query['contact_status']) > 0) { |
|
| 341 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 342 | + } |
|
| 343 | + print '</td><td>'; |
|
| 344 | + print $formadvtargetemaling->advMultiselectarray('contact_status', array ( |
|
| 345 | + '0' => $langs->trans('ActivityCeased'), |
|
| 346 | + '1' => $langs->trans('InActivity') |
|
| 347 | + ), $array_query['contact_status']); |
|
| 348 | + print '</td><td>' . "\n"; |
|
| 349 | + print $form->textwithpicto('', $langs->trans("AdvTgtContactHelp"), 1, 'help'); |
|
| 350 | + print '</td></tr>' . "\n"; |
|
| 351 | + |
|
| 352 | + // Civility |
|
| 353 | + print '<tr><td width="15%">' . $langs->trans("UserTitle"); |
|
| 354 | + if (count($array_query['contact_civility']) > 0) { |
|
| 355 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 356 | + } |
|
| 357 | + print '</td><td>'; |
|
| 358 | + print $formadvtargetemaling->multiselectCivility('contact_civility', $array_query['contact_civility']); |
|
| 359 | + print '</td></tr>'; |
|
| 360 | + |
|
| 361 | + // contact name |
|
| 362 | + print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans('Lastname'); |
|
| 363 | + if (! empty($array_query['contact_lastname'])) { |
|
| 364 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 365 | + } |
|
| 366 | + print '</td><td><input type="text" name="contact_lastname" value="' . $array_query['contact_lastname'] . '"/></td><td>' . "\n"; |
|
| 367 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
| 368 | + print '</td></tr>' . "\n"; |
|
| 369 | + print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans('Firstname'); |
|
| 370 | + if (! empty($array_query['contact_firstname'])) { |
|
| 371 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 372 | + } |
|
| 373 | + print '</td><td><input type="text" name="contact_firstname" value="' . $array_query['contact_firstname'] . '"/></td><td>' . "\n"; |
|
| 374 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
| 375 | + print '</td></tr>' . "\n"; |
|
| 376 | + |
|
| 377 | + // Contact Country |
|
| 378 | + print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("Country"); |
|
| 379 | + if (count($array_query['contact_country']) > 0) { |
|
| 380 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 381 | + } |
|
| 382 | + print '</td><td>' . "\n"; |
|
| 383 | + print $formadvtargetemaling->multiselectCountry('contact_country', $array_query['contact_country']); |
|
| 384 | + print '</td><td>' . "\n"; |
|
| 385 | + print '</td></tr>' . "\n"; |
|
| 386 | + |
|
| 387 | + // Never send mass mailing |
|
| 388 | + print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("No_Email"); |
|
| 389 | + if (! empty($array_query['contact_no_email'])) { |
|
| 390 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 391 | + } |
|
| 392 | + print '</td><td>' . "\n"; |
|
| 393 | + print $form->selectarray('contact_no_email', array ( |
|
| 394 | + '' => '', |
|
| 395 | + '1' => $langs->trans('Yes'), |
|
| 396 | + '0' => $langs->trans('No') |
|
| 397 | + ), $array_query['contact_no_email']); |
|
| 398 | + print '</td><td>' . "\n"; |
|
| 399 | + print '</td></tr>' . "\n"; |
|
| 400 | + |
|
| 401 | + // Contact Date Create |
|
| 402 | + print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("DateCreation"); |
|
| 403 | + if (! empty($array_query['contact_create_st_dt'])) { |
|
| 404 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 405 | + } |
|
| 406 | + print '</td><td>' . "\n"; |
|
| 407 | + print '<table class="nobordernopadding"><tr>'; |
|
| 408 | + print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
| 409 | + print $form->selectDate($array_query['contact_create_st_dt'], 'contact_create_st_dt', 0, 0, 1, 'find_customer', 1, 1); |
|
| 410 | + print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
| 411 | + print $form->selectDate($array_query['contact_create_end_dt'], 'contact_create_end_dt', 0, 0, 1, 'find_customer', 1, 1); |
|
| 412 | + print '</td></tr></table>'; |
|
| 413 | + print '</td><td>' . "\n"; |
|
| 414 | + print '</td></tr>' . "\n"; |
|
| 415 | + |
|
| 416 | + // Contact update Create |
|
| 417 | + print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("DateLastModification"); |
|
| 418 | + if (! empty($array_query['contact_update_st_dt'])) { |
|
| 419 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 420 | + } |
|
| 421 | + print '</td><td>' . "\n"; |
|
| 422 | + print '<table class="nobordernopadding"><tr>'; |
|
| 423 | + print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
| 424 | + print $form->selectDate($array_query['contact_update_st_dt'], 'contact_update_st_dt', 0, 0, 1, 'find_customer', 1, 1); |
|
| 425 | + print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
| 426 | + print $form->selectDate($array_query['contact_update_end_dt'], 'contact_update_end_dt', 0, 0, 1, 'find_customer', 1, 1); |
|
| 427 | + print '</td></tr></table>'; |
|
| 428 | + print '</td><td>' . "\n"; |
|
| 429 | + print '</td></tr>' . "\n"; |
|
| 430 | + |
|
| 431 | + if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) { |
|
| 432 | + // Customer Categories |
|
| 433 | + print '<tr><td>' . $langs->trans("ContactCategoriesShort"); |
|
| 434 | + if (count($array_query['contact_categ']) > 0) { |
|
| 435 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 436 | + } |
|
| 437 | + print '</td><td>' . "\n"; |
|
| 438 | + print $formadvtargetemaling->multiselectContactCategories('contact_categ', $array_query['contact_categ']); |
|
| 439 | + print '</td><td>' . "\n"; |
|
| 440 | + print '</td></tr>' . "\n"; |
|
| 441 | + } |
|
| 442 | + |
|
| 443 | + // Standard Extrafield feature |
|
| 444 | + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { |
|
| 445 | + // fetch optionals attributes and labels |
|
| 446 | + dol_include_once('/core/class/extrafields.class.php'); |
|
| 447 | + $extrafields = new ExtraFields($db); |
|
| 448 | + $extralabels = $extrafields->fetch_name_optionals_label('socpeople'); |
|
| 449 | 449 | foreach($extrafields->attribute_type as $key=>&$value) { |
| 450 | 450 | if($value == 'radio')$value = 'select'; |
| 451 | 451 | } |
| 452 | 452 | |
| 453 | 453 | |
| 454 | - foreach ( $extralabels as $key => $val ) { |
|
| 455 | - |
|
| 456 | - print '<tr><td>' . $extrafields->attribute_label[$key]; |
|
| 457 | - if ($array_query['options_' . $key . '_cnct'] != '' || (is_array($array_query['options_' . $key . '_cnct']) && count($array_query['options_' . $key . '_cnct']) > 0)) { |
|
| 458 | - print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 459 | - } |
|
| 460 | - print '</td><td>'; |
|
| 461 | - if (($extrafields->attribute_type[$key] == 'varchar') || ($extrafields->attribute_type[$key] == 'text')) { |
|
| 462 | - print '<input type="text" name="options_' . $key . '_cnct"/></td><td>' . "\n"; |
|
| 463 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
| 464 | - } elseif (($extrafields->attribute_type[$key] == 'int') || ($extrafields->attribute_type[$key] == 'double')) { |
|
| 465 | - print $langs->trans("AdvTgtMinVal") . '<input type="text" name="options_' . $key . '_min_cnct"/>'; |
|
| 466 | - print $langs->trans("AdvTgtMaxVal") . '<input type="text" name="options_' . $key . '_max_cnct"/>'; |
|
| 467 | - print '</td><td>' . "\n"; |
|
| 468 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchIntHelp"), 1, 'help'); |
|
| 469 | - } elseif (($extrafields->attribute_type[$key] == 'date') || ($extrafields->attribute_type[$key] == 'datetime')) { |
|
| 470 | - |
|
| 471 | - print '<table class="nobordernopadding"><tr>'; |
|
| 472 | - print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
| 473 | - print $form->selectDate('', 'options_' . $key . '_st_dt' . '_cnct'); |
|
| 474 | - print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
| 475 | - print $form->selectDate('', 'options_' . $key . '_end_dt' . '_cnct'); |
|
| 476 | - print '</td></tr></table>'; |
|
| 477 | - |
|
| 478 | - print '</td><td>' . "\n"; |
|
| 479 | - print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help'); |
|
| 480 | - } elseif (($extrafields->attribute_type[$key] == 'boolean')) { |
|
| 481 | - print $form->selectarray('options_' . $key . '_cnct', array ( |
|
| 482 | - '' => '', |
|
| 483 | - '1' => $langs->trans('Yes'), |
|
| 484 | - '0' => $langs->trans('No') |
|
| 485 | - ), $array_query['options_' . $key . '_cnct']); |
|
| 486 | - print '</td><td>' . "\n"; |
|
| 487 | - } elseif (($extrafields->attribute_type[$key] == 'select')) { |
|
| 488 | - print $formadvtargetemaling->advMultiselectarray('options_' . $key . '_cnct', $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key . '_cnct']); |
|
| 489 | - print '</td><td>' . "\n"; |
|
| 490 | - } elseif (($extrafields->attribute_type[$key] == 'sellist')) { |
|
| 491 | - print $formadvtargetemaling->advMultiselectarraySelllist('options_' . $key . '_cnct', $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key . '_cnct']); |
|
| 492 | - print '</td><td>' . "\n"; |
|
| 493 | - } else { |
|
| 494 | - |
|
| 495 | - print '<table class="nobordernopadding"><tr>'; |
|
| 496 | - print '<td></td><td>'; |
|
| 497 | - if (is_array($array_query['options_' . $key . '_cnct'])) { |
|
| 498 | - print $extrafields->showInputField($key, implode(',', $array_query['options_' . $key . '_cnct']), '', '_cnct'); |
|
| 499 | - } else { |
|
| 500 | - print $extrafields->showInputField($key, $array_query['options_' . $key . '_cnct'], '', '_cnct'); |
|
| 501 | - } |
|
| 502 | - print '</td></tr></table>'; |
|
| 503 | - |
|
| 504 | - print '</td><td>' . "\n"; |
|
| 505 | - } |
|
| 506 | - print '</td></tr>' . "\n"; |
|
| 507 | - } |
|
| 508 | - } |
|
| 509 | - |
|
| 510 | - print '<tr>' . "\n"; |
|
| 511 | - print '<td colspan="3" align="right">' . "\n"; |
|
| 512 | - |
|
| 513 | - print '<input type="button" name="addcontact" id="addcontact" value="' . $langs->trans('AdvTgtAddContact') . '" class="butAction"/>' . "\n"; |
|
| 514 | - |
|
| 515 | - print '</td>' . "\n"; |
|
| 516 | - print '</tr>' . "\n"; |
|
| 517 | - print '</table>' . "\n"; |
|
| 518 | - print '</form>' . "\n"; |
|
| 519 | - print '</div>' . "\n"; |
|
| 520 | - |
|
| 521 | - print '<form action="' . $_SERVER['PHP_SELF'] . '?action=clear&id=' . $object->id . '" method="POST">'; |
|
| 522 | - print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; |
|
| 523 | - print_titre($langs->trans("ToClearAllRecipientsClickHere")); |
|
| 524 | - print '<table class="noborder" width="100%">'; |
|
| 525 | - print '<tr class="liste_titre">'; |
|
| 526 | - print '<td class="liste_titre" align="right"><input type="submit" class="button" value="' . $langs->trans("TargetsReset") . '"></td>'; |
|
| 527 | - print '</tr>'; |
|
| 528 | - print '</table>'; |
|
| 529 | - print '</form>'; |
|
| 530 | - print '<br>'; |
|
| 531 | 454 | \ No newline at end of file |
| 455 | + foreach ( $extralabels as $key => $val ) { |
|
| 456 | + |
|
| 457 | + print '<tr><td>' . $extrafields->attribute_label[$key]; |
|
| 458 | + if ($array_query['options_' . $key . '_cnct'] != '' || (is_array($array_query['options_' . $key . '_cnct']) && count($array_query['options_' . $key . '_cnct']) > 0)) { |
|
| 459 | + print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
|
| 460 | + } |
|
| 461 | + print '</td><td>'; |
|
| 462 | + if (($extrafields->attribute_type[$key] == 'varchar') || ($extrafields->attribute_type[$key] == 'text')) { |
|
| 463 | + print '<input type="text" name="options_' . $key . '_cnct"/></td><td>' . "\n"; |
|
| 464 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
|
| 465 | + } elseif (($extrafields->attribute_type[$key] == 'int') || ($extrafields->attribute_type[$key] == 'double')) { |
|
| 466 | + print $langs->trans("AdvTgtMinVal") . '<input type="text" name="options_' . $key . '_min_cnct"/>'; |
|
| 467 | + print $langs->trans("AdvTgtMaxVal") . '<input type="text" name="options_' . $key . '_max_cnct"/>'; |
|
| 468 | + print '</td><td>' . "\n"; |
|
| 469 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchIntHelp"), 1, 'help'); |
|
| 470 | + } elseif (($extrafields->attribute_type[$key] == 'date') || ($extrafields->attribute_type[$key] == 'datetime')) { |
|
| 471 | + |
|
| 472 | + print '<table class="nobordernopadding"><tr>'; |
|
| 473 | + print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
| 474 | + print $form->selectDate('', 'options_' . $key . '_st_dt' . '_cnct'); |
|
| 475 | + print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
| 476 | + print $form->selectDate('', 'options_' . $key . '_end_dt' . '_cnct'); |
|
| 477 | + print '</td></tr></table>'; |
|
| 478 | + |
|
| 479 | + print '</td><td>' . "\n"; |
|
| 480 | + print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help'); |
|
| 481 | + } elseif (($extrafields->attribute_type[$key] == 'boolean')) { |
|
| 482 | + print $form->selectarray('options_' . $key . '_cnct', array ( |
|
| 483 | + '' => '', |
|
| 484 | + '1' => $langs->trans('Yes'), |
|
| 485 | + '0' => $langs->trans('No') |
|
| 486 | + ), $array_query['options_' . $key . '_cnct']); |
|
| 487 | + print '</td><td>' . "\n"; |
|
| 488 | + } elseif (($extrafields->attribute_type[$key] == 'select')) { |
|
| 489 | + print $formadvtargetemaling->advMultiselectarray('options_' . $key . '_cnct', $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key . '_cnct']); |
|
| 490 | + print '</td><td>' . "\n"; |
|
| 491 | + } elseif (($extrafields->attribute_type[$key] == 'sellist')) { |
|
| 492 | + print $formadvtargetemaling->advMultiselectarraySelllist('options_' . $key . '_cnct', $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key . '_cnct']); |
|
| 493 | + print '</td><td>' . "\n"; |
|
| 494 | + } else { |
|
| 495 | + |
|
| 496 | + print '<table class="nobordernopadding"><tr>'; |
|
| 497 | + print '<td></td><td>'; |
|
| 498 | + if (is_array($array_query['options_' . $key . '_cnct'])) { |
|
| 499 | + print $extrafields->showInputField($key, implode(',', $array_query['options_' . $key . '_cnct']), '', '_cnct'); |
|
| 500 | + } else { |
|
| 501 | + print $extrafields->showInputField($key, $array_query['options_' . $key . '_cnct'], '', '_cnct'); |
|
| 502 | + } |
|
| 503 | + print '</td></tr></table>'; |
|
| 504 | + |
|
| 505 | + print '</td><td>' . "\n"; |
|
| 506 | + } |
|
| 507 | + print '</td></tr>' . "\n"; |
|
| 508 | + } |
|
| 509 | + } |
|
| 510 | + |
|
| 511 | + print '<tr>' . "\n"; |
|
| 512 | + print '<td colspan="3" align="right">' . "\n"; |
|
| 513 | + |
|
| 514 | + print '<input type="button" name="addcontact" id="addcontact" value="' . $langs->trans('AdvTgtAddContact') . '" class="butAction"/>' . "\n"; |
|
| 515 | + |
|
| 516 | + print '</td>' . "\n"; |
|
| 517 | + print '</tr>' . "\n"; |
|
| 518 | + print '</table>' . "\n"; |
|
| 519 | + print '</form>' . "\n"; |
|
| 520 | + print '</div>' . "\n"; |
|
| 521 | + |
|
| 522 | + print '<form action="' . $_SERVER['PHP_SELF'] . '?action=clear&id=' . $object->id . '" method="POST">'; |
|
| 523 | + print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; |
|
| 524 | + print_titre($langs->trans("ToClearAllRecipientsClickHere")); |
|
| 525 | + print '<table class="noborder" width="100%">'; |
|
| 526 | + print '<tr class="liste_titre">'; |
|
| 527 | + print '<td class="liste_titre" align="right"><input type="submit" class="button" value="' . $langs->trans("TargetsReset") . '"></td>'; |
|
| 528 | + print '</tr>'; |
|
| 529 | + print '</table>'; |
|
| 530 | + print '</form>'; |
|
| 531 | + print '<br>'; |
|
| 532 | 532 | \ No newline at end of file |
@@ -49,211 +49,211 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | print_fiche_titre($langs->trans("AdvTgtTitle")); |
| 51 | 51 | |
| 52 | - print '<div class="tabBar">' . "\n"; |
|
| 53 | - print '<form name="find_customer" id="find_customer" action="' . $_SERVER['PHP_SELF'] . '?id=' . $id . '" method="POST">' . "\n"; |
|
| 54 | - print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">' . "\n"; |
|
| 55 | - print '<input type="hidden" name="action" value="">' . "\n"; |
|
| 56 | - print '<table class="border" width="100%">' . "\n"; |
|
| 52 | + print '<div class="tabBar">'."\n"; |
|
| 53 | + print '<form name="find_customer" id="find_customer" action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">'."\n"; |
|
| 54 | + print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'."\n"; |
|
| 55 | + print '<input type="hidden" name="action" value="">'."\n"; |
|
| 56 | + print '<table class="border" width="100%">'."\n"; |
|
| 57 | 57 | |
| 58 | - print '<tr>' . "\n"; |
|
| 59 | - print '<td colspan="3" align="right">' . "\n"; |
|
| 58 | + print '<tr>'."\n"; |
|
| 59 | + print '<td colspan="3" align="right">'."\n"; |
|
| 60 | 60 | |
| 61 | - print '<input type="button" name="addcontact" id="addcontact" value="' . $langs->trans('AdvTgtAddContact') . '" class="butAction"/>' . "\n"; |
|
| 61 | + print '<input type="button" name="addcontact" id="addcontact" value="'.$langs->trans('AdvTgtAddContact').'" class="butAction"/>'."\n"; |
|
| 62 | 62 | |
| 63 | - print '</td>' . "\n"; |
|
| 64 | - print '</tr>' . "\n"; |
|
| 63 | + print '</td>'."\n"; |
|
| 64 | + print '</tr>'."\n"; |
|
| 65 | 65 | |
| 66 | - print '<tr><td>' . $langs->trans('AdvTgtNameTemplate') . '</td><td>'; |
|
| 67 | - if (! empty($template_id)) { |
|
| 66 | + print '<tr><td>'.$langs->trans('AdvTgtNameTemplate').'</td><td>'; |
|
| 67 | + if (!empty($template_id)) { |
|
| 68 | 68 | $default_template = $template_id; |
| 69 | 69 | } else { |
| 70 | 70 | $default_template = $advTarget->id; |
| 71 | 71 | } |
| 72 | - print $formadvtargetemaling->selectAdvtargetemailingTemplate('template_id', $default_template,0,$advTarget->type_element); |
|
| 73 | - print '<input type="button" name="loadfilter" id="loadfilter" value="' . $langs->trans('AdvTgtLoadFilter') . '" class="butAction"/>'; |
|
| 74 | - print '<input type="button" name="deletefilter" id="deletefilter" value="' . $langs->trans('AdvTgtDeleteFilter') . '" class="butAction"/>'; |
|
| 75 | - print '<input type="button" name="savefilter" id="savefilter" value="' . $langs->trans('AdvTgtSaveFilter') . '" class="butAction"/>'; |
|
| 72 | + print $formadvtargetemaling->selectAdvtargetemailingTemplate('template_id', $default_template, 0, $advTarget->type_element); |
|
| 73 | + print '<input type="button" name="loadfilter" id="loadfilter" value="'.$langs->trans('AdvTgtLoadFilter').'" class="butAction"/>'; |
|
| 74 | + print '<input type="button" name="deletefilter" id="deletefilter" value="'.$langs->trans('AdvTgtDeleteFilter').'" class="butAction"/>'; |
|
| 75 | + print '<input type="button" name="savefilter" id="savefilter" value="'.$langs->trans('AdvTgtSaveFilter').'" class="butAction"/>'; |
|
| 76 | 76 | print $langs->trans('AdvTgtOrCreateNewFilter'); |
| 77 | 77 | print '<input type="text" name="template_name" id="template_name" value=""/>'; |
| 78 | - print '<input type="button" name="createfilter" id="createfilter" value="' . $langs->trans('AdvTgtCreateFilter') . '" class="butAction"/>'; |
|
| 79 | - print '</td><td>' . "\n"; |
|
| 80 | - print '</td></tr>' . "\n"; |
|
| 78 | + print '<input type="button" name="createfilter" id="createfilter" value="'.$langs->trans('AdvTgtCreateFilter').'" class="butAction"/>'; |
|
| 79 | + print '</td><td>'."\n"; |
|
| 80 | + print '</td></tr>'."\n"; |
|
| 81 | 81 | |
| 82 | - print '<tr><td>' . $langs->trans('AdvTgtTypeOfIncude') . '</td><td>'; |
|
| 82 | + print '<tr><td>'.$langs->trans('AdvTgtTypeOfIncude').'</td><td>'; |
|
| 83 | 83 | print $form->selectarray('type_of_target', $advTarget->select_target_type, $array_query['type_of_target']); |
| 84 | - print '</td><td>' . "\n"; |
|
| 84 | + print '</td><td>'."\n"; |
|
| 85 | 85 | print $form->textwithpicto('', $langs->trans("AdvTgtTypeOfIncudeHelp"), 1, 'help'); |
| 86 | - print '</td></tr>' . "\n"; |
|
| 86 | + print '</td></tr>'."\n"; |
|
| 87 | 87 | |
| 88 | 88 | // Customer name |
| 89 | - print '<tr><td>' . $langs->trans('ThirdPartyName'); |
|
| 90 | - if (! empty($array_query['cust_name'])) { |
|
| 89 | + print '<tr><td>'.$langs->trans('ThirdPartyName'); |
|
| 90 | + if (!empty($array_query['cust_name'])) { |
|
| 91 | 91 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 92 | 92 | } |
| 93 | - print '</td><td><input type="text" name="cust_name" value="' . $array_query['cust_name'] . '"/></td><td>' . "\n"; |
|
| 93 | + print '</td><td><input type="text" name="cust_name" value="'.$array_query['cust_name'].'"/></td><td>'."\n"; |
|
| 94 | 94 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
| 95 | - print '</td></tr>' . "\n"; |
|
| 95 | + print '</td></tr>'."\n"; |
|
| 96 | 96 | |
| 97 | 97 | // Code Client |
| 98 | - print '<tr><td>' . $langs->trans('CustomerCode'); |
|
| 99 | - if (! empty($array_query['cust_code'])) { |
|
| 98 | + print '<tr><td>'.$langs->trans('CustomerCode'); |
|
| 99 | + if (!empty($array_query['cust_code'])) { |
|
| 100 | 100 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 101 | 101 | } |
| 102 | - print '</td><td><input type="text" name="cust_code" value="' . $array_query['cust_code'] . '"/></td><td>' . "\n"; |
|
| 102 | + print '</td><td><input type="text" name="cust_code" value="'.$array_query['cust_code'].'"/></td><td>'."\n"; |
|
| 103 | 103 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
| 104 | - print '</td></tr>' . "\n"; |
|
| 104 | + print '</td></tr>'."\n"; |
|
| 105 | 105 | |
| 106 | 106 | // Address Client |
| 107 | - print '<tr><td>' . $langs->trans('Address'); |
|
| 108 | - if (! empty($array_query['cust_adress'])) { |
|
| 107 | + print '<tr><td>'.$langs->trans('Address'); |
|
| 108 | + if (!empty($array_query['cust_adress'])) { |
|
| 109 | 109 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 110 | 110 | } |
| 111 | - print '</td><td><input type="text" name="cust_adress" value="' . $array_query['cust_adress'] . '"/></td><td>' . "\n"; |
|
| 111 | + print '</td><td><input type="text" name="cust_adress" value="'.$array_query['cust_adress'].'"/></td><td>'."\n"; |
|
| 112 | 112 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
| 113 | - print '</td></tr>' . "\n"; |
|
| 113 | + print '</td></tr>'."\n"; |
|
| 114 | 114 | |
| 115 | 115 | // Zip Client |
| 116 | - print '<tr><td>' . $langs->trans('Zip'); |
|
| 117 | - if (! empty($array_query['cust_zip'])) { |
|
| 116 | + print '<tr><td>'.$langs->trans('Zip'); |
|
| 117 | + if (!empty($array_query['cust_zip'])) { |
|
| 118 | 118 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 119 | 119 | } |
| 120 | - print '</td><td><input type="text" name="cust_zip" value="' . $array_query['cust_zip'] . '"/></td><td>' . "\n"; |
|
| 120 | + print '</td><td><input type="text" name="cust_zip" value="'.$array_query['cust_zip'].'"/></td><td>'."\n"; |
|
| 121 | 121 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
| 122 | - print '</td></tr>' . "\n"; |
|
| 122 | + print '</td></tr>'."\n"; |
|
| 123 | 123 | |
| 124 | 124 | // City Client |
| 125 | - print '<tr><td>' . $langs->trans('Town'); |
|
| 126 | - if (! empty($array_query['cust_city'])) { |
|
| 125 | + print '<tr><td>'.$langs->trans('Town'); |
|
| 126 | + if (!empty($array_query['cust_city'])) { |
|
| 127 | 127 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 128 | 128 | } |
| 129 | - print '</td><td><input type="text" name="cust_city" value="' . $array_query['cust_city'] . '"/></td><td>' . "\n"; |
|
| 129 | + print '</td><td><input type="text" name="cust_city" value="'.$array_query['cust_city'].'"/></td><td>'."\n"; |
|
| 130 | 130 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
| 131 | - print '</td></tr>' . "\n"; |
|
| 131 | + print '</td></tr>'."\n"; |
|
| 132 | 132 | |
| 133 | 133 | // Customer Country |
| 134 | - print '<tr><td>' . $langs->trans("Country"); |
|
| 134 | + print '<tr><td>'.$langs->trans("Country"); |
|
| 135 | 135 | if (count($array_query['cust_country']) > 0) { |
| 136 | 136 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 137 | 137 | } |
| 138 | - print '</td><td>' . "\n"; |
|
| 138 | + print '</td><td>'."\n"; |
|
| 139 | 139 | print $formadvtargetemaling->multiselectCountry('cust_country', $array_query['cust_country']); |
| 140 | - print '</td><td>' . "\n"; |
|
| 141 | - print '</td></tr>' . "\n"; |
|
| 140 | + print '</td><td>'."\n"; |
|
| 141 | + print '</td></tr>'."\n"; |
|
| 142 | 142 | |
| 143 | 143 | // State Customer |
| 144 | - print '<tr><td>' . $langs->trans('Status') . ' ' . $langs->trans('ThirdParty'); |
|
| 144 | + print '<tr><td>'.$langs->trans('Status').' '.$langs->trans('ThirdParty'); |
|
| 145 | 145 | if (count($array_query['cust_status']) > 0) { |
| 146 | 146 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 147 | 147 | } |
| 148 | 148 | print '</td><td>'; |
| 149 | - print $formadvtargetemaling->advMultiselectarray('cust_status', array ( |
|
| 149 | + print $formadvtargetemaling->advMultiselectarray('cust_status', array( |
|
| 150 | 150 | '0' => $langs->trans('ActivityCeased'), |
| 151 | 151 | '1' => $langs->trans('InActivity') |
| 152 | 152 | ), $array_query['cust_status']); |
| 153 | - print '</td><td>' . "\n"; |
|
| 154 | - print '</td></tr>' . "\n"; |
|
| 153 | + print '</td><td>'."\n"; |
|
| 154 | + print '</td></tr>'."\n"; |
|
| 155 | 155 | |
| 156 | 156 | // Mother Company |
| 157 | - print '<tr><td>' . $langs->trans("Maison mère"); |
|
| 158 | - if (! empty($array_query['cust_mothercompany'])) { |
|
| 157 | + print '<tr><td>'.$langs->trans("Maison mère"); |
|
| 158 | + if (!empty($array_query['cust_mothercompany'])) { |
|
| 159 | 159 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 160 | 160 | } |
| 161 | - print '</td><td>' . "\n"; |
|
| 162 | - print '<input type="text" name="cust_mothercompany" value="' . $array_query['cust_mothercompany'] . '"/>'; |
|
| 163 | - print '</td><td>' . "\n"; |
|
| 161 | + print '</td><td>'."\n"; |
|
| 162 | + print '<input type="text" name="cust_mothercompany" value="'.$array_query['cust_mothercompany'].'"/>'; |
|
| 163 | + print '</td><td>'."\n"; |
|
| 164 | 164 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
| 165 | - print '</td></tr>' . "\n"; |
|
| 165 | + print '</td></tr>'."\n"; |
|
| 166 | 166 | |
| 167 | 167 | // Prospect/Customer |
| 168 | 168 | $selected = $array_query['cust_typecust']; |
| 169 | - print '<tr><td>' . $langs->trans('ProspectCustomer') . ' ' . $langs->trans('ThirdParty'); |
|
| 169 | + print '<tr><td>'.$langs->trans('ProspectCustomer').' '.$langs->trans('ThirdParty'); |
|
| 170 | 170 | if (count($array_query['cust_typecust']) > 0) { |
| 171 | 171 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 172 | 172 | } |
| 173 | 173 | print '</td><td>'; |
| 174 | - $options_array = array ( |
|
| 174 | + $options_array = array( |
|
| 175 | 175 | 2 => $langs->trans('Prospect'), |
| 176 | 176 | 3 => $langs->trans('ProspectCustomer'), |
| 177 | 177 | 1 => $langs->trans('Customer'), |
| 178 | 178 | 0 => $langs->trans('NorProspectNorCustomer') |
| 179 | 179 | ); |
| 180 | 180 | print $formadvtargetemaling->advMultiselectarray('cust_typecust', $options_array, $array_query['cust_typecust']); |
| 181 | - print '</td><td>' . "\n"; |
|
| 182 | - print '</td></tr>' . "\n"; |
|
| 181 | + print '</td><td>'."\n"; |
|
| 182 | + print '</td></tr>'."\n"; |
|
| 183 | 183 | |
| 184 | 184 | // Prospection status |
| 185 | - print '<tr><td>' . $langs->trans('ProspectLevel'); |
|
| 185 | + print '<tr><td>'.$langs->trans('ProspectLevel'); |
|
| 186 | 186 | if (count($array_query['cust_prospect_status']) > 0) { |
| 187 | 187 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 188 | 188 | } |
| 189 | 189 | print '</td><td>'; |
| 190 | 190 | print $formadvtargetemaling->multiselectProspectionStatus($array_query['cust_prospect_status'], 'cust_prospect_status', 1); |
| 191 | - print '</td><td>' . "\n"; |
|
| 192 | - print '</td></tr>' . "\n"; |
|
| 191 | + print '</td><td>'."\n"; |
|
| 192 | + print '</td></tr>'."\n"; |
|
| 193 | 193 | |
| 194 | 194 | // Prospection comm status |
| 195 | - print '<tr><td>' . $langs->trans('StatusProsp'); |
|
| 195 | + print '<tr><td>'.$langs->trans('StatusProsp'); |
|
| 196 | 196 | if (count($array_query['cust_comm_status']) > 0) { |
| 197 | 197 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 198 | 198 | } |
| 199 | 199 | print '</td><td>'; |
| 200 | 200 | print $formadvtargetemaling->advMultiselectarray('cust_comm_status', $advTarget->type_statuscommprospect, $array_query['cust_comm_status']); |
| 201 | - print '</td><td>' . "\n"; |
|
| 202 | - print '</td></tr>' . "\n"; |
|
| 201 | + print '</td><td>'."\n"; |
|
| 202 | + print '</td></tr>'."\n"; |
|
| 203 | 203 | |
| 204 | 204 | // Customer Type |
| 205 | - print '<tr><td>' . $langs->trans("ThirdPartyType"); |
|
| 205 | + print '<tr><td>'.$langs->trans("ThirdPartyType"); |
|
| 206 | 206 | if (count($array_query['cust_typeent']) > 0) { |
| 207 | 207 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 208 | 208 | } |
| 209 | - print '</td><td>' . "\n"; |
|
| 209 | + print '</td><td>'."\n"; |
|
| 210 | 210 | print $formadvtargetemaling->advMultiselectarray('cust_typeent', $formcompany->typent_array(0, " AND id <> 0"), $array_query['cust_typeent']); |
| 211 | - print '</td><td>' . "\n"; |
|
| 212 | - print '</td></tr>' . "\n"; |
|
| 211 | + print '</td><td>'."\n"; |
|
| 212 | + print '</td></tr>'."\n"; |
|
| 213 | 213 | |
| 214 | 214 | // Staff number |
| 215 | - print '<td>' . $langs->trans("Staff"); |
|
| 215 | + print '<td>'.$langs->trans("Staff"); |
|
| 216 | 216 | if (count($array_query['cust_effectif_id']) > 0) { |
| 217 | 217 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 218 | 218 | } |
| 219 | 219 | print '</td><td>'; |
| 220 | 220 | print $formadvtargetemaling->advMultiselectarray("cust_effectif_id", $formcompany->effectif_array(0, " AND id <> 0"), $array_query['cust_effectif_id']); |
| 221 | - print '</td><td>' . "\n"; |
|
| 222 | - print '</td></tr>' . "\n"; |
|
| 221 | + print '</td><td>'."\n"; |
|
| 222 | + print '</td></tr>'."\n"; |
|
| 223 | 223 | |
| 224 | 224 | // Sales manager |
| 225 | - print '<tr><td>' . $langs->trans("SalesRepresentatives"); |
|
| 225 | + print '<tr><td>'.$langs->trans("SalesRepresentatives"); |
|
| 226 | 226 | if (count($array_query['cust_saleman']) > 0) { |
| 227 | 227 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 228 | 228 | } |
| 229 | - print '</td><td>' . "\n"; |
|
| 229 | + print '</td><td>'."\n"; |
|
| 230 | 230 | print $formadvtargetemaling->multiselectselectSalesRepresentatives('cust_saleman', $array_query['cust_saleman'], $user); |
| 231 | - print '</td><td>' . "\n"; |
|
| 232 | - print '</td></tr>' . "\n"; |
|
| 231 | + print '</td><td>'."\n"; |
|
| 232 | + print '</td></tr>'."\n"; |
|
| 233 | 233 | |
| 234 | 234 | // Customer Default Langauge |
| 235 | - if (! empty($conf->global->MAIN_MULTILANGS)) { |
|
| 235 | + if (!empty($conf->global->MAIN_MULTILANGS)) { |
|
| 236 | 236 | |
| 237 | - print '<tr><td>' . $langs->trans("DefaultLang"); |
|
| 237 | + print '<tr><td>'.$langs->trans("DefaultLang"); |
|
| 238 | 238 | if (count($array_query['cust_language']) > 0) { |
| 239 | 239 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 240 | 240 | } |
| 241 | - print '</td><td>' . "\n"; |
|
| 241 | + print '</td><td>'."\n"; |
|
| 242 | 242 | print $formadvtargetemaling->multiselectselectLanguage('cust_language', $array_query['cust_language']); |
| 243 | - print '</td><td>' . "\n"; |
|
| 244 | - print '</td></tr>' . "\n"; |
|
| 243 | + print '</td><td>'."\n"; |
|
| 244 | + print '</td></tr>'."\n"; |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | - if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) { |
|
| 247 | + if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { |
|
| 248 | 248 | // Customer Categories |
| 249 | - print '<tr><td>' . $langs->trans("CustomersCategoryShort"); |
|
| 249 | + print '<tr><td>'.$langs->trans("CustomersCategoryShort"); |
|
| 250 | 250 | if (count($array_query['cust_categ']) > 0) { |
| 251 | 251 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 252 | 252 | } |
| 253 | - print '</td><td>' . "\n"; |
|
| 253 | + print '</td><td>'."\n"; |
|
| 254 | 254 | print $formadvtargetemaling->multiselectCustomerCategories('cust_categ', $array_query['cust_categ']); |
| 255 | - print '</td><td>' . "\n"; |
|
| 256 | - print '</td></tr>' . "\n"; |
|
| 255 | + print '</td><td>'."\n"; |
|
| 256 | + print '</td></tr>'."\n"; |
|
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | // Standard Extrafield feature |
@@ -262,59 +262,59 @@ discard block |
||
| 262 | 262 | dol_include_once('/core/class/extrafields.class.php'); |
| 263 | 263 | $extrafields = new ExtraFields($db); |
| 264 | 264 | $extralabels = $extrafields->fetch_name_optionals_label('societe'); |
| 265 | - foreach ( $extralabels as $key => $val ) { |
|
| 265 | + foreach ($extralabels as $key => $val) { |
|
| 266 | 266 | if ($key != 'ts_nameextra' && $key != 'ts_payeur') { |
| 267 | - print '<tr><td>' . $extrafields->attribute_label[$key]; |
|
| 268 | - if (! empty($array_query['options_' . $key]) || (is_array($array_query['options_' . $key]) && count($array_query['options_' . $key]) > 0)) { |
|
| 267 | + print '<tr><td>'.$extrafields->attribute_label[$key]; |
|
| 268 | + if (!empty($array_query['options_'.$key]) || (is_array($array_query['options_'.$key]) && count($array_query['options_'.$key]) > 0)) { |
|
| 269 | 269 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 270 | 270 | } |
| 271 | 271 | print '</td><td>'; |
| 272 | 272 | if (($extrafields->attribute_type[$key] == 'varchar') || ($extrafields->attribute_type[$key] == 'text')) { |
| 273 | - print '<input type="text" name="options_' . $key . '"/></td><td>' . "\n"; |
|
| 273 | + print '<input type="text" name="options_'.$key.'"/></td><td>'."\n"; |
|
| 274 | 274 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
| 275 | 275 | } elseif (($extrafields->attribute_type[$key] == 'int') || ($extrafields->attribute_type[$key] == 'double')) { |
| 276 | - print $langs->trans("AdvTgtMinVal") . '<input type="text" name="options' . $key . '_min"/>'; |
|
| 277 | - print $langs->trans("AdvTgtMaxVal") . '<input type="text" name="options' . $key . '_max"/>'; |
|
| 278 | - print '</td><td>' . "\n"; |
|
| 276 | + print $langs->trans("AdvTgtMinVal").'<input type="text" name="options'.$key.'_min"/>'; |
|
| 277 | + print $langs->trans("AdvTgtMaxVal").'<input type="text" name="options'.$key.'_max"/>'; |
|
| 278 | + print '</td><td>'."\n"; |
|
| 279 | 279 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchIntHelp"), 1, 'help'); |
| 280 | 280 | } elseif (($extrafields->attribute_type[$key] == 'date') || ($extrafields->attribute_type[$key] == 'datetime')) { |
| 281 | 281 | |
| 282 | 282 | print '<table class="nobordernopadding"><tr>'; |
| 283 | - print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
| 284 | - print $form->selectDate('', 'options_' . $key . '_st_dt'); |
|
| 285 | - print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
| 286 | - print $form->selectDate('', 'options_' . $key . '_end_dt'); |
|
| 283 | + print '<td>'.$langs->trans("AdvTgtStartDt").'</td><td>'; |
|
| 284 | + print $form->selectDate('', 'options_'.$key.'_st_dt'); |
|
| 285 | + print '</td><td>'.$langs->trans("AdvTgtEndDt").'</td><td>'; |
|
| 286 | + print $form->selectDate('', 'options_'.$key.'_end_dt'); |
|
| 287 | 287 | print '</td></tr></table>'; |
| 288 | 288 | |
| 289 | - print '</td><td>' . "\n"; |
|
| 289 | + print '</td><td>'."\n"; |
|
| 290 | 290 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help'); |
| 291 | 291 | } elseif (($extrafields->attribute_type[$key] == 'boolean')) { |
| 292 | - print $form->selectarray('options_' . $key, array ( |
|
| 292 | + print $form->selectarray('options_'.$key, array( |
|
| 293 | 293 | '' => '', |
| 294 | 294 | '1' => $langs->trans('Yes'), |
| 295 | 295 | '0' => $langs->trans('No') |
| 296 | - ), $array_query['options_' . $key]); |
|
| 297 | - print '</td><td>' . "\n"; |
|
| 296 | + ), $array_query['options_'.$key]); |
|
| 297 | + print '</td><td>'."\n"; |
|
| 298 | 298 | } elseif (($extrafields->attribute_type[$key] == 'select')) { |
| 299 | - print $formadvtargetemaling->advMultiselectarray('options_' . $key, $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key]); |
|
| 300 | - print '</td><td>' . "\n"; |
|
| 299 | + print $formadvtargetemaling->advMultiselectarray('options_'.$key, $extrafields->attribute_param[$key]['options'], $array_query['options_'.$key]); |
|
| 300 | + print '</td><td>'."\n"; |
|
| 301 | 301 | } elseif (($extrafields->attribute_type[$key] == 'sellist')) { |
| 302 | - print $formadvtargetemaling->advMultiselectarraySelllist('options_' . $key, $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key]); |
|
| 303 | - print '</td><td>' . "\n"; |
|
| 302 | + print $formadvtargetemaling->advMultiselectarraySelllist('options_'.$key, $extrafields->attribute_param[$key]['options'], $array_query['options_'.$key]); |
|
| 303 | + print '</td><td>'."\n"; |
|
| 304 | 304 | } else { |
| 305 | 305 | |
| 306 | 306 | print '<table class="nobordernopadding"><tr>'; |
| 307 | 307 | print '<td></td><td>'; |
| 308 | - if (is_array($array_query['options_' . $key])) { |
|
| 309 | - print $extrafields->showInputField($key, implode(',', $array_query['options_' . $key])); |
|
| 308 | + if (is_array($array_query['options_'.$key])) { |
|
| 309 | + print $extrafields->showInputField($key, implode(',', $array_query['options_'.$key])); |
|
| 310 | 310 | } else { |
| 311 | - print $extrafields->showInputField($key, $array_query['options_' . $key]); |
|
| 311 | + print $extrafields->showInputField($key, $array_query['options_'.$key]); |
|
| 312 | 312 | } |
| 313 | 313 | print '</td></tr></table>'; |
| 314 | 314 | |
| 315 | - print '</td><td>' . "\n"; |
|
| 315 | + print '</td><td>'."\n"; |
|
| 316 | 316 | } |
| 317 | - print '</td></tr>' . "\n"; |
|
| 317 | + print '</td></tr>'."\n"; |
|
| 318 | 318 | } |
| 319 | 319 | } |
| 320 | 320 | } else { |
@@ -322,12 +322,12 @@ discard block |
||
| 322 | 322 | $action_search = 'query'; |
| 323 | 323 | |
| 324 | 324 | // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context |
| 325 | - include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; |
|
| 325 | + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; |
|
| 326 | 326 | $hookmanager = new HookManager($db); |
| 327 | - $hookmanager->initHooks(array ('thirdpartycard')); |
|
| 327 | + $hookmanager->initHooks(array('thirdpartycard')); |
|
| 328 | 328 | |
| 329 | - $parameters=array(); |
|
| 330 | - if (! empty($advTarget->id)) { |
|
| 329 | + $parameters = array(); |
|
| 330 | + if (!empty($advTarget->id)) { |
|
| 331 | 331 | $parameters = array('array_query' => $advTarget->filtervalue); |
| 332 | 332 | } |
| 333 | 333 | // Other attributes |
@@ -336,21 +336,21 @@ discard block |
||
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | // State Contact |
| 339 | - print '<tr><td>' . $langs->trans('Status') . ' ' . $langs->trans('Contact'); |
|
| 339 | + print '<tr><td>'.$langs->trans('Status').' '.$langs->trans('Contact'); |
|
| 340 | 340 | if (count($array_query['contact_status']) > 0) { |
| 341 | 341 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 342 | 342 | } |
| 343 | 343 | print '</td><td>'; |
| 344 | - print $formadvtargetemaling->advMultiselectarray('contact_status', array ( |
|
| 344 | + print $formadvtargetemaling->advMultiselectarray('contact_status', array( |
|
| 345 | 345 | '0' => $langs->trans('ActivityCeased'), |
| 346 | 346 | '1' => $langs->trans('InActivity') |
| 347 | 347 | ), $array_query['contact_status']); |
| 348 | - print '</td><td>' . "\n"; |
|
| 348 | + print '</td><td>'."\n"; |
|
| 349 | 349 | print $form->textwithpicto('', $langs->trans("AdvTgtContactHelp"), 1, 'help'); |
| 350 | - print '</td></tr>' . "\n"; |
|
| 350 | + print '</td></tr>'."\n"; |
|
| 351 | 351 | |
| 352 | 352 | // Civility |
| 353 | - print '<tr><td width="15%">' . $langs->trans("UserTitle"); |
|
| 353 | + print '<tr><td width="15%">'.$langs->trans("UserTitle"); |
|
| 354 | 354 | if (count($array_query['contact_civility']) > 0) { |
| 355 | 355 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 356 | 356 | } |
@@ -359,85 +359,85 @@ discard block |
||
| 359 | 359 | print '</td></tr>'; |
| 360 | 360 | |
| 361 | 361 | // contact name |
| 362 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans('Lastname'); |
|
| 363 | - if (! empty($array_query['contact_lastname'])) { |
|
| 362 | + print '<tr><td>'.$langs->trans('Contact').' '.$langs->trans('Lastname'); |
|
| 363 | + if (!empty($array_query['contact_lastname'])) { |
|
| 364 | 364 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 365 | 365 | } |
| 366 | - print '</td><td><input type="text" name="contact_lastname" value="' . $array_query['contact_lastname'] . '"/></td><td>' . "\n"; |
|
| 366 | + print '</td><td><input type="text" name="contact_lastname" value="'.$array_query['contact_lastname'].'"/></td><td>'."\n"; |
|
| 367 | 367 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
| 368 | - print '</td></tr>' . "\n"; |
|
| 369 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans('Firstname'); |
|
| 370 | - if (! empty($array_query['contact_firstname'])) { |
|
| 368 | + print '</td></tr>'."\n"; |
|
| 369 | + print '<tr><td>'.$langs->trans('Contact').' '.$langs->trans('Firstname'); |
|
| 370 | + if (!empty($array_query['contact_firstname'])) { |
|
| 371 | 371 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 372 | 372 | } |
| 373 | - print '</td><td><input type="text" name="contact_firstname" value="' . $array_query['contact_firstname'] . '"/></td><td>' . "\n"; |
|
| 373 | + print '</td><td><input type="text" name="contact_firstname" value="'.$array_query['contact_firstname'].'"/></td><td>'."\n"; |
|
| 374 | 374 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
| 375 | - print '</td></tr>' . "\n"; |
|
| 375 | + print '</td></tr>'."\n"; |
|
| 376 | 376 | |
| 377 | 377 | // Contact Country |
| 378 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("Country"); |
|
| 378 | + print '<tr><td>'.$langs->trans('Contact').' '.$langs->trans("Country"); |
|
| 379 | 379 | if (count($array_query['contact_country']) > 0) { |
| 380 | 380 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 381 | 381 | } |
| 382 | - print '</td><td>' . "\n"; |
|
| 382 | + print '</td><td>'."\n"; |
|
| 383 | 383 | print $formadvtargetemaling->multiselectCountry('contact_country', $array_query['contact_country']); |
| 384 | - print '</td><td>' . "\n"; |
|
| 385 | - print '</td></tr>' . "\n"; |
|
| 384 | + print '</td><td>'."\n"; |
|
| 385 | + print '</td></tr>'."\n"; |
|
| 386 | 386 | |
| 387 | 387 | // Never send mass mailing |
| 388 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("No_Email"); |
|
| 389 | - if (! empty($array_query['contact_no_email'])) { |
|
| 388 | + print '<tr><td>'.$langs->trans('Contact').' '.$langs->trans("No_Email"); |
|
| 389 | + if (!empty($array_query['contact_no_email'])) { |
|
| 390 | 390 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 391 | 391 | } |
| 392 | - print '</td><td>' . "\n"; |
|
| 393 | - print $form->selectarray('contact_no_email', array ( |
|
| 392 | + print '</td><td>'."\n"; |
|
| 393 | + print $form->selectarray('contact_no_email', array( |
|
| 394 | 394 | '' => '', |
| 395 | 395 | '1' => $langs->trans('Yes'), |
| 396 | 396 | '0' => $langs->trans('No') |
| 397 | 397 | ), $array_query['contact_no_email']); |
| 398 | - print '</td><td>' . "\n"; |
|
| 399 | - print '</td></tr>' . "\n"; |
|
| 398 | + print '</td><td>'."\n"; |
|
| 399 | + print '</td></tr>'."\n"; |
|
| 400 | 400 | |
| 401 | 401 | // Contact Date Create |
| 402 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("DateCreation"); |
|
| 403 | - if (! empty($array_query['contact_create_st_dt'])) { |
|
| 402 | + print '<tr><td>'.$langs->trans('Contact').' '.$langs->trans("DateCreation"); |
|
| 403 | + if (!empty($array_query['contact_create_st_dt'])) { |
|
| 404 | 404 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 405 | 405 | } |
| 406 | - print '</td><td>' . "\n"; |
|
| 406 | + print '</td><td>'."\n"; |
|
| 407 | 407 | print '<table class="nobordernopadding"><tr>'; |
| 408 | - print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
| 408 | + print '<td>'.$langs->trans("AdvTgtStartDt").'</td><td>'; |
|
| 409 | 409 | print $form->selectDate($array_query['contact_create_st_dt'], 'contact_create_st_dt', 0, 0, 1, 'find_customer', 1, 1); |
| 410 | - print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
| 410 | + print '</td><td>'.$langs->trans("AdvTgtEndDt").'</td><td>'; |
|
| 411 | 411 | print $form->selectDate($array_query['contact_create_end_dt'], 'contact_create_end_dt', 0, 0, 1, 'find_customer', 1, 1); |
| 412 | 412 | print '</td></tr></table>'; |
| 413 | - print '</td><td>' . "\n"; |
|
| 414 | - print '</td></tr>' . "\n"; |
|
| 413 | + print '</td><td>'."\n"; |
|
| 414 | + print '</td></tr>'."\n"; |
|
| 415 | 415 | |
| 416 | 416 | // Contact update Create |
| 417 | - print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("DateLastModification"); |
|
| 418 | - if (! empty($array_query['contact_update_st_dt'])) { |
|
| 417 | + print '<tr><td>'.$langs->trans('Contact').' '.$langs->trans("DateLastModification"); |
|
| 418 | + if (!empty($array_query['contact_update_st_dt'])) { |
|
| 419 | 419 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 420 | 420 | } |
| 421 | - print '</td><td>' . "\n"; |
|
| 421 | + print '</td><td>'."\n"; |
|
| 422 | 422 | print '<table class="nobordernopadding"><tr>'; |
| 423 | - print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
| 423 | + print '<td>'.$langs->trans("AdvTgtStartDt").'</td><td>'; |
|
| 424 | 424 | print $form->selectDate($array_query['contact_update_st_dt'], 'contact_update_st_dt', 0, 0, 1, 'find_customer', 1, 1); |
| 425 | - print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
| 425 | + print '</td><td>'.$langs->trans("AdvTgtEndDt").'</td><td>'; |
|
| 426 | 426 | print $form->selectDate($array_query['contact_update_end_dt'], 'contact_update_end_dt', 0, 0, 1, 'find_customer', 1, 1); |
| 427 | 427 | print '</td></tr></table>'; |
| 428 | - print '</td><td>' . "\n"; |
|
| 429 | - print '</td></tr>' . "\n"; |
|
| 428 | + print '</td><td>'."\n"; |
|
| 429 | + print '</td></tr>'."\n"; |
|
| 430 | 430 | |
| 431 | - if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) { |
|
| 431 | + if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { |
|
| 432 | 432 | // Customer Categories |
| 433 | - print '<tr><td>' . $langs->trans("ContactCategoriesShort"); |
|
| 433 | + print '<tr><td>'.$langs->trans("ContactCategoriesShort"); |
|
| 434 | 434 | if (count($array_query['contact_categ']) > 0) { |
| 435 | 435 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 436 | 436 | } |
| 437 | - print '</td><td>' . "\n"; |
|
| 437 | + print '</td><td>'."\n"; |
|
| 438 | 438 | print $formadvtargetemaling->multiselectContactCategories('contact_categ', $array_query['contact_categ']); |
| 439 | - print '</td><td>' . "\n"; |
|
| 440 | - print '</td></tr>' . "\n"; |
|
| 439 | + print '</td><td>'."\n"; |
|
| 440 | + print '</td></tr>'."\n"; |
|
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | // Standard Extrafield feature |
@@ -446,84 +446,84 @@ discard block |
||
| 446 | 446 | dol_include_once('/core/class/extrafields.class.php'); |
| 447 | 447 | $extrafields = new ExtraFields($db); |
| 448 | 448 | $extralabels = $extrafields->fetch_name_optionals_label('socpeople'); |
| 449 | - foreach($extrafields->attribute_type as $key=>&$value) { |
|
| 450 | - if($value == 'radio')$value = 'select'; |
|
| 449 | + foreach ($extrafields->attribute_type as $key=>&$value) { |
|
| 450 | + if ($value == 'radio')$value = 'select'; |
|
| 451 | 451 | } |
| 452 | 452 | |
| 453 | 453 | |
| 454 | - foreach ( $extralabels as $key => $val ) { |
|
| 454 | + foreach ($extralabels as $key => $val) { |
|
| 455 | 455 | |
| 456 | - print '<tr><td>' . $extrafields->attribute_label[$key]; |
|
| 457 | - if ($array_query['options_' . $key . '_cnct'] != '' || (is_array($array_query['options_' . $key . '_cnct']) && count($array_query['options_' . $key . '_cnct']) > 0)) { |
|
| 456 | + print '<tr><td>'.$extrafields->attribute_label[$key]; |
|
| 457 | + if ($array_query['options_'.$key.'_cnct'] != '' || (is_array($array_query['options_'.$key.'_cnct']) && count($array_query['options_'.$key.'_cnct']) > 0)) { |
|
| 458 | 458 | print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); |
| 459 | 459 | } |
| 460 | 460 | print '</td><td>'; |
| 461 | 461 | if (($extrafields->attribute_type[$key] == 'varchar') || ($extrafields->attribute_type[$key] == 'text')) { |
| 462 | - print '<input type="text" name="options_' . $key . '_cnct"/></td><td>' . "\n"; |
|
| 462 | + print '<input type="text" name="options_'.$key.'_cnct"/></td><td>'."\n"; |
|
| 463 | 463 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); |
| 464 | 464 | } elseif (($extrafields->attribute_type[$key] == 'int') || ($extrafields->attribute_type[$key] == 'double')) { |
| 465 | - print $langs->trans("AdvTgtMinVal") . '<input type="text" name="options_' . $key . '_min_cnct"/>'; |
|
| 466 | - print $langs->trans("AdvTgtMaxVal") . '<input type="text" name="options_' . $key . '_max_cnct"/>'; |
|
| 467 | - print '</td><td>' . "\n"; |
|
| 465 | + print $langs->trans("AdvTgtMinVal").'<input type="text" name="options_'.$key.'_min_cnct"/>'; |
|
| 466 | + print $langs->trans("AdvTgtMaxVal").'<input type="text" name="options_'.$key.'_max_cnct"/>'; |
|
| 467 | + print '</td><td>'."\n"; |
|
| 468 | 468 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchIntHelp"), 1, 'help'); |
| 469 | 469 | } elseif (($extrafields->attribute_type[$key] == 'date') || ($extrafields->attribute_type[$key] == 'datetime')) { |
| 470 | 470 | |
| 471 | 471 | print '<table class="nobordernopadding"><tr>'; |
| 472 | - print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; |
|
| 473 | - print $form->selectDate('', 'options_' . $key . '_st_dt' . '_cnct'); |
|
| 474 | - print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; |
|
| 475 | - print $form->selectDate('', 'options_' . $key . '_end_dt' . '_cnct'); |
|
| 472 | + print '<td>'.$langs->trans("AdvTgtStartDt").'</td><td>'; |
|
| 473 | + print $form->selectDate('', 'options_'.$key.'_st_dt'.'_cnct'); |
|
| 474 | + print '</td><td>'.$langs->trans("AdvTgtEndDt").'</td><td>'; |
|
| 475 | + print $form->selectDate('', 'options_'.$key.'_end_dt'.'_cnct'); |
|
| 476 | 476 | print '</td></tr></table>'; |
| 477 | 477 | |
| 478 | - print '</td><td>' . "\n"; |
|
| 478 | + print '</td><td>'."\n"; |
|
| 479 | 479 | print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help'); |
| 480 | 480 | } elseif (($extrafields->attribute_type[$key] == 'boolean')) { |
| 481 | - print $form->selectarray('options_' . $key . '_cnct', array ( |
|
| 481 | + print $form->selectarray('options_'.$key.'_cnct', array( |
|
| 482 | 482 | '' => '', |
| 483 | 483 | '1' => $langs->trans('Yes'), |
| 484 | 484 | '0' => $langs->trans('No') |
| 485 | - ), $array_query['options_' . $key . '_cnct']); |
|
| 486 | - print '</td><td>' . "\n"; |
|
| 485 | + ), $array_query['options_'.$key.'_cnct']); |
|
| 486 | + print '</td><td>'."\n"; |
|
| 487 | 487 | } elseif (($extrafields->attribute_type[$key] == 'select')) { |
| 488 | - print $formadvtargetemaling->advMultiselectarray('options_' . $key . '_cnct', $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key . '_cnct']); |
|
| 489 | - print '</td><td>' . "\n"; |
|
| 488 | + print $formadvtargetemaling->advMultiselectarray('options_'.$key.'_cnct', $extrafields->attribute_param[$key]['options'], $array_query['options_'.$key.'_cnct']); |
|
| 489 | + print '</td><td>'."\n"; |
|
| 490 | 490 | } elseif (($extrafields->attribute_type[$key] == 'sellist')) { |
| 491 | - print $formadvtargetemaling->advMultiselectarraySelllist('options_' . $key . '_cnct', $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key . '_cnct']); |
|
| 492 | - print '</td><td>' . "\n"; |
|
| 491 | + print $formadvtargetemaling->advMultiselectarraySelllist('options_'.$key.'_cnct', $extrafields->attribute_param[$key]['options'], $array_query['options_'.$key.'_cnct']); |
|
| 492 | + print '</td><td>'."\n"; |
|
| 493 | 493 | } else { |
| 494 | 494 | |
| 495 | 495 | print '<table class="nobordernopadding"><tr>'; |
| 496 | 496 | print '<td></td><td>'; |
| 497 | - if (is_array($array_query['options_' . $key . '_cnct'])) { |
|
| 498 | - print $extrafields->showInputField($key, implode(',', $array_query['options_' . $key . '_cnct']), '', '_cnct'); |
|
| 497 | + if (is_array($array_query['options_'.$key.'_cnct'])) { |
|
| 498 | + print $extrafields->showInputField($key, implode(',', $array_query['options_'.$key.'_cnct']), '', '_cnct'); |
|
| 499 | 499 | } else { |
| 500 | - print $extrafields->showInputField($key, $array_query['options_' . $key . '_cnct'], '', '_cnct'); |
|
| 500 | + print $extrafields->showInputField($key, $array_query['options_'.$key.'_cnct'], '', '_cnct'); |
|
| 501 | 501 | } |
| 502 | 502 | print '</td></tr></table>'; |
| 503 | 503 | |
| 504 | - print '</td><td>' . "\n"; |
|
| 504 | + print '</td><td>'."\n"; |
|
| 505 | 505 | } |
| 506 | - print '</td></tr>' . "\n"; |
|
| 506 | + print '</td></tr>'."\n"; |
|
| 507 | 507 | } |
| 508 | 508 | } |
| 509 | 509 | |
| 510 | - print '<tr>' . "\n"; |
|
| 511 | - print '<td colspan="3" align="right">' . "\n"; |
|
| 510 | + print '<tr>'."\n"; |
|
| 511 | + print '<td colspan="3" align="right">'."\n"; |
|
| 512 | 512 | |
| 513 | - print '<input type="button" name="addcontact" id="addcontact" value="' . $langs->trans('AdvTgtAddContact') . '" class="butAction"/>' . "\n"; |
|
| 513 | + print '<input type="button" name="addcontact" id="addcontact" value="'.$langs->trans('AdvTgtAddContact').'" class="butAction"/>'."\n"; |
|
| 514 | 514 | |
| 515 | - print '</td>' . "\n"; |
|
| 516 | - print '</tr>' . "\n"; |
|
| 517 | - print '</table>' . "\n"; |
|
| 518 | - print '</form>' . "\n"; |
|
| 519 | - print '</div>' . "\n"; |
|
| 515 | + print '</td>'."\n"; |
|
| 516 | + print '</tr>'."\n"; |
|
| 517 | + print '</table>'."\n"; |
|
| 518 | + print '</form>'."\n"; |
|
| 519 | + print '</div>'."\n"; |
|
| 520 | 520 | |
| 521 | - print '<form action="' . $_SERVER['PHP_SELF'] . '?action=clear&id=' . $object->id . '" method="POST">'; |
|
| 522 | - print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; |
|
| 521 | + print '<form action="'.$_SERVER['PHP_SELF'].'?action=clear&id='.$object->id.'" method="POST">'; |
|
| 522 | + print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; |
|
| 523 | 523 | print_titre($langs->trans("ToClearAllRecipientsClickHere")); |
| 524 | 524 | print '<table class="noborder" width="100%">'; |
| 525 | 525 | print '<tr class="liste_titre">'; |
| 526 | - print '<td class="liste_titre" align="right"><input type="submit" class="button" value="' . $langs->trans("TargetsReset") . '"></td>'; |
|
| 526 | + print '<td class="liste_titre" align="right"><input type="submit" class="button" value="'.$langs->trans("TargetsReset").'"></td>'; |
|
| 527 | 527 | print '</tr>'; |
| 528 | 528 | print '</table>'; |
| 529 | 529 | print '</form>'; |
@@ -447,7 +447,9 @@ |
||
| 447 | 447 | $extrafields = new ExtraFields($db); |
| 448 | 448 | $extralabels = $extrafields->fetch_name_optionals_label('socpeople'); |
| 449 | 449 | foreach($extrafields->attribute_type as $key=>&$value) { |
| 450 | - if($value == 'radio')$value = 'select'; |
|
| 450 | + if($value == 'radio') { |
|
| 451 | + $value = 'select'; |
|
| 452 | + } |
|
| 451 | 453 | } |
| 452 | 454 | |
| 453 | 455 | |
@@ -21,8 +21,8 @@ discard block |
||
| 21 | 21 | // Protection to avoid direct call of template |
| 22 | 22 | if (empty($conf) || ! is_object($conf)) |
| 23 | 23 | { |
| 24 | - print "Error, template page filemanager.tpl.php can't be called as URL"; |
|
| 25 | - exit; |
|
| 24 | + print "Error, template page filemanager.tpl.php can't be called as URL"; |
|
| 25 | + exit; |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | ?> |
@@ -41,15 +41,15 @@ discard block |
||
| 41 | 41 | $showroot = 0; |
| 42 | 42 | if ($module == 'ecm') |
| 43 | 43 | { |
| 44 | - $permtoadd = $user->rights->ecm->setup; |
|
| 45 | - $permtoupload = $user->rights->ecm->upload; |
|
| 46 | - $showroot = 0; |
|
| 44 | + $permtoadd = $user->rights->ecm->setup; |
|
| 45 | + $permtoupload = $user->rights->ecm->upload; |
|
| 46 | + $showroot = 0; |
|
| 47 | 47 | } |
| 48 | 48 | if ($module == 'medias') |
| 49 | 49 | { |
| 50 | - $permtoadd = ($user->rights->mailing->creer || $user->rights->website->write); |
|
| 51 | - $permtoupload = ($user->rights->mailing->creer || $user->rights->website->write); |
|
| 52 | - $showroot = 1; |
|
| 50 | + $permtoadd = ($user->rights->mailing->creer || $user->rights->website->write); |
|
| 51 | + $permtoupload = ($user->rights->mailing->creer || $user->rights->website->write); |
|
| 52 | + $showroot = 1; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | |
@@ -57,8 +57,8 @@ discard block |
||
| 57 | 57 | // Confirm remove file (for non javascript users) |
| 58 | 58 | if (($action == 'delete' || $action == 'file_manager_delete') && empty($conf->use_javascript_ajax)) |
| 59 | 59 | { |
| 60 | - // TODO Add website, pageid, filemanager if defined |
|
| 61 | - print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1); |
|
| 60 | + // TODO Add website, pageid, filemanager if defined |
|
| 61 | + print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | // Start container of all panels |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | // Toolbar |
| 75 | 75 | if ($permtoadd) |
| 76 | 76 | { |
| 77 | - print '<a href="'.DOL_URL_ROOT.'/ecm/dir_add_card.php?action=create&module='.urlencode($module).($websitekey?'&website='.$websitekey:'').($pageid?'&pageid='.$pageid:'').'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid).'" class="inline-block valignmiddle toolbarbutton" title="'.dol_escape_htmltag($langs->trans('ECMAddSection')).'">'; |
|
| 77 | + print '<a href="'.DOL_URL_ROOT.'/ecm/dir_add_card.php?action=create&module='.urlencode($module).($websitekey?'&website='.$websitekey:'').($pageid?'&pageid='.$pageid:'').'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid).'" class="inline-block valignmiddle toolbarbutton" title="'.dol_escape_htmltag($langs->trans('ECMAddSection')).'">'; |
|
| 78 | 78 | print '<img class="toolbarbutton" border="0" src="'.DOL_URL_ROOT.'/theme/common/folder-new.png">'; |
| 79 | 79 | print '</a>'; |
| 80 | 80 | } |
@@ -86,10 +86,10 @@ discard block |
||
| 86 | 86 | } |
| 87 | 87 | if ($module == 'ecm') |
| 88 | 88 | { |
| 89 | - $tmpurl=((! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))?'#':($_SERVER["PHP_SELF"].'?action=refreshmanual'.($module?'&module='.$module:'').($section?'&section='.$section:''))); |
|
| 90 | - print '<a href="'.$tmpurl.'" class="inline-block valignmiddle toolbarbutton" title="'.dol_escape_htmltag($langs->trans('ReSyncListOfDir')).'">'; |
|
| 91 | - print '<img id="refreshbutton" class="toolbarbutton" border="0" src="'.DOL_URL_ROOT.'/theme/common/view-refresh.png">'; |
|
| 92 | - print '</a>'; |
|
| 89 | + $tmpurl=((! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))?'#':($_SERVER["PHP_SELF"].'?action=refreshmanual'.($module?'&module='.$module:'').($section?'&section='.$section:''))); |
|
| 90 | + print '<a href="'.$tmpurl.'" class="inline-block valignmiddle toolbarbutton" title="'.dol_escape_htmltag($langs->trans('ReSyncListOfDir')).'">'; |
|
| 91 | + print '<img id="refreshbutton" class="toolbarbutton" border="0" src="'.DOL_URL_ROOT.'/theme/common/view-refresh.png">'; |
|
| 92 | + print '</a>'; |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | // Start "Add new file" area |
@@ -100,20 +100,20 @@ discard block |
||
| 100 | 100 | // To attach new file |
| 101 | 101 | if ((! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) || ! empty($section)) |
| 102 | 102 | { |
| 103 | - if ((empty($section) || $section == -1) && ($module != 'medias')) |
|
| 104 | - { |
|
| 105 | - ?> |
|
| 103 | + if ((empty($section) || $section == -1) && ($module != 'medias')) |
|
| 104 | + { |
|
| 105 | + ?> |
|
| 106 | 106 | <script type="text/javascript"> |
| 107 | 107 | jQuery(document).ready(function() { |
| 108 | 108 | jQuery('#<?php echo $nameforformuserfile ?>').hide(); |
| 109 | 109 | }); |
| 110 | 110 | </script> |
| 111 | 111 | <?php |
| 112 | - } |
|
| 112 | + } |
|
| 113 | 113 | |
| 114 | - $sectiondir=GETPOST('file','alpha')?GETPOST('file','alpha'):GETPOST('section_dir','alpha'); |
|
| 115 | - print '<!-- Start form to attach new file in filemanager.tpl.php sectionid='.$section.' sectiondir='.$sectiondir.' -->'."\n"; |
|
| 116 | - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
| 114 | + $sectiondir=GETPOST('file','alpha')?GETPOST('file','alpha'):GETPOST('section_dir','alpha'); |
|
| 115 | + print '<!-- Start form to attach new file in filemanager.tpl.php sectionid='.$section.' sectiondir='.$sectiondir.' -->'."\n"; |
|
| 116 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
| 117 | 117 | $formfile=new FormFile($db); |
| 118 | 118 | $formfile->form_attach_new_file($_SERVER["PHP_SELF"], 'none', 0, ($section?$section:-1), $permtoupload, 48, null, '', 0, '', 0, $nameforformuserfile, '', $sectiondir); |
| 119 | 119 | } |
@@ -143,39 +143,39 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | if (empty($action) || $action == 'editfile' || $action == 'file_manager' || preg_match('/refresh/i',$action) || $action == 'delete') |
| 145 | 145 | { |
| 146 | - $langs->load("ecm"); |
|
| 146 | + $langs->load("ecm"); |
|
| 147 | 147 | |
| 148 | - print '<table width="100%" class="liste noborderbottom">'."\n"; |
|
| 148 | + print '<table width="100%" class="liste noborderbottom">'."\n"; |
|
| 149 | 149 | |
| 150 | - print '<!-- Title for manual directories -->'."\n"; |
|
| 151 | - print '<tr class="liste_titre">'."\n"; |
|
| 150 | + print '<!-- Title for manual directories -->'."\n"; |
|
| 151 | + print '<tr class="liste_titre">'."\n"; |
|
| 152 | 152 | print '<th class="liste_titre" align="left">'; |
| 153 | 153 | print ' '.$langs->trans("ECMSections"); |
| 154 | - print '</th></tr>'; |
|
| 154 | + print '</th></tr>'; |
|
| 155 | 155 | |
| 156 | 156 | $showonrightsize=''; |
| 157 | 157 | |
| 158 | - // Manual section |
|
| 159 | - $htmltooltip=$langs->trans("ECMAreaDesc2"); |
|
| 158 | + // Manual section |
|
| 159 | + $htmltooltip=$langs->trans("ECMAreaDesc2"); |
|
| 160 | 160 | |
| 161 | 161 | if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) |
| 162 | 162 | { |
| 163 | - // Show the link to "Root" |
|
| 164 | - if ($showroot) |
|
| 165 | - { |
|
| 166 | - print '<tr><td><div style="padding-left: 5px; padding-right: 5px;"><a href="'.$_SERVER["PHP_SELF"].'?file_manager=1&pageid='.$pageid.'">'.$langs->trans("Root").'</a></div></td></tr>'; |
|
| 167 | - } |
|
| 163 | + // Show the link to "Root" |
|
| 164 | + if ($showroot) |
|
| 165 | + { |
|
| 166 | + print '<tr><td><div style="padding-left: 5px; padding-right: 5px;"><a href="'.$_SERVER["PHP_SELF"].'?file_manager=1&pageid='.$pageid.'">'.$langs->trans("Root").'</a></div></td></tr>'; |
|
| 167 | + } |
|
| 168 | 168 | |
| 169 | 169 | |
| 170 | 170 | |
| 171 | - print '<tr><td>'; |
|
| 171 | + print '<tr><td>'; |
|
| 172 | 172 | |
| 173 | - // Show filemanager tree (will be filled by a call of ajax /ecm/tpl/enablefiletreeajax.tpl.php, later, that executes ajaxdirtree.php) |
|
| 174 | - print '<div id="filetree" class="ecmfiletree"></div>'; |
|
| 173 | + // Show filemanager tree (will be filled by a call of ajax /ecm/tpl/enablefiletreeajax.tpl.php, later, that executes ajaxdirtree.php) |
|
| 174 | + print '<div id="filetree" class="ecmfiletree"></div>'; |
|
| 175 | 175 | |
| 176 | - if ($action == 'deletefile') print $form->formconfirm('eeeee', $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', '', 'deletefile'); |
|
| 176 | + if ($action == 'deletefile') print $form->formconfirm('eeeee', $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', '', 'deletefile'); |
|
| 177 | 177 | |
| 178 | - print '</td></tr>'; |
|
| 178 | + print '</td></tr>'; |
|
| 179 | 179 | } |
| 180 | 180 | else // Show filtree when ajax is disabled (rare) |
| 181 | 181 | { |
@@ -195,12 +195,12 @@ discard block |
||
| 195 | 195 | if (empty($url)) $url=DOL_URL_ROOT.'/ecm/index.php'; |
| 196 | 196 | include DOL_DOCUMENT_ROOT.'/core/ajax/ajaxdirtree.php'; |
| 197 | 197 | |
| 198 | - print '</div>'; |
|
| 199 | - print '</td></tr>'; |
|
| 198 | + print '</div>'; |
|
| 199 | + print '</td></tr>'; |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | |
| 203 | - print "</table>"; |
|
| 203 | + print "</table>"; |
|
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | |
@@ -231,14 +231,14 @@ discard block |
||
| 231 | 231 | |
| 232 | 232 | if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) // Show filtree when ajax is enabled |
| 233 | 233 | { |
| 234 | - //var_dump($modulepart); |
|
| 235 | - // Variables that may be defined: |
|
| 236 | - // $_GET['modulepart'], $_GET['openeddir'], $_GET['sortfield'], $_GET['sortorder'] |
|
| 237 | - // $_POST['dir'] |
|
| 238 | - // $_POST['section_dir'], $_POST['section_id'], $_POST['token'], $_POST['max_file_size'], $_POST['sendit'] |
|
| 239 | - if (GETPOST('section_dir','alpha')) { $preopened=GETPOST('section_dir','alpha'); } |
|
| 240 | - |
|
| 241 | - include DOL_DOCUMENT_ROOT.'/ecm/tpl/enablefiletreeajax.tpl.php'; |
|
| 234 | + //var_dump($modulepart); |
|
| 235 | + // Variables that may be defined: |
|
| 236 | + // $_GET['modulepart'], $_GET['openeddir'], $_GET['sortfield'], $_GET['sortorder'] |
|
| 237 | + // $_POST['dir'] |
|
| 238 | + // $_POST['section_dir'], $_POST['section_id'], $_POST['token'], $_POST['max_file_size'], $_POST['sendit'] |
|
| 239 | + if (GETPOST('section_dir','alpha')) { $preopened=GETPOST('section_dir','alpha'); } |
|
| 240 | + |
|
| 241 | + include DOL_DOCUMENT_ROOT.'/ecm/tpl/enablefiletreeajax.tpl.php'; |
|
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | ?> |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | 21 | // Protection to avoid direct call of template |
| 22 | -if (empty($conf) || ! is_object($conf)) |
|
| 22 | +if (empty($conf) || !is_object($conf)) |
|
| 23 | 23 | { |
| 24 | 24 | print "Error, template page filemanager.tpl.php can't be called as URL"; |
| 25 | 25 | exit; |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php'; |
| 36 | 36 | |
| 37 | -if (empty($module)) $module='ecm'; |
|
| 37 | +if (empty($module)) $module = 'ecm'; |
|
| 38 | 38 | |
| 39 | 39 | $permtoadd = 0; |
| 40 | 40 | $permtoupload = 0; |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | if (($action == 'delete' || $action == 'file_manager_delete') && empty($conf->use_javascript_ajax)) |
| 59 | 59 | { |
| 60 | 60 | // TODO Add website, pageid, filemanager if defined |
| 61 | - print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1); |
|
| 61 | + print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', '', 1); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | // Start container of all panels |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | // Toolbar |
| 75 | 75 | if ($permtoadd) |
| 76 | 76 | { |
| 77 | - print '<a href="'.DOL_URL_ROOT.'/ecm/dir_add_card.php?action=create&module='.urlencode($module).($websitekey?'&website='.$websitekey:'').($pageid?'&pageid='.$pageid:'').'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid).'" class="inline-block valignmiddle toolbarbutton" title="'.dol_escape_htmltag($langs->trans('ECMAddSection')).'">'; |
|
| 77 | + print '<a href="'.DOL_URL_ROOT.'/ecm/dir_add_card.php?action=create&module='.urlencode($module).($websitekey ? '&website='.$websitekey : '').($pageid ? '&pageid='.$pageid : '').'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid).'" class="inline-block valignmiddle toolbarbutton" title="'.dol_escape_htmltag($langs->trans('ECMAddSection')).'">'; |
|
| 78 | 78 | print '<img class="toolbarbutton" border="0" src="'.DOL_URL_ROOT.'/theme/common/folder-new.png">'; |
| 79 | 79 | print '</a>'; |
| 80 | 80 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | } |
| 87 | 87 | if ($module == 'ecm') |
| 88 | 88 | { |
| 89 | - $tmpurl=((! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))?'#':($_SERVER["PHP_SELF"].'?action=refreshmanual'.($module?'&module='.$module:'').($section?'&section='.$section:''))); |
|
| 89 | + $tmpurl = ((!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) ? '#' : ($_SERVER["PHP_SELF"].'?action=refreshmanual'.($module ? '&module='.$module : '').($section ? '&section='.$section : ''))); |
|
| 90 | 90 | print '<a href="'.$tmpurl.'" class="inline-block valignmiddle toolbarbutton" title="'.dol_escape_htmltag($langs->trans('ReSyncListOfDir')).'">'; |
| 91 | 91 | print '<img id="refreshbutton" class="toolbarbutton" border="0" src="'.DOL_URL_ROOT.'/theme/common/view-refresh.png">'; |
| 92 | 92 | print '</a>'; |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | print '<div class="inline-block valignmiddle floatright">'; |
| 99 | 99 | |
| 100 | 100 | // To attach new file |
| 101 | -if ((! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) || ! empty($section)) |
|
| 101 | +if ((!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) || !empty($section)) |
|
| 102 | 102 | { |
| 103 | 103 | if ((empty($section) || $section == -1) && ($module != 'medias')) |
| 104 | 104 | { |
@@ -111,11 +111,11 @@ discard block |
||
| 111 | 111 | <?php |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - $sectiondir=GETPOST('file','alpha')?GETPOST('file','alpha'):GETPOST('section_dir','alpha'); |
|
| 114 | + $sectiondir = GETPOST('file', 'alpha') ?GETPOST('file', 'alpha') : GETPOST('section_dir', 'alpha'); |
|
| 115 | 115 | print '<!-- Start form to attach new file in filemanager.tpl.php sectionid='.$section.' sectiondir='.$sectiondir.' -->'."\n"; |
| 116 | 116 | include_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
| 117 | - $formfile=new FormFile($db); |
|
| 118 | - $formfile->form_attach_new_file($_SERVER["PHP_SELF"], 'none', 0, ($section?$section:-1), $permtoupload, 48, null, '', 0, '', 0, $nameforformuserfile, '', $sectiondir); |
|
| 117 | + $formfile = new FormFile($db); |
|
| 118 | + $formfile->form_attach_new_file($_SERVER["PHP_SELF"], 'none', 0, ($section ? $section : -1), $permtoupload, 48, null, '', 0, '', 0, $nameforformuserfile, '', $sectiondir); |
|
| 119 | 119 | } |
| 120 | 120 | else print ' '; |
| 121 | 121 | |
@@ -136,12 +136,12 @@ discard block |
||
| 136 | 136 | // Confirmation de la suppression d'une ligne categorie |
| 137 | 137 | if ($action == 'delete_section') |
| 138 | 138 | { |
| 139 | - print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection','','',1); |
|
| 139 | + print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection', $ecmdir->label), 'confirm_deletesection', '', '', 1); |
|
| 140 | 140 | } |
| 141 | 141 | // End confirm |
| 142 | 142 | |
| 143 | 143 | |
| 144 | -if (empty($action) || $action == 'editfile' || $action == 'file_manager' || preg_match('/refresh/i',$action) || $action == 'delete') |
|
| 144 | +if (empty($action) || $action == 'editfile' || $action == 'file_manager' || preg_match('/refresh/i', $action) || $action == 'delete') |
|
| 145 | 145 | { |
| 146 | 146 | $langs->load("ecm"); |
| 147 | 147 | |
@@ -153,12 +153,12 @@ discard block |
||
| 153 | 153 | print ' '.$langs->trans("ECMSections"); |
| 154 | 154 | print '</th></tr>'; |
| 155 | 155 | |
| 156 | - $showonrightsize=''; |
|
| 156 | + $showonrightsize = ''; |
|
| 157 | 157 | |
| 158 | 158 | // Manual section |
| 159 | - $htmltooltip=$langs->trans("ECMAreaDesc2"); |
|
| 159 | + $htmltooltip = $langs->trans("ECMAreaDesc2"); |
|
| 160 | 160 | |
| 161 | - if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) |
|
| 161 | + if (!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) |
|
| 162 | 162 | { |
| 163 | 163 | // Show the link to "Root" |
| 164 | 164 | if ($showroot) |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | |
| 184 | 184 | $_POST['modulepart'] = $module; |
| 185 | 185 | $_POST['openeddir'] = GETPOST('openeddir'); |
| 186 | - $_POST['dir'] = empty($_POST['dir'])?'/':$_POST['dir']; |
|
| 186 | + $_POST['dir'] = empty($_POST['dir']) ? '/' : $_POST['dir']; |
|
| 187 | 187 | |
| 188 | 188 | // Show filemanager tree (will be filled by direct include of ajaxdirtree.php in mode noajax, this will return all dir - all levels - to show) |
| 189 | 189 | print '<div id="filetree" class="ecmfiletree">'; |
@@ -191,8 +191,8 @@ discard block |
||
| 191 | 191 | // Variables that may be defined: |
| 192 | 192 | // $_GET['modulepart'], $_GET['openeddir'], $_GET['sortfield'], $_GET['sortorder'] |
| 193 | 193 | // $_POST['dir'] |
| 194 | - $mode='noajax'; |
|
| 195 | - if (empty($url)) $url=DOL_URL_ROOT.'/ecm/index.php'; |
|
| 194 | + $mode = 'noajax'; |
|
| 195 | + if (empty($url)) $url = DOL_URL_ROOT.'/ecm/index.php'; |
|
| 196 | 196 | include DOL_DOCUMENT_ROOT.'/core/ajax/ajaxdirtree.php'; |
| 197 | 197 | |
| 198 | 198 | print '</div>'; |
@@ -214,9 +214,9 @@ discard block |
||
| 214 | 214 | // Start right panel |
| 215 | 215 | |
| 216 | 216 | |
| 217 | -$mode='noajax'; |
|
| 218 | -if (empty($url)) $url=DOL_URL_ROOT.'/ecm/index.php'; |
|
| 219 | -include DOL_DOCUMENT_ROOT.'/core/ajax/ajaxdirpreview.php'; // Show content of a directory on right side |
|
| 217 | +$mode = 'noajax'; |
|
| 218 | +if (empty($url)) $url = DOL_URL_ROOT.'/ecm/index.php'; |
|
| 219 | +include DOL_DOCUMENT_ROOT.'/core/ajax/ajaxdirpreview.php'; // Show content of a directory on right side |
|
| 220 | 220 | |
| 221 | 221 | |
| 222 | 222 | // End right panel |
@@ -229,14 +229,14 @@ discard block |
||
| 229 | 229 | <?php |
| 230 | 230 | |
| 231 | 231 | |
| 232 | -if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) // Show filtree when ajax is enabled |
|
| 232 | +if (!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) // Show filtree when ajax is enabled |
|
| 233 | 233 | { |
| 234 | 234 | //var_dump($modulepart); |
| 235 | 235 | // Variables that may be defined: |
| 236 | 236 | // $_GET['modulepart'], $_GET['openeddir'], $_GET['sortfield'], $_GET['sortorder'] |
| 237 | 237 | // $_POST['dir'] |
| 238 | 238 | // $_POST['section_dir'], $_POST['section_id'], $_POST['token'], $_POST['max_file_size'], $_POST['sendit'] |
| 239 | - if (GETPOST('section_dir','alpha')) { $preopened=GETPOST('section_dir','alpha'); } |
|
| 239 | + if (GETPOST('section_dir', 'alpha')) { $preopened = GETPOST('section_dir', 'alpha'); } |
|
| 240 | 240 | |
| 241 | 241 | include DOL_DOCUMENT_ROOT.'/ecm/tpl/enablefiletreeajax.tpl.php'; |
| 242 | 242 | } |
@@ -34,7 +34,9 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php'; |
| 36 | 36 | |
| 37 | -if (empty($module)) $module='ecm'; |
|
| 37 | +if (empty($module)) { |
|
| 38 | + $module='ecm'; |
|
| 39 | +} |
|
| 38 | 40 | |
| 39 | 41 | $permtoadd = 0; |
| 40 | 42 | $permtoupload = 0; |
@@ -77,8 +79,7 @@ discard block |
||
| 77 | 79 | print '<a href="'.DOL_URL_ROOT.'/ecm/dir_add_card.php?action=create&module='.urlencode($module).($websitekey?'&website='.$websitekey:'').($pageid?'&pageid='.$pageid:'').'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid).'" class="inline-block valignmiddle toolbarbutton" title="'.dol_escape_htmltag($langs->trans('ECMAddSection')).'">'; |
| 78 | 80 | print '<img class="toolbarbutton" border="0" src="'.DOL_URL_ROOT.'/theme/common/folder-new.png">'; |
| 79 | 81 | print '</a>'; |
| 80 | -} |
|
| 81 | -else |
|
| 82 | +} else |
|
| 82 | 83 | { |
| 83 | 84 | print '<a href="#" class="inline-block valignmiddle toolbarbutton" title="'.$langs->trans("NotAllowed").'">'; |
| 84 | 85 | print '<img class="toolbarbutton" border="0" src="'.DOL_URL_ROOT.'/theme/common/folder-new.png">'; |
@@ -116,8 +117,9 @@ discard block |
||
| 116 | 117 | include_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
| 117 | 118 | $formfile=new FormFile($db); |
| 118 | 119 | $formfile->form_attach_new_file($_SERVER["PHP_SELF"], 'none', 0, ($section?$section:-1), $permtoupload, 48, null, '', 0, '', 0, $nameforformuserfile, '', $sectiondir); |
| 120 | +} else { |
|
| 121 | + print ' '; |
|
| 119 | 122 | } |
| 120 | -else print ' '; |
|
| 121 | 123 | |
| 122 | 124 | print '</div>'; |
| 123 | 125 | // End "Add new file" area |
@@ -173,11 +175,12 @@ discard block |
||
| 173 | 175 | // Show filemanager tree (will be filled by a call of ajax /ecm/tpl/enablefiletreeajax.tpl.php, later, that executes ajaxdirtree.php) |
| 174 | 176 | print '<div id="filetree" class="ecmfiletree"></div>'; |
| 175 | 177 | |
| 176 | - if ($action == 'deletefile') print $form->formconfirm('eeeee', $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', '', 'deletefile'); |
|
| 178 | + if ($action == 'deletefile') { |
|
| 179 | + print $form->formconfirm('eeeee', $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', '', 'deletefile'); |
|
| 180 | + } |
|
| 177 | 181 | |
| 178 | 182 | print '</td></tr>'; |
| 179 | - } |
|
| 180 | - else // Show filtree when ajax is disabled (rare) |
|
| 183 | + } else // Show filtree when ajax is disabled (rare) |
|
| 181 | 184 | { |
| 182 | 185 | print '<tr><td style="padding-left: 20px">'; |
| 183 | 186 | |
@@ -192,7 +195,9 @@ discard block |
||
| 192 | 195 | // $_GET['modulepart'], $_GET['openeddir'], $_GET['sortfield'], $_GET['sortorder'] |
| 193 | 196 | // $_POST['dir'] |
| 194 | 197 | $mode='noajax'; |
| 195 | - if (empty($url)) $url=DOL_URL_ROOT.'/ecm/index.php'; |
|
| 198 | + if (empty($url)) { |
|
| 199 | + $url=DOL_URL_ROOT.'/ecm/index.php'; |
|
| 200 | + } |
|
| 196 | 201 | include DOL_DOCUMENT_ROOT.'/core/ajax/ajaxdirtree.php'; |
| 197 | 202 | |
| 198 | 203 | print '</div>'; |
@@ -215,7 +220,9 @@ discard block |
||
| 215 | 220 | |
| 216 | 221 | |
| 217 | 222 | $mode='noajax'; |
| 218 | -if (empty($url)) $url=DOL_URL_ROOT.'/ecm/index.php'; |
|
| 223 | +if (empty($url)) { |
|
| 224 | + $url=DOL_URL_ROOT.'/ecm/index.php'; |
|
| 225 | +} |
|
| 219 | 226 | include DOL_DOCUMENT_ROOT.'/core/ajax/ajaxdirpreview.php'; // Show content of a directory on right side |
| 220 | 227 | |
| 221 | 228 | |
@@ -229,14 +236,17 @@ discard block |
||
| 229 | 236 | <?php |
| 230 | 237 | |
| 231 | 238 | |
| 232 | -if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) // Show filtree when ajax is enabled |
|
| 239 | +if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) { |
|
| 240 | + // Show filtree when ajax is enabled |
|
| 233 | 241 | { |
| 234 | 242 | //var_dump($modulepart); |
| 235 | 243 | // Variables that may be defined: |
| 236 | 244 | // $_GET['modulepart'], $_GET['openeddir'], $_GET['sortfield'], $_GET['sortorder'] |
| 237 | 245 | // $_POST['dir'] |
| 238 | 246 | // $_POST['section_dir'], $_POST['section_id'], $_POST['token'], $_POST['max_file_size'], $_POST['sendit'] |
| 239 | - if (GETPOST('section_dir','alpha')) { $preopened=GETPOST('section_dir','alpha'); } |
|
| 247 | + if (GETPOST('section_dir','alpha')) { $preopened=GETPOST('section_dir','alpha'); |
|
| 248 | +} |
|
| 249 | +} |
|
| 240 | 250 | |
| 241 | 251 | include DOL_DOCUMENT_ROOT.'/ecm/tpl/enablefiletreeajax.tpl.php'; |
| 242 | 252 | } |
@@ -26,8 +26,8 @@ discard block |
||
| 26 | 26 | // Protection to avoid direct call of template |
| 27 | 27 | if (empty($conf) || ! is_object($conf)) |
| 28 | 28 | { |
| 29 | - print "Error, template page can't be called as URL"; |
|
| 30 | - exit; |
|
| 29 | + print "Error, template page can't be called as URL"; |
|
| 30 | + exit; |
|
| 31 | 31 | } |
| 32 | 32 | if (! is_object($form)) $form=new Form($db); |
| 33 | 33 | |
@@ -39,29 +39,29 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | foreach($object->fields as $key => $val) |
| 41 | 41 | { |
| 42 | - // Discard if extrafield is a hidden field on form |
|
| 43 | - if (abs($val['visible']) != 1) continue; |
|
| 42 | + // Discard if extrafield is a hidden field on form |
|
| 43 | + if (abs($val['visible']) != 1) continue; |
|
| 44 | 44 | |
| 45 | - if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! verifCond($val['enabled'])) continue; // We don't want this field |
|
| 46 | - if (in_array($key, array('ref','status'))) continue; // Ref and status are already in dol_banner |
|
| 45 | + if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! verifCond($val['enabled'])) continue; // We don't want this field |
|
| 46 | + if (in_array($key, array('ref','status'))) continue; // Ref and status are already in dol_banner |
|
| 47 | 47 | |
| 48 | - $value=$object->$key; |
|
| 48 | + $value=$object->$key; |
|
| 49 | 49 | |
| 50 | - print '<tr><td'; |
|
| 51 | - print ' class="titlefield'; |
|
| 52 | - if ($val['notnull'] > 0) print ' fieldrequired'; |
|
| 53 | - if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; |
|
| 54 | - print '">'; |
|
| 55 | - if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
| 56 | - else print $langs->trans($val['label']); |
|
| 57 | - print '</td>'; |
|
| 58 | - print '<td>'; |
|
| 59 | - print $object->showOutputField($val, $key, $value, '', '', '', 0); |
|
| 60 | - //print dol_escape_htmltag($object->$key, 1, 1); |
|
| 61 | - print '</td>'; |
|
| 62 | - print '</tr>'; |
|
| 50 | + print '<tr><td'; |
|
| 51 | + print ' class="titlefield'; |
|
| 52 | + if ($val['notnull'] > 0) print ' fieldrequired'; |
|
| 53 | + if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; |
|
| 54 | + print '">'; |
|
| 55 | + if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
| 56 | + else print $langs->trans($val['label']); |
|
| 57 | + print '</td>'; |
|
| 58 | + print '<td>'; |
|
| 59 | + print $object->showOutputField($val, $key, $value, '', '', '', 0); |
|
| 60 | + //print dol_escape_htmltag($object->$key, 1, 1); |
|
| 61 | + print '</td>'; |
|
| 62 | + print '</tr>'; |
|
| 63 | 63 | |
| 64 | - if (! empty($keyforbreak) && $key == $keyforbreak) break; // key used for break on second column |
|
| 64 | + if (! empty($keyforbreak) && $key == $keyforbreak) break; // key used for break on second column |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | print '</table>'; |
@@ -74,31 +74,31 @@ discard block |
||
| 74 | 74 | $alreadyoutput = 1; |
| 75 | 75 | foreach($object->fields as $key => $val) |
| 76 | 76 | { |
| 77 | - if ($alreadyoutput) |
|
| 78 | - { |
|
| 79 | - if (! empty($keyforbreak) && $key == $keyforbreak) $alreadyoutput = 0; // key used for break on second column |
|
| 80 | - continue; |
|
| 81 | - } |
|
| 77 | + if ($alreadyoutput) |
|
| 78 | + { |
|
| 79 | + if (! empty($keyforbreak) && $key == $keyforbreak) $alreadyoutput = 0; // key used for break on second column |
|
| 80 | + continue; |
|
| 81 | + } |
|
| 82 | 82 | |
| 83 | - if (abs($val['visible']) != 1) continue; // Discard such field from form |
|
| 84 | - if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field |
|
| 85 | - if (in_array($key, array('ref','status'))) continue; // Ref and status are already in dol_banner |
|
| 83 | + if (abs($val['visible']) != 1) continue; // Discard such field from form |
|
| 84 | + if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field |
|
| 85 | + if (in_array($key, array('ref','status'))) continue; // Ref and status are already in dol_banner |
|
| 86 | 86 | |
| 87 | - $value=$object->$key; |
|
| 87 | + $value=$object->$key; |
|
| 88 | 88 | |
| 89 | - print '<tr><td'; |
|
| 90 | - print ' class="titlefield'; |
|
| 91 | - if ($val['notnull'] > 0) print ' fieldrequired'; |
|
| 92 | - if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; |
|
| 93 | - print '">'; |
|
| 94 | - if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
| 95 | - else print $langs->trans($val['label']); |
|
| 96 | - print '</td>'; |
|
| 97 | - print '<td>'; |
|
| 98 | - print $object->showOutputField($val, $key, $value, '', '', '', 0); |
|
| 99 | - //print dol_escape_htmltag($object->$key, 1, 1); |
|
| 100 | - print '</td>'; |
|
| 101 | - print '</tr>'; |
|
| 89 | + print '<tr><td'; |
|
| 90 | + print ' class="titlefield'; |
|
| 91 | + if ($val['notnull'] > 0) print ' fieldrequired'; |
|
| 92 | + if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; |
|
| 93 | + print '">'; |
|
| 94 | + if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
| 95 | + else print $langs->trans($val['label']); |
|
| 96 | + print '</td>'; |
|
| 97 | + print '<td>'; |
|
| 98 | + print $object->showOutputField($val, $key, $value, '', '', '', 0); |
|
| 99 | + //print dol_escape_htmltag($object->$key, 1, 1); |
|
| 100 | + print '</td>'; |
|
| 101 | + print '</tr>'; |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | ?> |
@@ -24,12 +24,12 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | |
| 26 | 26 | // Protection to avoid direct call of template |
| 27 | -if (empty($conf) || ! is_object($conf)) |
|
| 27 | +if (empty($conf) || !is_object($conf)) |
|
| 28 | 28 | { |
| 29 | 29 | print "Error, template page can't be called as URL"; |
| 30 | 30 | exit; |
| 31 | 31 | } |
| 32 | -if (! is_object($form)) $form=new Form($db); |
|
| 32 | +if (!is_object($form)) $form = new Form($db); |
|
| 33 | 33 | |
| 34 | 34 | ?> |
| 35 | 35 | <!-- BEGIN PHP TEMPLATE commonfields_view.tpl.php --> |
@@ -37,22 +37,22 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | $object->fields = dol_sort_array($object->fields, 'position'); |
| 39 | 39 | |
| 40 | -foreach($object->fields as $key => $val) |
|
| 40 | +foreach ($object->fields as $key => $val) |
|
| 41 | 41 | { |
| 42 | 42 | // Discard if extrafield is a hidden field on form |
| 43 | 43 | if (abs($val['visible']) != 1) continue; |
| 44 | 44 | |
| 45 | - if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! verifCond($val['enabled'])) continue; // We don't want this field |
|
| 46 | - if (in_array($key, array('ref','status'))) continue; // Ref and status are already in dol_banner |
|
| 45 | + if (array_key_exists('enabled', $val) && isset($val['enabled']) && !verifCond($val['enabled'])) continue; // We don't want this field |
|
| 46 | + if (in_array($key, array('ref', 'status'))) continue; // Ref and status are already in dol_banner |
|
| 47 | 47 | |
| 48 | - $value=$object->$key; |
|
| 48 | + $value = $object->$key; |
|
| 49 | 49 | |
| 50 | 50 | print '<tr><td'; |
| 51 | 51 | print ' class="titlefield'; |
| 52 | 52 | if ($val['notnull'] > 0) print ' fieldrequired'; |
| 53 | 53 | if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; |
| 54 | 54 | print '">'; |
| 55 | - if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
| 55 | + if (!empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
| 56 | 56 | else print $langs->trans($val['label']); |
| 57 | 57 | print '</td>'; |
| 58 | 58 | print '<td>'; |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | print '</td>'; |
| 62 | 62 | print '</tr>'; |
| 63 | 63 | |
| 64 | - if (! empty($keyforbreak) && $key == $keyforbreak) break; // key used for break on second column |
|
| 64 | + if (!empty($keyforbreak) && $key == $keyforbreak) break; // key used for break on second column |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | print '</table>'; |
@@ -72,26 +72,26 @@ discard block |
||
| 72 | 72 | print '<table class="border centpercent">'; |
| 73 | 73 | |
| 74 | 74 | $alreadyoutput = 1; |
| 75 | -foreach($object->fields as $key => $val) |
|
| 75 | +foreach ($object->fields as $key => $val) |
|
| 76 | 76 | { |
| 77 | 77 | if ($alreadyoutput) |
| 78 | 78 | { |
| 79 | - if (! empty($keyforbreak) && $key == $keyforbreak) $alreadyoutput = 0; // key used for break on second column |
|
| 79 | + if (!empty($keyforbreak) && $key == $keyforbreak) $alreadyoutput = 0; // key used for break on second column |
|
| 80 | 80 | continue; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - if (abs($val['visible']) != 1) continue; // Discard such field from form |
|
| 84 | - if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field |
|
| 85 | - if (in_array($key, array('ref','status'))) continue; // Ref and status are already in dol_banner |
|
| 83 | + if (abs($val['visible']) != 1) continue; // Discard such field from form |
|
| 84 | + if (array_key_exists('enabled', $val) && isset($val['enabled']) && !$val['enabled']) continue; // We don't want this field |
|
| 85 | + if (in_array($key, array('ref', 'status'))) continue; // Ref and status are already in dol_banner |
|
| 86 | 86 | |
| 87 | - $value=$object->$key; |
|
| 87 | + $value = $object->$key; |
|
| 88 | 88 | |
| 89 | 89 | print '<tr><td'; |
| 90 | 90 | print ' class="titlefield'; |
| 91 | 91 | if ($val['notnull'] > 0) print ' fieldrequired'; |
| 92 | 92 | if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; |
| 93 | 93 | print '">'; |
| 94 | - if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
| 94 | + if (!empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
| 95 | 95 | else print $langs->trans($val['label']); |
| 96 | 96 | print '</td>'; |
| 97 | 97 | print '<td>'; |
@@ -29,7 +29,9 @@ discard block |
||
| 29 | 29 | print "Error, template page can't be called as URL"; |
| 30 | 30 | exit; |
| 31 | 31 | } |
| 32 | -if (! is_object($form)) $form=new Form($db); |
|
| 32 | +if (! is_object($form)) { |
|
| 33 | + $form=new Form($db); |
|
| 34 | +} |
|
| 33 | 35 | |
| 34 | 36 | ?> |
| 35 | 37 | <!-- BEGIN PHP TEMPLATE commonfields_view.tpl.php --> |
@@ -40,20 +42,35 @@ discard block |
||
| 40 | 42 | foreach($object->fields as $key => $val) |
| 41 | 43 | { |
| 42 | 44 | // Discard if extrafield is a hidden field on form |
| 43 | - if (abs($val['visible']) != 1) continue; |
|
| 45 | + if (abs($val['visible']) != 1) { |
|
| 46 | + continue; |
|
| 47 | + } |
|
| 44 | 48 | |
| 45 | - if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! verifCond($val['enabled'])) continue; // We don't want this field |
|
| 46 | - if (in_array($key, array('ref','status'))) continue; // Ref and status are already in dol_banner |
|
| 49 | + if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! verifCond($val['enabled'])) { |
|
| 50 | + continue; |
|
| 51 | + } |
|
| 52 | + // We don't want this field |
|
| 53 | + if (in_array($key, array('ref','status'))) { |
|
| 54 | + continue; |
|
| 55 | + } |
|
| 56 | + // Ref and status are already in dol_banner |
|
| 47 | 57 | |
| 48 | 58 | $value=$object->$key; |
| 49 | 59 | |
| 50 | 60 | print '<tr><td'; |
| 51 | 61 | print ' class="titlefield'; |
| 52 | - if ($val['notnull'] > 0) print ' fieldrequired'; |
|
| 53 | - if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; |
|
| 62 | + if ($val['notnull'] > 0) { |
|
| 63 | + print ' fieldrequired'; |
|
| 64 | + } |
|
| 65 | + if ($val['type'] == 'text' || $val['type'] == 'html') { |
|
| 66 | + print ' tdtop'; |
|
| 67 | + } |
|
| 54 | 68 | print '">'; |
| 55 | - if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
| 56 | - else print $langs->trans($val['label']); |
|
| 69 | + if (! empty($val['help'])) { |
|
| 70 | + print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
| 71 | + } else { |
|
| 72 | + print $langs->trans($val['label']); |
|
| 73 | + } |
|
| 57 | 74 | print '</td>'; |
| 58 | 75 | print '<td>'; |
| 59 | 76 | print $object->showOutputField($val, $key, $value, '', '', '', 0); |
@@ -61,7 +78,10 @@ discard block |
||
| 61 | 78 | print '</td>'; |
| 62 | 79 | print '</tr>'; |
| 63 | 80 | |
| 64 | - if (! empty($keyforbreak) && $key == $keyforbreak) break; // key used for break on second column |
|
| 81 | + if (! empty($keyforbreak) && $key == $keyforbreak) { |
|
| 82 | + break; |
|
| 83 | + } |
|
| 84 | + // key used for break on second column |
|
| 65 | 85 | } |
| 66 | 86 | |
| 67 | 87 | print '</table>'; |
@@ -76,23 +96,42 @@ discard block |
||
| 76 | 96 | { |
| 77 | 97 | if ($alreadyoutput) |
| 78 | 98 | { |
| 79 | - if (! empty($keyforbreak) && $key == $keyforbreak) $alreadyoutput = 0; // key used for break on second column |
|
| 99 | + if (! empty($keyforbreak) && $key == $keyforbreak) { |
|
| 100 | + $alreadyoutput = 0; |
|
| 101 | + } |
|
| 102 | + // key used for break on second column |
|
| 80 | 103 | continue; |
| 81 | 104 | } |
| 82 | 105 | |
| 83 | - if (abs($val['visible']) != 1) continue; // Discard such field from form |
|
| 84 | - if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field |
|
| 85 | - if (in_array($key, array('ref','status'))) continue; // Ref and status are already in dol_banner |
|
| 106 | + if (abs($val['visible']) != 1) { |
|
| 107 | + continue; |
|
| 108 | + } |
|
| 109 | + // Discard such field from form |
|
| 110 | + if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) { |
|
| 111 | + continue; |
|
| 112 | + } |
|
| 113 | + // We don't want this field |
|
| 114 | + if (in_array($key, array('ref','status'))) { |
|
| 115 | + continue; |
|
| 116 | + } |
|
| 117 | + // Ref and status are already in dol_banner |
|
| 86 | 118 | |
| 87 | 119 | $value=$object->$key; |
| 88 | 120 | |
| 89 | 121 | print '<tr><td'; |
| 90 | 122 | print ' class="titlefield'; |
| 91 | - if ($val['notnull'] > 0) print ' fieldrequired'; |
|
| 92 | - if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; |
|
| 123 | + if ($val['notnull'] > 0) { |
|
| 124 | + print ' fieldrequired'; |
|
| 125 | + } |
|
| 126 | + if ($val['type'] == 'text' || $val['type'] == 'html') { |
|
| 127 | + print ' tdtop'; |
|
| 128 | + } |
|
| 93 | 129 | print '">'; |
| 94 | - if (! empty($val['help'])) print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
| 95 | - else print $langs->trans($val['label']); |
|
| 130 | + if (! empty($val['help'])) { |
|
| 131 | + print $form->textwithpicto($langs->trans($val['label']), $val['help']); |
|
| 132 | + } else { |
|
| 133 | + print $langs->trans($val['label']); |
|
| 134 | + } |
|
| 96 | 135 | print '</td>'; |
| 97 | 136 | print '<td>'; |
| 98 | 137 | print $object->showOutputField($val, $key, $value, '', '', '', 0); |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | <?php |
| 3 | 3 | |
| 4 | 4 | // Protection to avoid direct call of template |
| 5 | -if (empty($conf) || ! is_object($conf)) |
|
| 5 | +if (empty($conf) || !is_object($conf)) |
|
| 6 | 6 | { |
| 7 | 7 | print "Error, template page can't be called as URL"; |
| 8 | 8 | exit; |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | $out = '<div class="tagtable centpercent noborder allwidth nohover">'; |
| 18 | 18 | |
| 19 | -$out .= '<form class="tagtr nohover '.($var==true?'pair':'impair').'" action="'.$_SERVER["PHP_SELF"].'" method="POST">'; |
|
| 19 | +$out .= '<form class="tagtr nohover '.($var == true ? 'pair' : 'impair').'" action="'.$_SERVER["PHP_SELF"].'" method="POST">'; |
|
| 20 | 20 | $out .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; |
| 21 | 21 | $out .= '<input type="hidden" name="action" value="add_element_resource">'; |
| 22 | 22 | $out .= '<input type="hidden" name="element" value="'.$element.'">'; |
@@ -27,18 +27,18 @@ discard block |
||
| 27 | 27 | // Place |
| 28 | 28 | $out .= '<div class="tagtd">'.$langs->trans("SelectResource").'</div>'; |
| 29 | 29 | $out .= '<div class="tagtd">'; |
| 30 | -$events=array(); |
|
| 31 | -$out .= $formresources->select_resource_list('','fk_resource','',1,1,0,$events,'',2,null); |
|
| 30 | +$events = array(); |
|
| 31 | +$out .= $formresources->select_resource_list('', 'fk_resource', '', 1, 1, 0, $events, '', 2, null); |
|
| 32 | 32 | $out .= '</div>'; |
| 33 | 33 | |
| 34 | -$out .= '<div class="tagtd"><label>'.$langs->trans('Busy').'</label> '.$form->selectyesno('busy',(isset($_POST['busy'])?$_POST['busy']:1),1).'</div>'; |
|
| 35 | -$out .= '<div class="tagtd"><label>'.$langs->trans('Mandatory').'</label> '.$form->selectyesno('mandatory',(isset($_POST['mandatory'])?$_POST['mandatory']:0),1).'</div>'; |
|
| 34 | +$out .= '<div class="tagtd"><label>'.$langs->trans('Busy').'</label> '.$form->selectyesno('busy', (isset($_POST['busy']) ? $_POST['busy'] : 1), 1).'</div>'; |
|
| 35 | +$out .= '<div class="tagtd"><label>'.$langs->trans('Mandatory').'</label> '.$form->selectyesno('mandatory', (isset($_POST['mandatory']) ? $_POST['mandatory'] : 0), 1).'</div>'; |
|
| 36 | 36 | |
| 37 | 37 | $out .= '<div class="tagtd" align="right">'; |
| 38 | -$out .='<input type="submit" id="add-resource-place" class="button" value="'.$langs->trans("Add").'"/>'; |
|
| 38 | +$out .= '<input type="submit" id="add-resource-place" class="button" value="'.$langs->trans("Add").'"/>'; |
|
| 39 | 39 | $out .= '</div>'; |
| 40 | 40 | |
| 41 | -$out .='</form>'; |
|
| 41 | +$out .= '</form>'; |
|
| 42 | 42 | |
| 43 | 43 | $out .= '</div>'; |
| 44 | 44 | $out .= '<br>'; |
@@ -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 | |
@@ -40,8 +40,8 @@ discard block |
||
| 40 | 40 | // Protection to avoid direct call of template |
| 41 | 41 | if (empty($object) || ! is_object($object)) |
| 42 | 42 | { |
| 43 | - print "Error, template page can't be called as URL"; |
|
| 44 | - exit; |
|
| 43 | + print "Error, template page can't be called as URL"; |
|
| 44 | + exit; |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
@@ -72,126 +72,126 @@ discard block |
||
| 72 | 72 | <?php } ?> |
| 73 | 73 | <td class="linecoldescription minwidth300imp"><?php $coldisplay++; ?><div id="line_<?php echo $line->id; ?>"></div> |
| 74 | 74 | <?php |
| 75 | - if (($line->info_bits & 2) == 2) { |
|
| 76 | - ?> |
|
| 75 | + if (($line->info_bits & 2) == 2) { |
|
| 76 | + ?> |
|
| 77 | 77 | <a href="<?php echo DOL_URL_ROOT.'/comm/remx.php?id='.$this->socid; ?>"> |
| 78 | 78 | <?php |
| 79 | - $txt=''; |
|
| 80 | - print img_object($langs->trans("ShowReduc"),'reduc').' '; |
|
| 81 | - if ($line->description == '(DEPOSIT)') $txt=$langs->trans("Deposit"); |
|
| 82 | - elseif ($line->description == '(EXCESS RECEIVED)') $txt=$langs->trans("ExcessReceived"); |
|
| 83 | - elseif ($line->description == '(EXCESS PAID)') $txt=$langs->trans("ExcessPaid"); |
|
| 84 | - //else $txt=$langs->trans("Discount"); |
|
| 85 | - print $txt; |
|
| 86 | - ?> |
|
| 79 | + $txt=''; |
|
| 80 | + print img_object($langs->trans("ShowReduc"),'reduc').' '; |
|
| 81 | + if ($line->description == '(DEPOSIT)') $txt=$langs->trans("Deposit"); |
|
| 82 | + elseif ($line->description == '(EXCESS RECEIVED)') $txt=$langs->trans("ExcessReceived"); |
|
| 83 | + elseif ($line->description == '(EXCESS PAID)') $txt=$langs->trans("ExcessPaid"); |
|
| 84 | + //else $txt=$langs->trans("Discount"); |
|
| 85 | + print $txt; |
|
| 86 | + ?> |
|
| 87 | 87 | </a> |
| 88 | 88 | <?php |
| 89 | - if ($line->description) |
|
| 90 | - { |
|
| 91 | - if ($line->description == '(CREDIT_NOTE)' && $line->fk_remise_except > 0) |
|
| 92 | - { |
|
| 93 | - $discount=new DiscountAbsolute($this->db); |
|
| 94 | - $discount->fetch($line->fk_remise_except); |
|
| 95 | - echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0)); |
|
| 96 | - } |
|
| 97 | - elseif ($line->description == '(DEPOSIT)' && $line->fk_remise_except > 0) |
|
| 98 | - { |
|
| 99 | - $discount=new DiscountAbsolute($this->db); |
|
| 100 | - $discount->fetch($line->fk_remise_except); |
|
| 101 | - echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0)); |
|
| 102 | - // Add date of deposit |
|
| 103 | - if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) |
|
| 104 | - echo ' ('.dol_print_date($discount->datec).')'; |
|
| 105 | - } |
|
| 106 | - elseif ($line->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0) |
|
| 107 | - { |
|
| 108 | - $discount=new DiscountAbsolute($this->db); |
|
| 109 | - $discount->fetch($line->fk_remise_except); |
|
| 110 | - echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessReceived",$discount->getNomUrl(0)); |
|
| 111 | - } |
|
| 112 | - elseif ($line->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0) |
|
| 113 | - { |
|
| 114 | - $discount=new DiscountAbsolute($this->db); |
|
| 115 | - $discount->fetch($line->fk_remise_except); |
|
| 116 | - echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessPaid",$discount->getNomUrl(0)); |
|
| 117 | - } |
|
| 118 | - else |
|
| 119 | - { |
|
| 120 | - echo ($txt?' - ':'').dol_htmlentitiesbr($line->description); |
|
| 121 | - } |
|
| 122 | - } |
|
| 123 | - } |
|
| 124 | - else |
|
| 125 | - { |
|
| 126 | - $format = $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE?'dayhour':'day'; |
|
| 89 | + if ($line->description) |
|
| 90 | + { |
|
| 91 | + if ($line->description == '(CREDIT_NOTE)' && $line->fk_remise_except > 0) |
|
| 92 | + { |
|
| 93 | + $discount=new DiscountAbsolute($this->db); |
|
| 94 | + $discount->fetch($line->fk_remise_except); |
|
| 95 | + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0)); |
|
| 96 | + } |
|
| 97 | + elseif ($line->description == '(DEPOSIT)' && $line->fk_remise_except > 0) |
|
| 98 | + { |
|
| 99 | + $discount=new DiscountAbsolute($this->db); |
|
| 100 | + $discount->fetch($line->fk_remise_except); |
|
| 101 | + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0)); |
|
| 102 | + // Add date of deposit |
|
| 103 | + if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) |
|
| 104 | + echo ' ('.dol_print_date($discount->datec).')'; |
|
| 105 | + } |
|
| 106 | + elseif ($line->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0) |
|
| 107 | + { |
|
| 108 | + $discount=new DiscountAbsolute($this->db); |
|
| 109 | + $discount->fetch($line->fk_remise_except); |
|
| 110 | + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessReceived",$discount->getNomUrl(0)); |
|
| 111 | + } |
|
| 112 | + elseif ($line->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0) |
|
| 113 | + { |
|
| 114 | + $discount=new DiscountAbsolute($this->db); |
|
| 115 | + $discount->fetch($line->fk_remise_except); |
|
| 116 | + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessPaid",$discount->getNomUrl(0)); |
|
| 117 | + } |
|
| 118 | + else |
|
| 119 | + { |
|
| 120 | + echo ($txt?' - ':'').dol_htmlentitiesbr($line->description); |
|
| 121 | + } |
|
| 122 | + } |
|
| 123 | + } |
|
| 124 | + else |
|
| 125 | + { |
|
| 126 | + $format = $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE?'dayhour':'day'; |
|
| 127 | 127 | |
| 128 | - if ($line->fk_product > 0) |
|
| 129 | - { |
|
| 130 | - echo $form->textwithtooltip($text,$description,3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); |
|
| 131 | - } |
|
| 132 | - else |
|
| 133 | - { |
|
| 134 | - if ($type==1) $text = img_object($langs->trans('Service'),'service'); |
|
| 135 | - else $text = img_object($langs->trans('Product'),'product'); |
|
| 128 | + if ($line->fk_product > 0) |
|
| 129 | + { |
|
| 130 | + echo $form->textwithtooltip($text,$description,3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); |
|
| 131 | + } |
|
| 132 | + else |
|
| 133 | + { |
|
| 134 | + if ($type==1) $text = img_object($langs->trans('Service'),'service'); |
|
| 135 | + else $text = img_object($langs->trans('Product'),'product'); |
|
| 136 | 136 | |
| 137 | - if (! empty($line->label)) { |
|
| 138 | - $text.= ' <strong>'.$line->label.'</strong>'; |
|
| 139 | - echo $form->textwithtooltip($text,dol_htmlentitiesbr($line->description),3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); |
|
| 140 | - } else { |
|
| 141 | - if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow'); |
|
| 142 | - echo $text.' '.dol_htmlentitiesbr($line->description); |
|
| 143 | - } |
|
| 144 | - } |
|
| 137 | + if (! empty($line->label)) { |
|
| 138 | + $text.= ' <strong>'.$line->label.'</strong>'; |
|
| 139 | + echo $form->textwithtooltip($text,dol_htmlentitiesbr($line->description),3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); |
|
| 140 | + } else { |
|
| 141 | + if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow'); |
|
| 142 | + echo $text.' '.dol_htmlentitiesbr($line->description); |
|
| 143 | + } |
|
| 144 | + } |
|
| 145 | 145 | |
| 146 | - // Show date range |
|
| 147 | - if ($line->element == 'facturedetrec') { |
|
| 148 | - if ($line->date_start_fill || $line->date_end_fill) echo '<br><div class="clearboth nowraponall">'; |
|
| 149 | - if ($line->date_start_fill) echo $langs->trans('AutoFillDateFromShort').': '.yn($line->date_start_fill); |
|
| 150 | - if ($line->date_start_fill && $line->date_end_fill) echo ' - '; |
|
| 151 | - if ($line->date_end_fill) echo $langs->trans('AutoFillDateToShort').': '.yn($line->date_end_fill); |
|
| 152 | - if ($line->date_start_fill || $line->date_end_fill) echo '</div>'; |
|
| 153 | - } |
|
| 154 | - else { |
|
| 155 | - if ($line->date_start || $line->date_end) echo '<br><div class="clearboth nowraponall">'.get_date_range($line->date_start, $line->date_end, $format).'</div>'; |
|
| 156 | - //echo get_date_range($line->date_start, $line->date_end, $format); |
|
| 157 | - } |
|
| 146 | + // Show date range |
|
| 147 | + if ($line->element == 'facturedetrec') { |
|
| 148 | + if ($line->date_start_fill || $line->date_end_fill) echo '<br><div class="clearboth nowraponall">'; |
|
| 149 | + if ($line->date_start_fill) echo $langs->trans('AutoFillDateFromShort').': '.yn($line->date_start_fill); |
|
| 150 | + if ($line->date_start_fill && $line->date_end_fill) echo ' - '; |
|
| 151 | + if ($line->date_end_fill) echo $langs->trans('AutoFillDateToShort').': '.yn($line->date_end_fill); |
|
| 152 | + if ($line->date_start_fill || $line->date_end_fill) echo '</div>'; |
|
| 153 | + } |
|
| 154 | + else { |
|
| 155 | + if ($line->date_start || $line->date_end) echo '<br><div class="clearboth nowraponall">'.get_date_range($line->date_start, $line->date_end, $format).'</div>'; |
|
| 156 | + //echo get_date_range($line->date_start, $line->date_end, $format); |
|
| 157 | + } |
|
| 158 | 158 | |
| 159 | - // Add description in form |
|
| 160 | - if ($line->fk_product > 0 && ! empty($conf->global->PRODUIT_DESC_IN_FORM)) |
|
| 161 | - { |
|
| 162 | - print (! empty($line->description) && $line->description!=$line->product_label)?'<br>'.dol_htmlentitiesbr($line->description):''; |
|
| 163 | - } |
|
| 164 | - } |
|
| 159 | + // Add description in form |
|
| 160 | + if ($line->fk_product > 0 && ! empty($conf->global->PRODUIT_DESC_IN_FORM)) |
|
| 161 | + { |
|
| 162 | + print (! empty($line->description) && $line->description!=$line->product_label)?'<br>'.dol_htmlentitiesbr($line->description):''; |
|
| 163 | + } |
|
| 164 | + } |
|
| 165 | 165 | |
| 166 | - if (! empty($conf->accounting->enabled) && $line->fk_accounting_account > 0) |
|
| 167 | - { |
|
| 168 | - $accountingaccount=new AccountingAccount($this->db); |
|
| 169 | - $accountingaccount->fetch($line->fk_accounting_account); |
|
| 170 | - echo '<div class="clearboth"></div><br><span class="opacitymedium">' . $langs->trans('AccountingAffectation') . ' : </span>' . $accountingaccount->getNomUrl(0,1,1); |
|
| 171 | - } |
|
| 166 | + if (! empty($conf->accounting->enabled) && $line->fk_accounting_account > 0) |
|
| 167 | + { |
|
| 168 | + $accountingaccount=new AccountingAccount($this->db); |
|
| 169 | + $accountingaccount->fetch($line->fk_accounting_account); |
|
| 170 | + echo '<div class="clearboth"></div><br><span class="opacitymedium">' . $langs->trans('AccountingAffectation') . ' : </span>' . $accountingaccount->getNomUrl(0,1,1); |
|
| 171 | + } |
|
| 172 | 172 | |
| 173 | - ?> |
|
| 173 | + ?> |
|
| 174 | 174 | </td> |
| 175 | 175 | <?php |
| 176 | - if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines |
|
| 177 | - { |
|
| 178 | - ?> |
|
| 176 | + if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines |
|
| 177 | + { |
|
| 178 | + ?> |
|
| 179 | 179 | <td class="linecolrefsupplier"><?php |
| 180 | - echo ($line->ref_fourn?$line->ref_fourn:$line->ref_supplier); |
|
| 181 | - ?></td> |
|
| 180 | + echo ($line->ref_fourn?$line->ref_fourn:$line->ref_supplier); |
|
| 181 | + ?></td> |
|
| 182 | 182 | <?php |
| 183 | - } |
|
| 184 | - // VAT Rate |
|
| 185 | - ?> |
|
| 183 | + } |
|
| 184 | + // VAT Rate |
|
| 185 | + ?> |
|
| 186 | 186 | <td align="right" class="linecolvat nowrap"><?php $coldisplay++; ?><?php |
| 187 | - $positiverates=''; |
|
| 188 | - if (price2num($line->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx); |
|
| 189 | - if (price2num($line->total_localtax1)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); |
|
| 190 | - if (price2num($line->total_localtax2)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); |
|
| 191 | - if (empty($positiverates)) $positiverates='0'; |
|
| 192 | - echo vatrate($positiverates.($line->vat_src_code?' ('.$line->vat_src_code.')':''), '%', $line->info_bits); |
|
| 193 | - //echo vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits); |
|
| 194 | - ?></td> |
|
| 187 | + $positiverates=''; |
|
| 188 | + if (price2num($line->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx); |
|
| 189 | + if (price2num($line->total_localtax1)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); |
|
| 190 | + if (price2num($line->total_localtax2)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); |
|
| 191 | + if (empty($positiverates)) $positiverates='0'; |
|
| 192 | + echo vatrate($positiverates.($line->vat_src_code?' ('.$line->vat_src_code.')':''), '%', $line->info_bits); |
|
| 193 | + //echo vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits); |
|
| 194 | + ?></td> |
|
| 195 | 195 | |
| 196 | 196 | <td align="right" class="linecoluht nowrap"><?php $coldisplay++; ?><?php echo price($line->subprice); ?></td> |
| 197 | 197 | |
@@ -205,45 +205,45 @@ discard block |
||
| 205 | 205 | |
| 206 | 206 | <td align="right" class="linecolqty nowrap"><?php $coldisplay++; ?> |
| 207 | 207 | <?php if ((($line->info_bits & 2) != 2) && $line->special_code != 3) { |
| 208 | - // I comment this because it shows info even when not required |
|
| 209 | - // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated |
|
| 210 | - // must also not be output for most entities (proposal, intervention, ...) |
|
| 211 | - //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." "; |
|
| 212 | - echo $line->qty; |
|
| 213 | - } else echo ' '; ?> |
|
| 208 | + // I comment this because it shows info even when not required |
|
| 209 | + // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated |
|
| 210 | + // must also not be output for most entities (proposal, intervention, ...) |
|
| 211 | + //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." "; |
|
| 212 | + echo $line->qty; |
|
| 213 | + } else echo ' '; ?> |
|
| 214 | 214 | </td> |
| 215 | 215 | |
| 216 | 216 | <?php |
| 217 | - if($conf->global->PRODUCT_USE_UNITS) |
|
| 218 | - { |
|
| 219 | - print '<td align="left" class="linecoluseunit nowrap">'; |
|
| 220 | - $label = $line->getLabelOfUnit('short'); |
|
| 221 | - if ($label !== '') { |
|
| 222 | - print $langs->trans($label); |
|
| 223 | - } |
|
| 224 | - print '</td>'; |
|
| 225 | - } |
|
| 226 | - ?> |
|
| 217 | + if($conf->global->PRODUCT_USE_UNITS) |
|
| 218 | + { |
|
| 219 | + print '<td align="left" class="linecoluseunit nowrap">'; |
|
| 220 | + $label = $line->getLabelOfUnit('short'); |
|
| 221 | + if ($label !== '') { |
|
| 222 | + print $langs->trans($label); |
|
| 223 | + } |
|
| 224 | + print '</td>'; |
|
| 225 | + } |
|
| 226 | + ?> |
|
| 227 | 227 | |
| 228 | 228 | <?php if (!empty($line->remise_percent) && $line->special_code != 3) { ?> |
| 229 | 229 | <td class="linecoldiscount" align="right"><?php |
| 230 | - $coldisplay++; |
|
| 231 | - include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
|
| 232 | - echo dol_print_reduction($line->remise_percent,$langs); |
|
| 233 | - ?></td> |
|
| 230 | + $coldisplay++; |
|
| 231 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
|
| 232 | + echo dol_print_reduction($line->remise_percent,$langs); |
|
| 233 | + ?></td> |
|
| 234 | 234 | <?php } else { ?> |
| 235 | 235 | <td class="linecoldiscount"><?php $coldisplay++; ?> </td> |
| 236 | 236 | <?php } |
| 237 | 237 | |
| 238 | - if ($this->situation_cycle_ref) { |
|
| 239 | - $coldisplay++; |
|
| 240 | - print '<td align="right" class="linecolcycleref nowrap">' . $line->situation_percent . '%</td>'; |
|
| 241 | - } |
|
| 238 | + if ($this->situation_cycle_ref) { |
|
| 239 | + $coldisplay++; |
|
| 240 | + print '<td align="right" class="linecolcycleref nowrap">' . $line->situation_percent . '%</td>'; |
|
| 241 | + } |
|
| 242 | 242 | |
| 243 | - if ($usemargins && ! empty($conf->margin->enabled) && empty($user->societe_id)) |
|
| 244 | - { |
|
| 245 | - $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); |
|
| 246 | - ?> |
|
| 243 | + if ($usemargins && ! empty($conf->margin->enabled) && empty($user->societe_id)) |
|
| 244 | + { |
|
| 245 | + $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); |
|
| 246 | + ?> |
|
| 247 | 247 | |
| 248 | 248 | <?php if (!empty($user->rights->margins->creer)) { ?> |
| 249 | 249 | <td align="right" class="linecolmargin1 nowrap margininfos"><?php $coldisplay++; ?><?php echo price($line->pa_ht); ?></td> |
@@ -254,8 +254,8 @@ discard block |
||
| 254 | 254 | if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {?> |
| 255 | 255 | <td align="right" class="linecolmargin2 nowrap margininfos"><?php $coldisplay++; ?><?php echo price($line->marque_tx, null, null, null, null, $rounding).'%'; ?></td> |
| 256 | 256 | <?php } |
| 257 | - } |
|
| 258 | - ?> |
|
| 257 | + } |
|
| 258 | + ?> |
|
| 259 | 259 | |
| 260 | 260 | <?php if ($line->special_code == 3) { ?> |
| 261 | 261 | <td align="right" class="linecoloption nowrap"><?php $coldisplay++; ?><?php echo $langs->trans('Option'); ?></td> |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | |
| 272 | 272 | |
| 273 | 273 | <?php |
| 274 | - if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines' ) { ?> |
|
| 274 | + if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines' ) { ?> |
|
| 275 | 275 | <td class="linecoledit" align="center"><?php $coldisplay++; ?> |
| 276 | 276 | <?php if (($line->info_bits & 2) == 2 || ! empty($disableedit)) { ?> |
| 277 | 277 | <?php } else { ?> |
@@ -283,16 +283,16 @@ discard block |
||
| 283 | 283 | |
| 284 | 284 | <td class="linecoldelete" align="center"><?php $coldisplay++; ?> |
| 285 | 285 | <?php |
| 286 | - if (($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disableremove)) { |
|
| 287 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $this->id . '&action=ask_deleteline&lineid=' . $line->id . '">'; |
|
| 288 | - print img_delete(); |
|
| 289 | - print '</a>'; |
|
| 290 | - } |
|
| 291 | - ?> |
|
| 286 | + if (($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disableremove)) { |
|
| 287 | + print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $this->id . '&action=ask_deleteline&lineid=' . $line->id . '">'; |
|
| 288 | + print img_delete(); |
|
| 289 | + print '</a>'; |
|
| 290 | + } |
|
| 291 | + ?> |
|
| 292 | 292 | </td> |
| 293 | 293 | |
| 294 | 294 | <?php |
| 295 | - if ($num > 1 && $conf->browser->layout != 'phone' && ($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disablemove)) { ?> |
|
| 295 | + if ($num > 1 && $conf->browser->layout != 'phone' && ($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disablemove)) { ?> |
|
| 296 | 296 | <td align="center" class="linecolmove tdlineupdown"><?php $coldisplay++; ?> |
| 297 | 297 | <?php if ($i > 0) { ?> |
| 298 | 298 | <a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=up&rowid='.$line->id; ?>"> |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | //Line extrafield |
| 322 | 322 | if (!empty($extrafieldsline)) |
| 323 | 323 | { |
| 324 | - print $line->showOptionals($extrafieldsline, 'view', array('style'=>'class="drag drop oddeven"','colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); |
|
| 324 | + print $line->showOptionals($extrafieldsline, 'view', array('style'=>'class="drag drop oddeven"','colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); |
|
| 325 | 325 | } |
| 326 | 326 | ?> |
| 327 | 327 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | |
| 40 | 40 | // Protection to avoid direct call of template |
| 41 | -if (empty($object) || ! is_object($object)) |
|
| 41 | +if (empty($object) || !is_object($object)) |
|
| 42 | 42 | { |
| 43 | 43 | print "Error, template page can't be called as URL"; |
| 44 | 44 | exit; |
@@ -47,14 +47,14 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | global $forceall, $senderissupplier, $inputalsopricewithtax, $outputalsopricetotalwithtax; |
| 49 | 49 | |
| 50 | -$usemargins=0; |
|
| 51 | -if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) $usemargins=1; |
|
| 50 | +$usemargins = 0; |
|
| 51 | +if (!empty($conf->margin->enabled) && !empty($object->element) && in_array($object->element, array('facture', 'propal', 'commande'))) $usemargins = 1; |
|
| 52 | 52 | |
| 53 | -if (empty($dateSelector)) $dateSelector=0; |
|
| 54 | -if (empty($forceall)) $forceall=0; |
|
| 55 | -if (empty($senderissupplier)) $senderissupplier=0; |
|
| 56 | -if (empty($inputalsopricewithtax)) $inputalsopricewithtax=0; |
|
| 57 | -if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; |
|
| 53 | +if (empty($dateSelector)) $dateSelector = 0; |
|
| 54 | +if (empty($forceall)) $forceall = 0; |
|
| 55 | +if (empty($senderissupplier)) $senderissupplier = 0; |
|
| 56 | +if (empty($inputalsopricewithtax)) $inputalsopricewithtax = 0; |
|
| 57 | +if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax = 0; |
|
| 58 | 58 | |
| 59 | 59 | // add html5 elements |
| 60 | 60 | $domData = ' data-element="'.$line->element.'"'; |
@@ -64,11 +64,11 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | |
| 66 | 66 | ?> |
| 67 | -<?php $coldisplay=0; ?> |
|
| 67 | +<?php $coldisplay = 0; ?> |
|
| 68 | 68 | <!-- BEGIN PHP TEMPLATE objectline_view.tpl.php --> |
| 69 | 69 | <tr id="row-<?php echo $line->id?>" class="drag drop oddeven" <?php echo $domData; ?> > |
| 70 | - <?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?> |
|
| 71 | - <td class="linecolnum" align="center"><?php $coldisplay++; ?><?php echo ($i+1); ?></td> |
|
| 70 | + <?php if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?> |
|
| 71 | + <td class="linecolnum" align="center"><?php $coldisplay++; ?><?php echo ($i + 1); ?></td> |
|
| 72 | 72 | <?php } ?> |
| 73 | 73 | <td class="linecoldescription minwidth300imp"><?php $coldisplay++; ?><div id="line_<?php echo $line->id; ?>"></div> |
| 74 | 74 | <?php |
@@ -76,11 +76,11 @@ discard block |
||
| 76 | 76 | ?> |
| 77 | 77 | <a href="<?php echo DOL_URL_ROOT.'/comm/remx.php?id='.$this->socid; ?>"> |
| 78 | 78 | <?php |
| 79 | - $txt=''; |
|
| 80 | - print img_object($langs->trans("ShowReduc"),'reduc').' '; |
|
| 81 | - if ($line->description == '(DEPOSIT)') $txt=$langs->trans("Deposit"); |
|
| 82 | - elseif ($line->description == '(EXCESS RECEIVED)') $txt=$langs->trans("ExcessReceived"); |
|
| 83 | - elseif ($line->description == '(EXCESS PAID)') $txt=$langs->trans("ExcessPaid"); |
|
| 79 | + $txt = ''; |
|
| 80 | + print img_object($langs->trans("ShowReduc"), 'reduc').' '; |
|
| 81 | + if ($line->description == '(DEPOSIT)') $txt = $langs->trans("Deposit"); |
|
| 82 | + elseif ($line->description == '(EXCESS RECEIVED)') $txt = $langs->trans("ExcessReceived"); |
|
| 83 | + elseif ($line->description == '(EXCESS PAID)') $txt = $langs->trans("ExcessPaid"); |
|
| 84 | 84 | //else $txt=$langs->trans("Discount"); |
| 85 | 85 | print $txt; |
| 86 | 86 | ?> |
@@ -90,55 +90,55 @@ discard block |
||
| 90 | 90 | { |
| 91 | 91 | if ($line->description == '(CREDIT_NOTE)' && $line->fk_remise_except > 0) |
| 92 | 92 | { |
| 93 | - $discount=new DiscountAbsolute($this->db); |
|
| 93 | + $discount = new DiscountAbsolute($this->db); |
|
| 94 | 94 | $discount->fetch($line->fk_remise_except); |
| 95 | - echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0)); |
|
| 95 | + echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromCreditNote", $discount->getNomUrl(0)); |
|
| 96 | 96 | } |
| 97 | 97 | elseif ($line->description == '(DEPOSIT)' && $line->fk_remise_except > 0) |
| 98 | 98 | { |
| 99 | - $discount=new DiscountAbsolute($this->db); |
|
| 99 | + $discount = new DiscountAbsolute($this->db); |
|
| 100 | 100 | $discount->fetch($line->fk_remise_except); |
| 101 | - echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0)); |
|
| 101 | + echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromDeposit", $discount->getNomUrl(0)); |
|
| 102 | 102 | // Add date of deposit |
| 103 | - if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) |
|
| 103 | + if (!empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) |
|
| 104 | 104 | echo ' ('.dol_print_date($discount->datec).')'; |
| 105 | 105 | } |
| 106 | 106 | elseif ($line->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0) |
| 107 | 107 | { |
| 108 | - $discount=new DiscountAbsolute($this->db); |
|
| 108 | + $discount = new DiscountAbsolute($this->db); |
|
| 109 | 109 | $discount->fetch($line->fk_remise_except); |
| 110 | - echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessReceived",$discount->getNomUrl(0)); |
|
| 110 | + echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromExcessReceived", $discount->getNomUrl(0)); |
|
| 111 | 111 | } |
| 112 | 112 | elseif ($line->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0) |
| 113 | 113 | { |
| 114 | - $discount=new DiscountAbsolute($this->db); |
|
| 114 | + $discount = new DiscountAbsolute($this->db); |
|
| 115 | 115 | $discount->fetch($line->fk_remise_except); |
| 116 | - echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessPaid",$discount->getNomUrl(0)); |
|
| 116 | + echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromExcessPaid", $discount->getNomUrl(0)); |
|
| 117 | 117 | } |
| 118 | 118 | else |
| 119 | 119 | { |
| 120 | - echo ($txt?' - ':'').dol_htmlentitiesbr($line->description); |
|
| 120 | + echo ($txt ? ' - ' : '').dol_htmlentitiesbr($line->description); |
|
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 | else |
| 125 | 125 | { |
| 126 | - $format = $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE?'dayhour':'day'; |
|
| 126 | + $format = $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE ? 'dayhour' : 'day'; |
|
| 127 | 127 | |
| 128 | 128 | if ($line->fk_product > 0) |
| 129 | 129 | { |
| 130 | - echo $form->textwithtooltip($text,$description,3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); |
|
| 130 | + echo $form->textwithtooltip($text, $description, 3, '', '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : '')); |
|
| 131 | 131 | } |
| 132 | 132 | else |
| 133 | 133 | { |
| 134 | - if ($type==1) $text = img_object($langs->trans('Service'),'service'); |
|
| 135 | - else $text = img_object($langs->trans('Product'),'product'); |
|
| 134 | + if ($type == 1) $text = img_object($langs->trans('Service'), 'service'); |
|
| 135 | + else $text = img_object($langs->trans('Product'), 'product'); |
|
| 136 | 136 | |
| 137 | - if (! empty($line->label)) { |
|
| 138 | - $text.= ' <strong>'.$line->label.'</strong>'; |
|
| 139 | - echo $form->textwithtooltip($text,dol_htmlentitiesbr($line->description),3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); |
|
| 137 | + if (!empty($line->label)) { |
|
| 138 | + $text .= ' <strong>'.$line->label.'</strong>'; |
|
| 139 | + echo $form->textwithtooltip($text, dol_htmlentitiesbr($line->description), 3, '', '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : '')); |
|
| 140 | 140 | } else { |
| 141 | - if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow'); |
|
| 141 | + if (!empty($line->fk_parent_line)) echo img_picto('', 'rightarrow'); |
|
| 142 | 142 | echo $text.' '.dol_htmlentitiesbr($line->description); |
| 143 | 143 | } |
| 144 | 144 | } |
@@ -157,17 +157,17 @@ discard block |
||
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | // Add description in form |
| 160 | - if ($line->fk_product > 0 && ! empty($conf->global->PRODUIT_DESC_IN_FORM)) |
|
| 160 | + if ($line->fk_product > 0 && !empty($conf->global->PRODUIT_DESC_IN_FORM)) |
|
| 161 | 161 | { |
| 162 | - print (! empty($line->description) && $line->description!=$line->product_label)?'<br>'.dol_htmlentitiesbr($line->description):''; |
|
| 162 | + print (!empty($line->description) && $line->description != $line->product_label) ? '<br>'.dol_htmlentitiesbr($line->description) : ''; |
|
| 163 | 163 | } |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | - if (! empty($conf->accounting->enabled) && $line->fk_accounting_account > 0) |
|
| 166 | + if (!empty($conf->accounting->enabled) && $line->fk_accounting_account > 0) |
|
| 167 | 167 | { |
| 168 | - $accountingaccount=new AccountingAccount($this->db); |
|
| 168 | + $accountingaccount = new AccountingAccount($this->db); |
|
| 169 | 169 | $accountingaccount->fetch($line->fk_accounting_account); |
| 170 | - echo '<div class="clearboth"></div><br><span class="opacitymedium">' . $langs->trans('AccountingAffectation') . ' : </span>' . $accountingaccount->getNomUrl(0,1,1); |
|
| 170 | + echo '<div class="clearboth"></div><br><span class="opacitymedium">'.$langs->trans('AccountingAffectation').' : </span>'.$accountingaccount->getNomUrl(0, 1, 1); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | ?> |
@@ -177,19 +177,19 @@ discard block |
||
| 177 | 177 | { |
| 178 | 178 | ?> |
| 179 | 179 | <td class="linecolrefsupplier"><?php |
| 180 | - echo ($line->ref_fourn?$line->ref_fourn:$line->ref_supplier); |
|
| 180 | + echo ($line->ref_fourn ? $line->ref_fourn : $line->ref_supplier); |
|
| 181 | 181 | ?></td> |
| 182 | 182 | <?php |
| 183 | 183 | } |
| 184 | 184 | // VAT Rate |
| 185 | 185 | ?> |
| 186 | 186 | <td align="right" class="linecolvat nowrap"><?php $coldisplay++; ?><?php |
| 187 | - $positiverates=''; |
|
| 188 | - if (price2num($line->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx); |
|
| 189 | - if (price2num($line->total_localtax1)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); |
|
| 190 | - if (price2num($line->total_localtax2)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); |
|
| 191 | - if (empty($positiverates)) $positiverates='0'; |
|
| 192 | - echo vatrate($positiverates.($line->vat_src_code?' ('.$line->vat_src_code.')':''), '%', $line->info_bits); |
|
| 187 | + $positiverates = ''; |
|
| 188 | + if (price2num($line->tva_tx)) $positiverates .= ($positiverates ? '/' : '').price2num($line->tva_tx); |
|
| 189 | + if (price2num($line->total_localtax1)) $positiverates .= ($positiverates ? '/' : '').price2num($line->localtax1_tx); |
|
| 190 | + if (price2num($line->total_localtax2)) $positiverates .= ($positiverates ? '/' : '').price2num($line->localtax2_tx); |
|
| 191 | + if (empty($positiverates)) $positiverates = '0'; |
|
| 192 | + echo vatrate($positiverates.($line->vat_src_code ? ' ('.$line->vat_src_code.')' : ''), '%', $line->info_bits); |
|
| 193 | 193 | //echo vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits); |
| 194 | 194 | ?></td> |
| 195 | 195 | |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | <?php } ?> |
| 201 | 201 | |
| 202 | 202 | <?php if ($inputalsopricewithtax) { ?> |
| 203 | - <td align="right" class="linecoluttc nowrap"><?php $coldisplay++; ?><?php echo (isset($line->pu_ttc)?price($line->pu_ttc):price($line->subprice)); ?></td> |
|
| 203 | + <td align="right" class="linecoluttc nowrap"><?php $coldisplay++; ?><?php echo (isset($line->pu_ttc) ?price($line->pu_ttc) : price($line->subprice)); ?></td> |
|
| 204 | 204 | <?php } ?> |
| 205 | 205 | |
| 206 | 206 | <td align="right" class="linecolqty nowrap"><?php $coldisplay++; ?> |
@@ -210,11 +210,11 @@ discard block |
||
| 210 | 210 | // must also not be output for most entities (proposal, intervention, ...) |
| 211 | 211 | //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." "; |
| 212 | 212 | echo $line->qty; |
| 213 | - } else echo ' '; ?> |
|
| 213 | + } else echo ' '; ?> |
|
| 214 | 214 | </td> |
| 215 | 215 | |
| 216 | 216 | <?php |
| 217 | - if($conf->global->PRODUCT_USE_UNITS) |
|
| 217 | + if ($conf->global->PRODUCT_USE_UNITS) |
|
| 218 | 218 | { |
| 219 | 219 | print '<td align="left" class="linecoluseunit nowrap">'; |
| 220 | 220 | $label = $line->getLabelOfUnit('short'); |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | <td class="linecoldiscount" align="right"><?php |
| 230 | 230 | $coldisplay++; |
| 231 | 231 | include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
| 232 | - echo dol_print_reduction($line->remise_percent,$langs); |
|
| 232 | + echo dol_print_reduction($line->remise_percent, $langs); |
|
| 233 | 233 | ?></td> |
| 234 | 234 | <?php } else { ?> |
| 235 | 235 | <td class="linecoldiscount"><?php $coldisplay++; ?> </td> |
@@ -237,27 +237,27 @@ discard block |
||
| 237 | 237 | |
| 238 | 238 | if ($this->situation_cycle_ref) { |
| 239 | 239 | $coldisplay++; |
| 240 | - print '<td align="right" class="linecolcycleref nowrap">' . $line->situation_percent . '%</td>'; |
|
| 240 | + print '<td align="right" class="linecolcycleref nowrap">'.$line->situation_percent.'%</td>'; |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | - if ($usemargins && ! empty($conf->margin->enabled) && empty($user->societe_id)) |
|
| 243 | + if ($usemargins && !empty($conf->margin->enabled) && empty($user->societe_id)) |
|
| 244 | 244 | { |
| 245 | - $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); |
|
| 245 | + $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT); |
|
| 246 | 246 | ?> |
| 247 | 247 | |
| 248 | 248 | <?php if (!empty($user->rights->margins->creer)) { ?> |
| 249 | 249 | <td align="right" class="linecolmargin1 nowrap margininfos"><?php $coldisplay++; ?><?php echo price($line->pa_ht); ?></td> |
| 250 | 250 | <?php } ?> |
| 251 | - <?php if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) { ?> |
|
| 252 | - <td align="right" class="linecolmargin2 nowrap margininfos"><?php $coldisplay++; ?><?php echo (($line->pa_ht == 0)?'n/a':price($line->marge_tx, null, null, null, null, $rounding).'%'); ?></td> |
|
| 251 | + <?php if (!empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) { ?> |
|
| 252 | + <td align="right" class="linecolmargin2 nowrap margininfos"><?php $coldisplay++; ?><?php echo (($line->pa_ht == 0) ? 'n/a' : price($line->marge_tx, null, null, null, null, $rounding).'%'); ?></td> |
|
| 253 | 253 | <?php } |
| 254 | - if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {?> |
|
| 254 | + if (!empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {?> |
|
| 255 | 255 | <td align="right" class="linecolmargin2 nowrap margininfos"><?php $coldisplay++; ?><?php echo price($line->marque_tx, null, null, null, null, $rounding).'%'; ?></td> |
| 256 | 256 | <?php } |
| 257 | 257 | } |
| 258 | 258 | ?> |
| 259 | 259 | |
| 260 | - <?php if ($line->special_code == 3) { ?> |
|
| 260 | + <?php if ($line->special_code == 3) { ?> |
|
| 261 | 261 | <td align="right" class="linecoloption nowrap"><?php $coldisplay++; ?><?php echo $langs->trans('Option'); ?></td> |
| 262 | 262 | <?php } else { ?> |
| 263 | 263 | <td align="right" class="linecolht nowrap"><?php $coldisplay++; ?><?php echo price($line->total_ht); ?></td> |
@@ -271,9 +271,9 @@ discard block |
||
| 271 | 271 | |
| 272 | 272 | |
| 273 | 273 | <?php |
| 274 | - if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines' ) { ?> |
|
| 274 | + if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines') { ?> |
|
| 275 | 275 | <td class="linecoledit" align="center"><?php $coldisplay++; ?> |
| 276 | - <?php if (($line->info_bits & 2) == 2 || ! empty($disableedit)) { ?> |
|
| 276 | + <?php if (($line->info_bits & 2) == 2 || !empty($disableedit)) { ?> |
|
| 277 | 277 | <?php } else { ?> |
| 278 | 278 | <a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=editline&lineid='.$line->id.'#line_'.$line->id; ?>"> |
| 279 | 279 | <?php echo img_edit(); ?> |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | <td class="linecoldelete" align="center"><?php $coldisplay++; ?> |
| 285 | 285 | <?php |
| 286 | 286 | if (($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disableremove)) { |
| 287 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $this->id . '&action=ask_deleteline&lineid=' . $line->id . '">'; |
|
| 287 | + print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&action=ask_deleteline&lineid='.$line->id.'">'; |
|
| 288 | 288 | print img_delete(); |
| 289 | 289 | print '</a>'; |
| 290 | 290 | } |
@@ -296,23 +296,23 @@ discard block |
||
| 296 | 296 | <td align="center" class="linecolmove tdlineupdown"><?php $coldisplay++; ?> |
| 297 | 297 | <?php if ($i > 0) { ?> |
| 298 | 298 | <a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=up&rowid='.$line->id; ?>"> |
| 299 | - <?php echo img_up('default',0,'imgupforline'); ?> |
|
| 299 | + <?php echo img_up('default', 0, 'imgupforline'); ?> |
|
| 300 | 300 | </a> |
| 301 | 301 | <?php } ?> |
| 302 | - <?php if ($i < $num-1) { ?> |
|
| 302 | + <?php if ($i < $num - 1) { ?> |
|
| 303 | 303 | <a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=down&rowid='.$line->id; ?>"> |
| 304 | - <?php echo img_down('default',0,'imgdownforline'); ?> |
|
| 304 | + <?php echo img_down('default', 0, 'imgdownforline'); ?> |
|
| 305 | 305 | </a> |
| 306 | 306 | <?php } ?> |
| 307 | 307 | </td> |
| 308 | 308 | <?php } else { ?> |
| 309 | - <td align="center"<?php echo (($conf->browser->layout != 'phone' && empty($disablemove)) ?' class="linecolmove tdlineupdown"':' class="linecolmove"'); ?>><?php $coldisplay++; ?></td> |
|
| 309 | + <td align="center"<?php echo (($conf->browser->layout != 'phone' && empty($disablemove)) ? ' class="linecolmove tdlineupdown"' : ' class="linecolmove"'); ?>><?php $coldisplay++; ?></td> |
|
| 310 | 310 | <?php } ?> |
| 311 | 311 | <?php } else { ?> |
| 312 | - <td colspan="3"><?php $coldisplay=$coldisplay+3; ?></td> |
|
| 312 | + <td colspan="3"><?php $coldisplay = $coldisplay + 3; ?></td> |
|
| 313 | 313 | <?php } ?> |
| 314 | - <?php if($action == 'selectlines'){ ?> |
|
| 315 | - <td class="linecolcheck" align="center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php echo $i+1; ?>]" value="<?php echo $line->id; ?>" ></td> |
|
| 314 | + <?php if ($action == 'selectlines') { ?> |
|
| 315 | + <td class="linecolcheck" align="center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php echo $i + 1; ?>]" value="<?php echo $line->id; ?>" ></td> |
|
| 316 | 316 | <?php } ?> |
| 317 | 317 | |
| 318 | 318 | </tr> |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | //Line extrafield |
| 322 | 322 | if (!empty($extrafieldsline)) |
| 323 | 323 | { |
| 324 | - print $line->showOptionals($extrafieldsline, 'view', array('style'=>'class="drag drop oddeven"','colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); |
|
| 324 | + print $line->showOptionals($extrafieldsline, 'view', array('style'=>'class="drag drop oddeven"', 'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD) ? 0 : 1); |
|
| 325 | 325 | } |
| 326 | 326 | ?> |
| 327 | 327 | |
@@ -48,13 +48,25 @@ discard block |
||
| 48 | 48 | global $forceall, $senderissupplier, $inputalsopricewithtax, $outputalsopricetotalwithtax; |
| 49 | 49 | |
| 50 | 50 | $usemargins=0; |
| 51 | -if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) $usemargins=1; |
|
| 51 | +if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) { |
|
| 52 | + $usemargins=1; |
|
| 53 | +} |
|
| 52 | 54 | |
| 53 | -if (empty($dateSelector)) $dateSelector=0; |
|
| 54 | -if (empty($forceall)) $forceall=0; |
|
| 55 | -if (empty($senderissupplier)) $senderissupplier=0; |
|
| 56 | -if (empty($inputalsopricewithtax)) $inputalsopricewithtax=0; |
|
| 57 | -if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; |
|
| 55 | +if (empty($dateSelector)) { |
|
| 56 | + $dateSelector=0; |
|
| 57 | +} |
|
| 58 | +if (empty($forceall)) { |
|
| 59 | + $forceall=0; |
|
| 60 | +} |
|
| 61 | +if (empty($senderissupplier)) { |
|
| 62 | + $senderissupplier=0; |
|
| 63 | +} |
|
| 64 | +if (empty($inputalsopricewithtax)) { |
|
| 65 | + $inputalsopricewithtax=0; |
|
| 66 | +} |
|
| 67 | +if (empty($outputalsopricetotalwithtax)) { |
|
| 68 | + $outputalsopricetotalwithtax=0; |
|
| 69 | +} |
|
| 58 | 70 | |
| 59 | 71 | // add html5 elements |
| 60 | 72 | $domData = ' data-element="'.$line->element.'"'; |
@@ -78,9 +90,13 @@ discard block |
||
| 78 | 90 | <?php |
| 79 | 91 | $txt=''; |
| 80 | 92 | print img_object($langs->trans("ShowReduc"),'reduc').' '; |
| 81 | - if ($line->description == '(DEPOSIT)') $txt=$langs->trans("Deposit"); |
|
| 82 | - elseif ($line->description == '(EXCESS RECEIVED)') $txt=$langs->trans("ExcessReceived"); |
|
| 83 | - elseif ($line->description == '(EXCESS PAID)') $txt=$langs->trans("ExcessPaid"); |
|
| 93 | + if ($line->description == '(DEPOSIT)') { |
|
| 94 | + $txt=$langs->trans("Deposit"); |
|
| 95 | + } elseif ($line->description == '(EXCESS RECEIVED)') { |
|
| 96 | + $txt=$langs->trans("ExcessReceived"); |
|
| 97 | + } elseif ($line->description == '(EXCESS PAID)') { |
|
| 98 | + $txt=$langs->trans("ExcessPaid"); |
|
| 99 | + } |
|
| 84 | 100 | //else $txt=$langs->trans("Discount"); |
| 85 | 101 | print $txt; |
| 86 | 102 | ?> |
@@ -93,66 +109,77 @@ discard block |
||
| 93 | 109 | $discount=new DiscountAbsolute($this->db); |
| 94 | 110 | $discount->fetch($line->fk_remise_except); |
| 95 | 111 | echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0)); |
| 96 | - } |
|
| 97 | - elseif ($line->description == '(DEPOSIT)' && $line->fk_remise_except > 0) |
|
| 112 | + } elseif ($line->description == '(DEPOSIT)' && $line->fk_remise_except > 0) |
|
| 98 | 113 | { |
| 99 | 114 | $discount=new DiscountAbsolute($this->db); |
| 100 | 115 | $discount->fetch($line->fk_remise_except); |
| 101 | 116 | echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0)); |
| 102 | 117 | // Add date of deposit |
| 103 | - if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) |
|
| 104 | - echo ' ('.dol_print_date($discount->datec).')'; |
|
| 105 | - } |
|
| 106 | - elseif ($line->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0) |
|
| 118 | + if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) { |
|
| 119 | + echo ' ('.dol_print_date($discount->datec).')'; |
|
| 120 | + } |
|
| 121 | + } elseif ($line->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0) |
|
| 107 | 122 | { |
| 108 | 123 | $discount=new DiscountAbsolute($this->db); |
| 109 | 124 | $discount->fetch($line->fk_remise_except); |
| 110 | 125 | echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessReceived",$discount->getNomUrl(0)); |
| 111 | - } |
|
| 112 | - elseif ($line->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0) |
|
| 126 | + } elseif ($line->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0) |
|
| 113 | 127 | { |
| 114 | 128 | $discount=new DiscountAbsolute($this->db); |
| 115 | 129 | $discount->fetch($line->fk_remise_except); |
| 116 | 130 | echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessPaid",$discount->getNomUrl(0)); |
| 117 | - } |
|
| 118 | - else |
|
| 131 | + } else |
|
| 119 | 132 | { |
| 120 | 133 | echo ($txt?' - ':'').dol_htmlentitiesbr($line->description); |
| 121 | 134 | } |
| 122 | 135 | } |
| 123 | - } |
|
| 124 | - else |
|
| 136 | + } else |
|
| 125 | 137 | { |
| 126 | 138 | $format = $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE?'dayhour':'day'; |
| 127 | 139 | |
| 128 | 140 | if ($line->fk_product > 0) |
| 129 | 141 | { |
| 130 | 142 | echo $form->textwithtooltip($text,$description,3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); |
| 131 | - } |
|
| 132 | - else |
|
| 143 | + } else |
|
| 133 | 144 | { |
| 134 | - if ($type==1) $text = img_object($langs->trans('Service'),'service'); |
|
| 135 | - else $text = img_object($langs->trans('Product'),'product'); |
|
| 145 | + if ($type==1) { |
|
| 146 | + $text = img_object($langs->trans('Service'),'service'); |
|
| 147 | + } else { |
|
| 148 | + $text = img_object($langs->trans('Product'),'product'); |
|
| 149 | + } |
|
| 136 | 150 | |
| 137 | 151 | if (! empty($line->label)) { |
| 138 | 152 | $text.= ' <strong>'.$line->label.'</strong>'; |
| 139 | 153 | echo $form->textwithtooltip($text,dol_htmlentitiesbr($line->description),3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); |
| 140 | 154 | } else { |
| 141 | - if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow'); |
|
| 155 | + if (! empty($line->fk_parent_line)) { |
|
| 156 | + echo img_picto('', 'rightarrow'); |
|
| 157 | + } |
|
| 142 | 158 | echo $text.' '.dol_htmlentitiesbr($line->description); |
| 143 | 159 | } |
| 144 | 160 | } |
| 145 | 161 | |
| 146 | 162 | // Show date range |
| 147 | 163 | if ($line->element == 'facturedetrec') { |
| 148 | - if ($line->date_start_fill || $line->date_end_fill) echo '<br><div class="clearboth nowraponall">'; |
|
| 149 | - if ($line->date_start_fill) echo $langs->trans('AutoFillDateFromShort').': '.yn($line->date_start_fill); |
|
| 150 | - if ($line->date_start_fill && $line->date_end_fill) echo ' - '; |
|
| 151 | - if ($line->date_end_fill) echo $langs->trans('AutoFillDateToShort').': '.yn($line->date_end_fill); |
|
| 152 | - if ($line->date_start_fill || $line->date_end_fill) echo '</div>'; |
|
| 153 | - } |
|
| 154 | - else { |
|
| 155 | - if ($line->date_start || $line->date_end) echo '<br><div class="clearboth nowraponall">'.get_date_range($line->date_start, $line->date_end, $format).'</div>'; |
|
| 164 | + if ($line->date_start_fill || $line->date_end_fill) { |
|
| 165 | + echo '<br><div class="clearboth nowraponall">'; |
|
| 166 | + } |
|
| 167 | + if ($line->date_start_fill) { |
|
| 168 | + echo $langs->trans('AutoFillDateFromShort').': '.yn($line->date_start_fill); |
|
| 169 | + } |
|
| 170 | + if ($line->date_start_fill && $line->date_end_fill) { |
|
| 171 | + echo ' - '; |
|
| 172 | + } |
|
| 173 | + if ($line->date_end_fill) { |
|
| 174 | + echo $langs->trans('AutoFillDateToShort').': '.yn($line->date_end_fill); |
|
| 175 | + } |
|
| 176 | + if ($line->date_start_fill || $line->date_end_fill) { |
|
| 177 | + echo '</div>'; |
|
| 178 | + } |
|
| 179 | + } else { |
|
| 180 | + if ($line->date_start || $line->date_end) { |
|
| 181 | + echo '<br><div class="clearboth nowraponall">'.get_date_range($line->date_start, $line->date_end, $format).'</div>'; |
|
| 182 | + } |
|
| 156 | 183 | //echo get_date_range($line->date_start, $line->date_end, $format); |
| 157 | 184 | } |
| 158 | 185 | |
@@ -173,11 +200,13 @@ discard block |
||
| 173 | 200 | ?> |
| 174 | 201 | </td> |
| 175 | 202 | <?php |
| 176 | - if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines |
|
| 203 | + if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') { |
|
| 204 | + // We must have same test in printObjectLines |
|
| 177 | 205 | { |
| 178 | 206 | ?> |
| 179 | 207 | <td class="linecolrefsupplier"><?php |
| 180 | 208 | echo ($line->ref_fourn?$line->ref_fourn:$line->ref_supplier); |
| 209 | + } |
|
| 181 | 210 | ?></td> |
| 182 | 211 | <?php |
| 183 | 212 | } |
@@ -185,10 +214,18 @@ discard block |
||
| 185 | 214 | ?> |
| 186 | 215 | <td align="right" class="linecolvat nowrap"><?php $coldisplay++; ?><?php |
| 187 | 216 | $positiverates=''; |
| 188 | - if (price2num($line->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx); |
|
| 189 | - if (price2num($line->total_localtax1)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); |
|
| 190 | - if (price2num($line->total_localtax2)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); |
|
| 191 | - if (empty($positiverates)) $positiverates='0'; |
|
| 217 | + if (price2num($line->tva_tx)) { |
|
| 218 | + $positiverates.=($positiverates?'/':'').price2num($line->tva_tx); |
|
| 219 | + } |
|
| 220 | + if (price2num($line->total_localtax1)) { |
|
| 221 | + $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); |
|
| 222 | + } |
|
| 223 | + if (price2num($line->total_localtax2)) { |
|
| 224 | + $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); |
|
| 225 | + } |
|
| 226 | + if (empty($positiverates)) { |
|
| 227 | + $positiverates='0'; |
|
| 228 | + } |
|
| 192 | 229 | echo vatrate($positiverates.($line->vat_src_code?' ('.$line->vat_src_code.')':''), '%', $line->info_bits); |
| 193 | 230 | //echo vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits); |
| 194 | 231 | ?></td> |
@@ -210,7 +247,10 @@ discard block |
||
| 210 | 247 | // must also not be output for most entities (proposal, intervention, ...) |
| 211 | 248 | //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." "; |
| 212 | 249 | echo $line->qty; |
| 213 | - } else echo ' '; ?> |
|
| 250 | + } else { |
|
| 251 | + echo ' '; |
|
| 252 | + } |
|
| 253 | + ?> |
|
| 214 | 254 | </td> |
| 215 | 255 | |
| 216 | 256 | <?php |