diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index eaf873f2aee..f286569e8cd 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -325,7 +325,7 @@ if ($action == 'add') reset($object->socpeopleassigned); $object->contactid = key($object->socpeopleassigned); } - + // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); if ($ret < 0) $error++; @@ -708,6 +708,62 @@ if ($action == 'create') else $form->select_date($datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend'); print ''; + $userepeatevent=($conf->global->MAIN_FEATURES_LEVEL == 2 ? 1 : 0); // Dev in progress + if ($userepeatevent) + { + // Repeat + print ''.$langs->trans("RepeatEvent").''; + print ''; + $arrayrecurrulefreq=array( + 'no'=>$langs->trans("No"), + 'MONTHLY'=>$langs->trans("EveryMonth"), + 'WEEKLY'=>$langs->trans("EveryWeek"), + //'DAYLY'=>$langs->trans("EveryDay") + ); + $selectedrecurrulefreq='no'; + $selectedrecurrulebymonthday=''; + $selectedrecurrulebyday=''; + if ($object->recurrule && preg_match('/FREQ=([A-Z]+)/i',$object->recurrule,$reg)) $selectedrecurrulefreq=$reg[1]; + if ($object->recurrule && preg_match('/FREQ=MONTHLY.*BYMONTHDAY=(\d+)/i',$object->recurrule,$reg)) $selectedrecurrulebymonthday=$reg[1]; + if ($object->recurrule && preg_match('/FREQ=WEEKLY.*BYDAY(\d+)/i',$object->recurrule,$reg)) $selectedrecurrulebyday=$reg[1]; + print $form->selectarray('recurrulefreq', $arrayrecurrulefreq, $selectedrecurrulefreq, 0, 0, 0, '', 0, 0, 0, '', 'marginrightonly'); + // If recurrulefreq is MONTHLY + print ''; + // If recurrulefreq is WEEKLY + print ''; + print ''; + print ''; + } + // Status print ''.$langs->trans("Status").' / '.$langs->trans("Percentage").''; print ''; @@ -725,7 +781,7 @@ if ($action == 'create') // Location if (empty($conf->global->AGENDA_DISABLE_LOCATION)) { - print ''.$langs->trans("Location").''; + print ''.$langs->trans("Location").''; } // Assigned to @@ -735,6 +791,7 @@ if ($action == 'create') { $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 + $listofuserid[$user->id]['transparency']=GETPOSTISSET('transparency')?GETPOST('transparency','alpha'):1; // 1 by default at first init $_SESSION['assignedtouser']=json_encode($listofuserid); } else @@ -743,16 +800,17 @@ if ($action == 'create') { $listofuserid=json_decode($_SESSION['assignedtouser'], true); } + $listofuserid[$user->id]['transparency']=GETPOSTISSET('transparency')?GETPOST('transparency','alpha'):0; // 0 by default when refreshing } print '
'; - print $form->select_dolusers_forevent(($action=='create'?'add':'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0'); + print $form->select_dolusers_forevent(($action=='create'?'add':'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0', 1, $listofuserid, $listofcontactid, $listofotherid); print '
'; - if (in_array($user->id,array_keys($listofuserid))) + /*if (in_array($user->id,array_keys($listofuserid))) { print '
'; print $langs->trans("MyAvailability").': '.$langs->trans("Busy"); print '
'; - } + }*/ print ''; // Realised by @@ -764,39 +822,43 @@ if ($action == 'create') } print ''; - print '

'; + + + print '


'; print ''; - // Related company - print ''; + + // Related contact + print ''; } - print ''; - - // Related contact - print ''; - // Project if (! empty($conf->projet->enabled)) @@ -804,7 +866,7 @@ if ($action == 'create') // Projet associe $langs->load("projects"); - print ''; + print ''; print ''; print ''; print ''; @@ -830,7 +892,7 @@ if ($action == 'create') } // Priority - print ''; @@ -981,7 +1043,7 @@ if ($id > 0) } // Title - print 'global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired"':'').'>'.$langs->trans("Title").''; + print 'global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired"':'').'>'.$langs->trans("Title").''; // Full day event print ''; @@ -1018,13 +1080,13 @@ if ($id > 0) if ($object->recurrule && preg_match('/FREQ=([A-Z]+)/i',$object->recurrule,$reg)) $selectedrecurrulefreq=$reg[1]; if ($object->recurrule && preg_match('/FREQ=MONTHLY.*BYMONTHDAY=(\d+)/i',$object->recurrule,$reg)) $selectedrecurrulebymonthday=$reg[1]; if ($object->recurrule && preg_match('/FREQ=WEEKLY.*BYDAY(\d+)/i',$object->recurrule,$reg)) $selectedrecurrulebyday=$reg[1]; - print $form->selectarray('recurrulefreq', $arrayrecurrulefreq, $selectedrecurrulefreq); + print $form->selectarray('recurrulefreq', $arrayrecurrulefreq, $selectedrecurrulefreq, 0, 0, 0, '', 0, 0, 0, '', 'marginrightonly'); // If recurrulefreq is MONTHLY - print '
'; + print ''; // If recurrulefreq is WEEKLY - print '
'; + print ''; print ''; $out.=$this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); $out.=' '; + $out.='
'; } $assignedtouser=array(); if (!empty($_SESSION['assignedtouser'])) @@ -1679,21 +1684,34 @@ class Form $nbassignetouser=count($assignedtouser); if ($nbassignetouser && $action != 'view') $out.='
'; - if ($nbassignetouser) $out.='
'; + if ($nbassignetouser) $out.='
    '; $i=0; $ownerid=0; foreach($assignedtouser as $key => $value) { if ($value['id'] == $ownerid) continue; + + $out.='
  • '; $userstatic->fetch($value['id']); - $out.=$userstatic->getNomUrl(-1); + $out.= $userstatic->getNomUrl(-1); if ($i == 0) { $ownerid = $value['id']; $out.=' ('.$langs->trans("Owner").')'; } if ($nbassignetouser > 1 && $action != 'view') $out.=' '; + // Show my availability + if ($showproperties) + { + if ($user->id == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($user->id, array_keys($listofuserid))) + { + $out.='
    '; + $out.=' - '.$langs->trans("MyAvailability").': id]['transparency']?' checked':'').'>'.$langs->trans("Busy"); + $out.='
    '; + } + } //$out.=' '.($value['mandatory']?$langs->trans("Mandatory"):$langs->trans("Optional")); //$out.=' '.($value['transparency']?$langs->trans("Busy"):$langs->trans("NotBusy")); - $out.='
    '; + + $out.='
  • '; $i++; } - if ($nbassignetouser) $out.='
