diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 95c3c23e52a..ab35d5e3aa0 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1651,7 +1651,9 @@ if ($action == 'create') { print ''; // Assigned to user - print ''; } @@ -2021,7 +2023,7 @@ if ($action == 'create') { print dol_get_fiche_end(); - print $form->buttonsSaveCancel("Add"); + print $form->buttonsSaveCancel("Create"); print ""; } @@ -2418,7 +2420,7 @@ if ($id > 0 && $action != 'create') { selectTasks((!empty($societe->id) ? $societe->id : -1), $object->elementid, 'fk_element', 24, 0, '', 1, 0, 0, 'maxwidth500', (string) $object->fk_project, 'all', null, 1); + print $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $object->elementid, 'fk_element', 64, 0, '', 1, 0, 0, 'maxwidth500', (string) $object->fk_project, 'all', null, 1); print ''; print ''; @@ -2451,7 +2453,7 @@ if ($id > 0 && $action != 'create') { $tid = GETPOSTINT("taskid"); } - print $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 24, 0, '1', 1, 0, 0, 'maxwidth500 widthcentpercentminusxx', (string) $projectsListId, 'all', null, 1); + print $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 64, 0, '1', 1, 0, 0, 'maxwidth500 widthcentpercentminusxx', (string) $projectsListId, 'all', null, 1); print ''; } else { diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 3afa477f4f7..52b8d968590 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -457,7 +457,7 @@ class ActionComm extends CommonObject "recurid" => array("type" => "varchar(128)", "label" => "Recurid", "enabled" => "1", 'position' => 195, 'notnull' => 0, "visible" => "0",), "recurrule" => array("type" => "varchar(128)", "label" => "Recurrule", "enabled" => "1", 'position' => 200, 'notnull' => 0, "visible" => "0",), "recurdateend" => array("type" => "datetime", "label" => "Recurdateend", "enabled" => "1", 'position' => 205, 'notnull' => 0, "visible" => "0",), - "import_key" => array("type" => "varchar(14)", "label" => "ImportId", "enabled" => "1", 'position' => 900, 'notnull' => 0, "visible" => "0",), + "import_key" => array("type" => "varchar(14)", "label" => "ImportId", "enabled" => "1", 'position' => 900, 'notnull' => 0, "visible" => "-1",), "extraparams" => array("type" => "varchar(255)", "label" => "Extraparams", "enabled" => "1", 'position' => 215, 'notnull' => 0, "visible" => "0",), "calling_duration" => array("type" => "integer", "label" => "Callingduration", "enabled" => "1", 'position' => 220, 'notnull' => 0, "visible" => "0",), "visibility" => array("type" => "varchar(12)", "label" => "Visibility", "enabled" => "1", 'position' => 225, 'notnull' => 0, "visible" => "0",), @@ -1993,7 +1993,7 @@ class ActionComm extends CommonObject /** * Return label of type of event * - * @param int $mode 0=Mode short, 1=Mode long + * @param int $mode 0=Mode short, 1=Mode long, 2=Mode very long * @return string HTML String */ public function getTypeLabel($mode = 0) @@ -2028,6 +2028,11 @@ class ActionComm extends CommonObject if ($this->type == 'systemauto' && $mode == 1) { $labeltype .= ' ('.$langs->trans("auto").')'; } + if ($this->type == 'systemauto' && $mode == 2) { + $labeltype = $langs->trans("AutoActions").($this->type_code == 'AC_OTH_AUTO' ? '' : ': '.$labeltype); + } elseif ($this->type != 'systemauto' && $mode == 2) { + $labeltype = $langs->trans("ManualActions").($this->type_code == 'AC_OTH' ? '' : ': '.$labeltype); + } return $labeltype; diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 4a5689452a7..1ae7e6fce69 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -101,17 +101,22 @@ class CActionComm /** * Load action type from database * - * @param int|string $id id or code of action type to read + * @param int|string $id Id or code of action type to read + * @param string $code Code * @return int 1=ok, 0=not found, -1=error */ - public function fetch($id) + public function fetch($id, $code = '') { $sql = "SELECT id, code, type, libelle as label, color, active, picto"; $sql .= " FROM ".MAIN_DB_PREFIX."c_actioncomm"; - if (is_numeric($id)) { - $sql .= " WHERE id=".(int) $id; + if (!empty($id)) { + if (is_numeric($id)) { + $sql .= " WHERE id = ".(int) $id; + } else { // For backward compatibility + $sql .= " WHERE code = '".$this->db->escape($id)."'"; + } } else { - $sql .= " WHERE code='".$this->db->escape($id)."'"; + $sql .= " WHERE code = '".$this->db->escape($code)."'"; } dol_syslog(get_class($this)."::fetch", LOG_DEBUG); diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 0899fe6d5b3..f2efd3b4bec 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -67,6 +67,7 @@ $disabledefaultvalues = GETPOSTINT('disabledefaultvalues'); $resourceid = GETPOSTINT("search_resourceid") ? GETPOSTINT("search_resourceid") : GETPOSTINT("resourceid"); $pid = GETPOSTINT("search_projectid", 3) ? GETPOSTINT("search_projectid", 3) : GETPOSTINT("projectid", 3); $search_status = (GETPOST("search_status", 'aZ09') != '') ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); +$search_import_key = GETPOST("search_import_key"); $type = GETPOST('search_type', 'alphanohtml') ? GETPOST('search_type', 'alphanohtml') : GETPOST('type', 'alphanohtml'); $year = GETPOSTINT("year"); $month = GETPOSTINT("month"); @@ -255,6 +256,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $dateend_dtend = ''; $actioncode = ''; $search_status = ''; + $search_import_key = ''; $pid = ''; $socid = ''; $resourceid = ''; @@ -352,6 +354,9 @@ if ($resourceid > 0) { if ($search_status != '') { $param .= "&search_status=".urlencode($search_status); } +if ($search_import_key != '') { + $param .= "&search_import_key=".urlencode($search_import_key); +} if ($filter) { $param .= "&search_filter=".urlencode((string) $filter); } @@ -452,7 +457,7 @@ $sql .= " a.datep as dp, a.id, a.code, a.label, a.note, a.datep2 as dp2, a.fulld $sql .= " a.fk_user_author, a.fk_user_action,"; $sql .= " a.fk_contact, a.note, a.percent as percent,"; $sql .= " a.fk_element, a.elementtype, a.datec, a.tms as datem,"; -$sql .= " a.recurid, a.recurrule, a.recurdateend,"; +$sql .= " a.recurid, a.recurrule, a.recurdateend, a.import_key,"; $sql .= " c.code as type_code, c.libelle as type_label, c.color as type_color, c.type as type_type, c.picto as type_picto,"; $sql .= " s.nom as societe, s.rowid as socid, s.client, s.email as socemail"; //$sql .= " sp.lastname, sp.firstname, sp.email, sp.phone, sp.address, sp.phone as phone_pro, sp.phone_mobile, sp.phone_perso, sp.fk_pays as country_id"; @@ -572,6 +577,9 @@ if ($search_status == 'done' || $search_status == '100') { if ($search_status == 'todo') { $sql .= " AND (a.percent >= 0 AND a.percent < 100)"; } +if ($search_import_key) { + $sql .= natural_search("a.import_key", $search_import_key); +} if ($search_id) { $sql .= natural_search("a.id", $search_id, 1); } @@ -725,10 +733,6 @@ if ($showbirthday) { } print $nav; -//print dol_get_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); -//print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, '', $filtert, '', $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); -//print dol_get_fiche_end(); - $s = $newtitle; @@ -821,7 +825,7 @@ if ($massactionbutton) { $i = 0; print '
'; -print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, '', $filtert, '', $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid, $search_categ_cus); +print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, '', $filtert, '', $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid, $search_categ_cus, $search_import_key); print '
'; $moreforfilter = 1; @@ -896,6 +900,10 @@ if (!empty($arrayfields['a.datec']['checked'])) { if (!empty($arrayfields['a.tms']['checked'])) { print ''; } +if (!empty($arrayfields['a.import_key']['checked'])) { + print ''; + print ''; +} if (!empty($arrayfields['a.percent']['checked'])) { print ''; + print ''; } // Date update if (!empty($arrayfields['a.tms']['checked'])) { - print ''; + print ''; } + // Import key + if (!empty($arrayfields['a.import_key']['checked'])) { + print ''; + } + // Status/Percent if (!empty($arrayfields['a.percent']['checked'])) { - // Status/Percent $datep = $db->jdate($obj->dp); - print ''; + print ''; } // Action column if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index e7098ea48aa..cff7c881e65 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -56,7 +56,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; // Load translation files required by the page $langs->loadLangs(array('bills', 'companies', 'compta', 'admin', 'other', 'products', 'banks')); -$action = GETPOST('action', 'alpha'); +$action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOSTINT('show_files'); $confirm = GETPOST('confirm', 'alpha'); @@ -1654,7 +1654,7 @@ if ($action == 'create') { } // Author - print '"; @@ -2255,13 +2255,14 @@ if ($action == 'create') { $MAXEVENT = 10; - //$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id); - $morehtmlcenter = ''; + $morehtmlcenter = '
'; + //$morehtmlcenter .= dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT.'/compta/facture/messaging.php?id='.$object->id); + $morehtmlcenter .= dolGetButtonTitle($langs->trans('FullList'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/compta/facture/agenda-rec.php?id='.$object->id); + $morehtmlcenter .= '
'; // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $morehtmlcenter = ''; $somethingshown = $formactions->showactions($object, $object->element, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter); print ''; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 801faed4cbf..d77a799190a 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -41,7 +41,7 @@ * \brief Page to create/see an invoice */ -// Libraries +// Load Dolibarr environment require '../../main.inc.php'; /** * @var Conf $conf @@ -91,14 +91,15 @@ if (isModEnabled('margin')) { } // General $Variables -$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility -$ref = GETPOST('ref', 'alpha'); -$socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used + +$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility +$ref = GETPOST('ref', 'alpha'); +$socid = GETPOSTINT('socid'); $lineid = GETPOSTINT('lineid'); $origin = GETPOST('origin', 'alpha'); $originid = (GETPOSTINT('originid') ? GETPOSTINT('originid') : GETPOSTINT('origin_id')); // For backward compatibility diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 654dd6fc05d..dc2a1d53603 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2668,7 +2668,8 @@ class Form $out .= '})'; $out .= img_picto('', 'user', 'class="pictofixedwidth"'); $out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter, 0, '', 'minwidth200'); - $out .= ' '; + $out .= ' '; $out .= ''; //$out .= '
'; } @@ -2770,7 +2771,9 @@ class Form } $out .= $formresources->select_resource_list(0, $htmlname, '', 1, 1, 0, $events, '', 2, 0, 'minwidth200'); //$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); - $out .= ' '; + $out .= ' '; $out .= '
'; } diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 366c4e919c5..cc95a0ec578 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -276,7 +276,7 @@ class FormActions print getTitleFieldOfList('Ref', 0, $_SERVER["PHP_SELF"], '', (string) $page, $param, '', $sortfield, $sortorder, '', 1); print getTitleFieldOfList('Date', 0, $_SERVER["PHP_SELF"], 'a.datep', (string) $page, $param, '', $sortfield, $sortorder, 'center ', 1); print getTitleFieldOfList('By', 0, $_SERVER["PHP_SELF"], '', (string) $page, $param, '', $sortfield, $sortorder, '', 1); - print getTitleFieldOfList('Type', 0, $_SERVER["PHP_SELF"], '', (string) $page, $param, '', $sortfield, $sortorder, '', 1); + print getTitleFieldOfList('Type', 0, $_SERVER["PHP_SELF"], '', (string) $page, $param, '', $sortfield, $sortorder, 'center ', 1); print getTitleFieldOfList('Title', 0, $_SERVER["PHP_SELF"], '', (string) $page, $param, '', $sortfield, $sortorder, '', 1); print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', (string) $page, $param, '', $sortfield, $sortorder, 'right ', 1); print ''; @@ -322,10 +322,11 @@ class FormActions //$actionstatic->type_code = 'AC_OTHER_AUTO' // Type - $labeltype = $actioncomm->getTypeLabel(0); - print ''; // Label / Title diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index e08c16782d4..944e217063b 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -662,7 +662,10 @@ class Notify $application = (preg_match('/^\+/', $applicationcustom) ? $application : '').$applicationcustom; } - $from = getDolGlobalString('NOTIFICATION_EMAIL_FROM', getDolGlobalString('MAIN_MAIL_EMAIL_FROM')); + $from = getDolGlobalString('NOTIFICATION_EMAIL_FROM'); + if (empty($from)) { + $from = getDolGlobalString('MAIN_MAIL_EMAIL_FROM'); + } $object_type = ''; $link = ''; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index b7c0c26b332..39e4def57f5 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -48,6 +48,7 @@ * @param ''|'systemauto'|'system' $excludetype A type to exclude ('systemauto', 'system', '') * @param int $resourceid Preselected value of resource for filter on resource * @param int $search_categ_cus Tag id + * @param string $search_import_key Import IDfilter * @return void */ function print_actions_filter( @@ -69,7 +70,8 @@ function print_actions_filter( $usergroupid = 0, $excludetype = '', $resourceid = 0, - $search_categ_cus = 0 + $search_categ_cus = 0, + $search_import_key = '' ) { global $user, $langs, $db, $hookmanager; global $massaction; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index b3f8ffe32ac..71a747c93e7 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -2765,7 +2765,7 @@ function addOtherFilterSQL(&$sql, $donetodo, $now, $filters) if (is_array($filters) && !empty($filters['search_rowid'])) { $sql .= natural_search('a.id', $filters['search_rowid'], 1); } - if (is_array($filters) && !empty($filters['search_filtert'])) { + if (is_array($filters) && !empty($filters['search_filtert']) && ((int) $filters['search_filtert']) != -1) { $sql .= natural_search('a.fk_user_action', $filters['search_filtert'], 1); } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index bf732f1194d..43484cff07c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3905,7 +3905,7 @@ function dol_strftime($fmt, $ts = false, $is_gmt = false) * 'tzuserrel' => output string is for user TZ (current browser TZ with dst or not, depending on date position) * @param ?Translate $outputlangs Object lang that contains language for text translation. * @param boolean $encodetooutput Use true to convert/encode string into the HTML rendering pagecode (false=keep UTF8 by default) - * @param int $decorate Use 1 to apply a HTML css style to decorate the date + * @param int|string $decorate Use 1 or a css to apply a HTML css style to decorate the date * @return string Formatted date or '' if time is null * * @see dol_mktime(), dol_stringtotime(), dol_getdate(), selectDate() @@ -4160,8 +4160,8 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = } if ($decorate) { - $ret = preg_replace('/(\d\d:\d\d [AP]M)$/', '\1', $ret); - $ret = preg_replace('/(\d\d:\d\d)$/', '\1', $ret); + $ret = preg_replace('/(\d\d:\d\d [AP]M)$/', '\1', $ret); + $ret = preg_replace('/(\d\d:\d\d)$/', '\1', $ret); } return $ret; @@ -16556,7 +16556,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = null, 'dateend' => $db->jdate($obj->dp2), 'fulldayevent' => (int) $obj->fulldayevent, 'note' => $obj->label, - 'message' => dol_htmlentitiesbr($obj->message), + 'message' => $obj->message, 'percent' => $obj->percent, 'userid' => $obj->user_id, @@ -16587,7 +16587,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = null, 'dateend' => $db->jdate($obj->dp2), 'fulldayevent' => (int) $obj->fulldayevent, 'note' => $obj->label, - 'message' => dol_htmlentitiesbr($obj->message), + 'message' => $obj->message, 'percent' => $obj->percent, 'acode' => $obj->acode, @@ -16799,16 +16799,23 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = null, $out .= ''; // Date - $out .= ' '; + $out .= ' '; + $out .= ''; $out .= dol_print_date($histo[$key]['datestart'], 'day', 'tzuserrel'); - $out .= '   '.dol_print_date($histo[$key]['datestart'], 'hour', 'tzuserrel', null, false, 1); + //$out .= ''; + //$out .= ''. + $out .= ' '.dol_print_date($histo[$key]['datestart'], 'hour', 'tzuserrel', null, false, 'opacitymedium'); + //$out .= ''; if ($histo[$key]['dateend'] && $histo[$key]['dateend'] != $histo[$key]['datestart']) { $tmpa = dol_getdate($histo[$key]['datestart'], true); $tmpb = dol_getdate($histo[$key]['dateend'], true); if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) { - $out .= '-' . dol_print_date($histo[$key]['dateend'], 'hour', 'tzuserrel', null, false, 1); + $out .= ' - ' . dol_print_date($histo[$key]['dateend'], 'hour', 'tzuserrel', null, false, 1); } else { - $out .= '-' . dol_print_date($histo[$key]['dateend'], 'dayhour', 'tzuserrel', null, false, 1); + $out .= ' - ' . dol_print_date($histo[$key]['dateend'], 'day', 'tzuserrel'); + //$out .= ''; + $out .= ' '.dol_print_date($histo[$key]['dateend'], 'hour', 'tzuserrel', null, false, 'opacitymedium'); + //$out .= ''; } } $late = 0; @@ -16919,20 +16926,23 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = null, ) { $out .= '
'; $truncateLines = getDolGlobalInt('MAIN_TRUNCATE_TIMELINE_MESSAGE', 3); - $truncatedText = dolGetFirstLineOfText($histo[$key]['message'], $truncateLines); - if ($truncateLines > 0 && strlen($histo[$key]['message']) > strlen($truncatedText)) { + $newmess = $histo[$key]['message']; + $truncatedText = dolGetFirstLineOfText($newmess, $truncateLines); + if ($truncateLines > 0 && strlen($newmess) > strlen($truncatedText)) { $out .= '
'; $out .= '
'; $out .= dolPrintHTML($truncatedText, 0, array('pre', 'code')); $out .= '
' . $langs->trans("ReadMore") . ' '; $out .= '
'; $out .= '
'; - $out .= dolPrintHTML($histo[$key]['message'], 0, array('pre', 'code')); + + $out .= dolPrintHTML($newmess, 0, array('pre', 'code')); + $out .= ' ' . $langs->trans("ReadLess") . ''; $out .= '
'; $out .= '
'; } else { - $out .= dolPrintHTML($histo[$key]['message'], 0, array('pre', 'code')); + $out .= dolPrintHTML($newmess, 0, array('pre', 'code')); } $out .= '
'; diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 0c33af61b37..2299028922f 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -584,7 +584,14 @@ class modAgenda extends DolibarrModules 'class' => 'CActionComm', 'method' => 'fetch', 'dict' => 'DictionaryActions' - ) + ), + 'ac.fk_project' => array( + 'rule' => 'fetchidfromref', + 'file' => '/projet/class/project.class.php', + 'class' => 'Project', + 'method' => 'fetch', + 'element' => 'Project' + ), ); // Import Event Extra Fields diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index 1701272dd66..ad0352b7ca7 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -318,7 +318,11 @@ class modProjet extends DolibarrModules // End add extra fields $this->import_fieldshidden_array[$r] = array('t.fk_user_creat'=>'user->id', 'extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'projet'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) $this->import_convertvalue_array[$r] = array( - 't.ref' => array('rule' => 'getrefifauto', 'class' => getDolGlobalString('PROJECT_ADDON', 'mod_project_simple'), 'path' => "/core/modules/project/".getDolGlobalString('PROJECT_ADDON', 'mod_project_simple').'.php'), + 't.ref' => array( + 'rule' => 'getrefifauto', + 'class' => getDolGlobalString('PROJECT_ADDON', 'mod_project_simple'), + 'path' => "/core/modules/project/".getDolGlobalString('PROJECT_ADDON', 'mod_project_simple').'.php' + ), 't.fk_soc' => array( 'rule' => 'fetchidfromref', 'file' => '/societe/class/societe.class.php', @@ -326,6 +330,13 @@ class modProjet extends DolibarrModules 'method' => 'fetch', 'element' => 'ThirdParty' ), + 't.fk_opp_status' => array( + 'rule' => 'fetchidfromcodeid', + 'file' => '/core/class/cleadstatus.class.php', + 'class' => 'CLeadStatus', + 'method' => 'fetch', + 'dict' => 'DictionaryOpportunityStatus' + ), ); //$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t'); $this->import_regex_array[$r] = array('t.dateo'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$', 't.datee'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$', 't.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]( [0-9][0-9]:[0-9][0-9]:[0-9][0-9])?$'); diff --git a/htdocs/datapolicy/class/datapolicycron.class.php b/htdocs/datapolicy/class/datapolicycron.class.php index 6d02140a37a..ba9b3f832a7 100644 --- a/htdocs/datapolicy/class/datapolicycron.class.php +++ b/htdocs/datapolicy/class/datapolicycron.class.php @@ -352,7 +352,7 @@ class DataPolicyCron '__DELAY__' => (string) $delay, '__NOW__' => "'" . $this->db->idate(dol_now()) . "'" ); - $sql = str_replace(array_keys($sqlPlaceholders), array_values($sqlPlaceholders), $policy['sql_template']); + $sql = str_replace(array_keys($sqlPlaceholders), array_values($sqlPlaceholders), $policy['sql_template'.($action == 'delete' ? '_delete' : '')]); $resql = $this->db->query($sql); diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index af7ef8e11a5..e2fc13e0de2 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -1173,6 +1173,7 @@ if ($step == 3 && $datatoimport) { $labelhtml = $label.' '.$form->textwithpicto('', $htmltext, 1, 'help', '', 1); + $selectforline .= '
'.$langs->trans("ActionAffectedTo").''; + print '
'; + print $langs->trans("AssignedTo"); + print ''; $listofuserid = []; $listofcontactid = []; $listofotherid = []; @@ -1850,7 +1852,7 @@ if ($action == 'create') { print ''; print ajax_combobox('taskid'); } else { - print $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 32, 0, '1', 1, 0, 0, 'maxwidth500 widthcentpercentminusxx', (string) $projectsListId, 'all', null, 1); + print $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 64, 0, '1', 1, 0, 0, 'maxwidth500 widthcentpercentminusxx', (string) $projectsListId, 'all', null, 1); } print '
'; $formactions->form_select_status_action('formaction', $search_status, 1, 'search_status', 1, 2, 'search_status width100 onrightofpage'); @@ -976,6 +984,11 @@ if (!empty($arrayfields['a.tms']['checked'])) { print_liste_field_titre($arrayfields['a.tms']['label'], $_SERVER["PHP_SELF"], "a.tms,a.id", "", $param, '', $sortfield, $sortorder, 'center '); $totalarray['nbfield']++; } +// Import ID +if (!empty($arrayfields['a.import_key']['checked'])) { + print_liste_field_titre("ImportId", $_SERVER["PHP_SELF"], "a.import_key", "", $param, '', $sortfield, $sortorder, 'center '); + $totalarray['nbfield']++; +} // Status if (!empty($arrayfields['a.percent']['checked'])) { print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "a.percent", "", $param, '', $sortfield, $sortorder, 'center '); @@ -1297,16 +1310,20 @@ while ($i < $imaxinloop) { // Date creation if (!empty($arrayfields['a.datec']['checked'])) { // Status/Percent - print ''.dol_print_date($db->jdate($obj->datec), 'dayhour', 'tzuserrel').''.dol_print_date($db->jdate($obj->datec), 'dayhour', 'tzuserrel').''.dol_print_date($db->jdate($obj->datem), 'dayhour', 'tzuserrel').''.dol_print_date($db->jdate($obj->datem), 'dayhour', 'tzuserrel').''.dolPrintHTML($obj->import_key).''.$actionstatic->LibStatut($obj->percent, 5, 0, $datep).''.$actionstatic->LibStatut($obj->percent, 5, 0, $datep).'
'.$langs->trans("Author").''; + print '
'.$langs->trans("Author").''; print $author->getNomUrl(-1); print "
'; - print $actioncomm->getTypePicto(); - print $labeltype; + $labeltypelong = $actioncomm->getTypeLabel(2); + print ''; + print $actioncomm->getTypePicto('valignmiddle'); + //$labeltype = $actioncomm->getTypeLabel(0); + //print $labeltype; print '