Example #1
0
         $tmplist1 = $object->userassigned;
         $tmplist2 = array();
         foreach ($tmplist1 as $key => $val) {
             if ($val['id'] && $val['id'] != $object->userownerid) {
                 $listofuserid[$val['id']] = $val;
             }
         }
     }
     $_SESSION['assignedtouser'] = json_encode($listofuserid);
 } else {
     if (!empty($_SESSION['assignedtouser'])) {
         $listofuserid = json_decode($_SESSION['assignedtouser'], true);
     }
 }
 print '<div class="assignedtouser">';
 print $form->select_dolusers_forevent('view', 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
 print '</div>';
 if (in_array($user->id, array_keys($listofuserid))) {
     print '<div class="myavailability">';
     print $langs->trans("MyAvailability") . ': ' . ($object->userassigned[$user->id]['transparency'] > 0 ? $langs->trans("Busy") : $langs->trans("Available"));
     // We show nothing if event is assigned to nobody
     print '</div>';
 }
 print '	</td></tr>';
 print '</table><br><br><table class="border" width="100%">';
 // Third party - Contact
 print '<tr><td width="30%">' . $langs->trans("ActionOnCompany") . '</td><td>' . ($object->thirdparty->id ? $object->thirdparty->getNomUrl(1) : $langs->trans("None"));
 if (is_object($object->thirdparty) && $object->thirdparty->id > 0 && $object->type_code == 'AC_TEL') {
     if ($object->thirdparty->fetch($object->thirdparty->id)) {
         print "<br>" . dol_print_phone($object->thirdparty->phone);
     }
Example #2
0
 print '<tr><td class="tdtop nowrap">' . $langs->trans("ActionAffectedTo") . '</td><td>';
 $listofuserid = array();
 if (empty($donotclearsession)) {
     $assignedtouser = GETPOST("assignedtouser") ? GETPOST("assignedtouser") : (!empty($object->userownerid) && $object->userownerid > 0 ? $object->userownerid : $user->id);
     if ($assignedtouser) {
         $listofuserid[$assignedtouser] = array('id' => $assignedtouser, 'mandatory' => 0, 'transparency' => $object->transparency);
     }
     // Owner first
     $_SESSION['assignedtouser'] = json_encode($listofuserid);
 } else {
     if (!empty($_SESSION['assignedtouser'])) {
         $listofuserid = json_decode($_SESSION['assignedtouser'], true);
     }
 }
 print '<div class="assignedtouser">';
 print $form->select_dolusers_forevent($action == 'create' ? 'add' : 'update', 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0');
 print '</div>';
 if (in_array($user->id, array_keys($listofuserid))) {
     print '<div class="myavailability">';
     print $langs->trans("MyAvailability") . ': <input id="transparency" type="checkbox" name="transparency"' . (!isset($_GET['transparency']) && !isset($_POST['transparency']) || GETPOST('transparency') ? ' checked' : '') . '> ' . $langs->trans("Busy");
     print '</div>';
 }
 print '</td></tr>';
 // Realised by
 if (!empty($conf->global->AGENDA_ENABLE_DONEBY)) {
     print '<tr><td class="nowrap">' . $langs->trans("ActionDoneBy") . '</td><td>';
     print $form->select_dolusers(GETPOST("doneby") ? GETPOST("doneby") : (!empty($object->userdoneid) && $percent == 100 ? $object->userdoneid : 0), 'doneby', 1);
     print '</td></tr>';
 }
 print '</table>';
 print '<br><br>';
Example #3
0
         // Restore array with key with same value than param 'id'
         $tmplist1 = $object->userassigned;
         $tmplist2 = array();
         foreach ($tmplist1 as $key => $val) {
             if ($val['id'] && $val['id'] != $object->userownerid) {
                 $listofuserid[$val['id']] = $val;
             }
         }
     }
     $_SESSION['assignedtouser'] = json_encode($listofuserid);
 } else {
     if (!empty($_SESSION['assignedtouser'])) {
         $listofuserid = json_decode($_SESSION['assignedtouser'], true);
     }
 }
 print $form->select_dolusers_forevent('view', 'assignedtouser', 1);
 if (in_array($user->id, array_keys($listofuserid))) {
     print $langs->trans("MyAvailability") . ': ' . ($object->userassigned[$user->id]['transparency'] > 0 ? $langs->trans("Busy") : $langs->trans("Available"));
 }
 // We show nothing if event is assigned to nobody
 print '	</td></tr>';
 print '</table><br><br><table class="border" width="100%">';
 // Third party - Contact
 print '<tr><td width="30%">' . $langs->trans("ActionOnCompany") . '</td><td>' . ($object->thirdparty->id ? $object->thirdparty->getNomUrl(1) : $langs->trans("None"));
 if (is_object($object->thirdparty) && $object->thirdparty->id > 0 && $object->type_code == 'AC_TEL') {
     if ($object->thirdparty->fetch($object->thirdparty->id)) {
         print "<br>" . dol_print_phone($object->thirdparty->phone);
     }
 }
 print '</td>';
 print '<td>' . $langs->trans("Contact") . '</td>';