'; + if ($nbassignetouser) $out.=''; //$out.=''; return $out; diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index b7b5f7d332f..52b3cabda59 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -300,15 +300,17 @@ else $listofuserid=json_decode($_SESSION['assignedtouser'], true); } } + $listofcontactid=array(); // not used yet + $listofotherid=array(); // not used yet print '
'; - print $form->select_dolusers_forevent('view', 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); + print $form->select_dolusers_forevent('view', 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, '', ($act->datep != $act->datef)?1:0, $listofuserid, $listofcontactid, $listofotherid); print '
'; - if (in_array($user->id,array_keys($listofuserid))) + /*if (in_array($user->id,array_keys($listofuserid))) { print '
'; print $langs->trans("MyAvailability").': '.(($act->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody print '
'; - } + }*/ print ' '; print '
'.$langs->trans("ActionOnCompany").''; - if (GETPOST('socid','int') > 0) + if ($conf->societe->enabled) { - $societe = new Societe($db); - $societe->fetch(GETPOST('socid','int')); - print $societe->getNomUrl(1); - print ''; - } - else - { - $events=array(); - $events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); - //For external user force the company to user company - if (!empty($user->societe_id)) { - print $form->select_company($user->societe_id, 'socid', '', 1, 1, 0, $events, 0, 'minwidth300'); - } else { - print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, $events, 0, 'minwidth300'); + // Related company + print '
'.$langs->trans("ActionOnCompany").''; + if (GETPOST('socid','int') > 0) + { + $societe = new Societe($db); + $societe->fetch(GETPOST('socid','int')); + print $societe->getNomUrl(1); + print ''; } + else + { + $events=array(); + $events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); + //For external user force the company to user company + if (!empty($user->societe_id)) { + print $form->select_company($user->societe_id, 'socid', '', 1, 1, 0, $events, 0, 'minwidth300'); + } else { + print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, $events, 0, 'minwidth300'); + } + } + print '
'.$langs->trans("ActionOnContact").''; + print $form->selectcontacts(GETPOST('socid','int'), GETPOST('socpeopleassigned', 'array'), 'socpeopleassigned[]', 1, '', '', 0, 'quatrevingtpercent', false, 0, array(), false, 'multiple', 'contactid'); + print '
'.$langs->trans("ActionOnContact").''; - echo $form->selectcontacts(GETPOST('socid','int'), GETPOST('socpeopleassigned', 'array'), 'socpeopleassigned[]', 1, '', '', 0, 'minwidth200',0, 0, array(), false, 'multiple', 'contactid'); - print '
'.$langs->trans("Project").''; + print '
'.$langs->trans("Project").''; $numproject=$formproject->select_projects((! empty($societe->id)?$societe->id:-1),GETPOST("projectid")?GETPOST("projectid"):'','projectid'); if ($numproject==0) @@ -816,7 +878,7 @@ if ($action == 'create') if (!empty($origin) && !empty($originid)) { include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - print '
'.$langs->trans("LinkedObject").'
'.$langs->trans("LinkedObject").''.dolGetElementUrl($originid,$origin,1).'
'.$langs->trans("Priority").''; + print '
'.$langs->trans("Priority").''; print ''; print '
'.$langs->trans("EventOnFullDay").'fulldayevent?' checked':'').'>
'; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index b9eaac506e9..3a9a0e4a666 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -647,8 +647,17 @@ div.divsearchfield { div.confirmmessage { padding-top: 6px; } -div.myavailability { - padding-top: 6px; +ul.attendees { + padding-top: 0; + padding-bottom: 0; + padding-left: 0; + margin-top: 0; + margin-bottom: 0; +} +ul.attendees li { + list-style-type: none; + padding-top:1px; + padding-bottom:1px; } .googlerefreshcal { padding-top: 4px; @@ -666,6 +675,9 @@ div.myavailability { .selectlimit, .marginrightonly { margin-right: 10px !important; } +.marginleftonly { + margin-left: 10px !important; +} .selectlimit, .selectlimit:focus { border-left: none !important; border-top: none !important; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 1558f9f280c..d2b7323983a 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -656,8 +656,18 @@ div.divsearchfield { div.confirmmessage { padding-top: 6px; } -div.myavailability { - padding-top: 6px; +ul.attendees { + padding-top: 0; + padding-bottom: 0; + padding-left: 0; + margin-top: 0; + margin-bottom: 0; +} +ul.attendees li { + list-style-type: none; +} +input > ul.attendees { + margin-top: 6px; } .googlerefreshcal { padding-top: 4px; @@ -675,6 +685,9 @@ div.myavailability { .selectlimit, .marginrightonly { margin-right: 10px !important; } +.marginleftonly { + margin-left: 10px !important; +} .selectlimit, .selectlimit:focus { border-left: none !important; border-top: none !important;