diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 3075225abb9..1995485eb4e 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -63,6 +63,7 @@ $search_email = GETPOST("search_email", 'alpha'); $search_categ = GETPOST("search_categ", 'int'); $search_filter = GETPOST("search_filter", 'alpha'); $search_status = GETPOST("search_status", 'intcomma'); +$search_morphy = GETPOST("search_morphy", 'alpha'); $search_import_key = trim(GETPOST("search_import_key", "alpha")); $catid = GETPOST("catid", 'int'); $optioncss = GETPOST('optioncss', 'alpha'); @@ -382,6 +383,9 @@ if ($search_status != '') { // Peut valoir un nombre ou liste de nombre separes par virgules $sql .= " AND d.statut in (".$db->sanitize($db->escape($search_status)).")"; } +if ($search_morphy != '') { + $sql .= natural_search("d.morphy", $search_morphy); +} if ($search_ref) { $sql .= natural_search("d.ref", $search_ref); } @@ -731,6 +735,11 @@ if (!empty($arrayfields['d.login']['checked'])) { } if (!empty($arrayfields['d.morphy']['checked'])) { print ''; + $arraymorphy = array('mor'=>$langs->trans("Moral"), 'phy'=>$langs->trans("Physical")); + print $form->selectarray('search_morphy', $arraymorphy, $search_morphy, 1); + print ''; +} +if (!empty($arrayfields['t.libelle']['checked'])) { print ''; } if (!empty($arrayfields['t.libelle']['checked'])) { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 4d83acfe44c..b0ea04adb3e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7633,16 +7633,24 @@ abstract class CommonObject } if ($result > 0) { if ($object->element === 'product') { - $getnomurlparam3 = (!isset($InfoFieldList[5]) ? 0 : $InfoFieldList[5]); - $getnomurlparam4 = (!isset($InfoFieldList[6]) ? -1 : $InfoFieldList[6]); - $getnomurlparam5 = (!isset($InfoFieldList[7]) ? 0 : $InfoFieldList[7]); - $getnomurlparam6 = (!isset($InfoFieldList[8]) ? '' : $InfoFieldList[8]); - $getnomurlparam7 = (!isset($InfoFieldList[9]) ? 0 : $InfoFieldList[9]); + $get_name_url_param_arr = array($getnomurlparam, $getnomurlparam2, 0, -1, 0, '', 0); + if (isset($val['get_name_url_params'])) { + $get_name_url_params = explode(':', $val['get_name_url_params']); + if (!empty($get_name_url_params)) { + $param_num_max = count($get_name_url_param_arr) - 1; + foreach ($get_name_url_params as $param_num => $param_value) { + if ($param_num > $param_num_max) { + break; + } + $get_name_url_param_arr[$param_num] = $param_value; + } + } + } /** * @var Product $object */ - $value = $object->getNomUrl($getnomurlparam, $getnomurlparam2, $getnomurlparam3, $getnomurlparam4, $getnomurlparam5, $getnomurlparam6, $getnomurlparam7); + $value = $object->getNomUrl($get_name_url_param_arr[0], $get_name_url_param_arr[1], $get_name_url_param_arr[2], $get_name_url_param_arr[3], $get_name_url_param_arr[4], $get_name_url_param_arr[5], $get_name_url_param_arr[6]); } else { $value = $object->getNomUrl($getnomurlparam, $getnomurlparam2); } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 68bca2606b7..625791ea0d0 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3342,7 +3342,6 @@ class Form } $outref = $objp->ref; - $outval = ''; $outbarcode = $objp->barcode; $outqty = 1; $outdiscount = 0; @@ -3523,48 +3522,52 @@ class Form } } - $opt = '\n"; // Add new entry // "key" value of json key array is used by jQuery automatically as selected value. Example: 'type' = product or service, 'price_ht' = unit price without tax // "label" value of json key array is used by jQuery automatically as text for combo box - $out .= $opt; - array_push( - $outarray, - array('key'=>$outkey, - 'value'=>$outref, - 'label'=>$outval, - 'qty'=>$outqty, - 'price_qty_ht'=>price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty - 'price_unit_ht'=>price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price - 'price_ht'=>price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) - 'tva_tx'=>$objp->tva_tx, - 'default_vat_code'=>$objp->default_vat_code, - 'discount'=>$outdiscount, - 'type'=>$outtype, - 'duration_value'=>$outdurationvalue, - 'duration_unit'=>$outdurationunit, - 'disabled'=>(empty($objp->idprodfournprice) ? true : false), - 'description'=>$objp->description - ) - ); + $out .= $optstart . ' data-html="'.dol_escape_htmltag($optlabel).'">' . $optlabel . "\n";; + array_push($outarray, $outarrayentry); + // Exemple of var_dump $outarray // array(1) {[0]=>array(6) {[key"]=>string(1) "2" ["value"]=>string(3) "ppp" // ["label"]=>string(76) "ppp (fff2) - ppp - 20,00 Euros/1unité (20,00 Euros/unité)" diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index df7408200a9..4c77566eeed 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -954,7 +954,7 @@ class FormMail extends Form $out .= ''; } else { if (!isset($this->ckeditortoolbar)) { - $this->ckeditortoolbar = 'dolibarr_notes'; + $this->ckeditortoolbar = 'dolibarr_mailings'; } // Editor wysiwyg diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php index 419727b1cca..8b4b7bf31c4 100644 --- a/htdocs/ftp/index.php +++ b/htdocs/ftp/index.php @@ -510,6 +510,7 @@ if (!function_exists('ftp_connect')) { $nboflines = count($contents); $rawlisthasfailed = false; $i = 0; + $nbofentries = 0; while ($i < $nboflines && $i < 1000) { $vals = preg_split('@ +@', utf8_encode($buff[$i]), 9); //$vals=preg_split('@ +@','drwxr-xr-x 2 root root 4096 Aug 30 2008 backup_apollon1',9); @@ -527,6 +528,7 @@ if (!function_exists('ftp_connect')) { // Is it a directory ? $is_directory = 0; + $is_link = 0; if ($file == '..') { $is_directory = 1; } elseif (!$rawlisthasfailed) { @@ -695,6 +697,7 @@ function dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $sect $ok = 1; $conn_id = null; + $mesg=""; if (!is_numeric($ftp_port)) { $mesg = $langs->transnoentitiesnoconv("FailedToConnectToFTPServer", $ftp_server, $ftp_port); diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 7229b14ea28..4dff257e257 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -101,7 +101,7 @@ class Inventory extends CommonObject 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,), 'title' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>25, 'css'=>'minwidth300', 'csslist'=>'tdoverflowmax200'), 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Warehouse', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'index'=>1, 'help'=>'InventoryForASpecificWarehouse', 'picto'=>'stock', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax200'), - 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php::::0:-1:0::1', 'label'=>'Product', 'visible'=>1, 'enabled'=>1, 'position'=>32, 'index'=>1, 'help'=>'InventoryForASpecificProduct', 'picto'=>'product', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax200'), + 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php', 'label'=>'Product', 'get_name_url_params' => '0::0:-1:0::1', 'visible'=>1, 'enabled'=>1, 'position'=>32, 'index'=>1, 'help'=>'InventoryForASpecificProduct', 'picto'=>'product', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax200'), 'date_inventory' => array('type'=>'date', 'label'=>'DateValue', 'visible'=>1, 'enabled'=>'$conf->global->STOCK_INVENTORY_ADD_A_VALUE_DATE', 'position'=>35), // This date is not used so disabled by default. 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501), diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 31fa1547ffc..1a0666d1067 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -128,6 +128,28 @@ if ($action == 'update' && !GETPOST("cancel") && $user->rights->projet->creer) { } } +if ($action == 'confirm_clone' && $confirm == 'yes') { + //$clone_contacts = GETPOST('clone_contacts') ? 1 : 0; + $clone_prog = GETPOST('clone_prog') ? 1 : 0; + $clone_time = GETPOST('clone_time') ? 1 : 0; + $clone_affectation = GETPOST('clone_affectation') ? 1 : 0; + $clone_change_dt = GETPOST('clone_change_dt') ? 1 : 0; + $clone_notes = GETPOST('clone_notes') ? 1 : 0; + $clone_file = GETPOST('clone_file') ? 1 : 0; + $result = $object->createFromClone($user, $object->id, $object->fk_project, $object->fk_task_parent, $clone_change_dt, $clone_affectation, $clone_time, $clone_file, $clone_notes, $clone_prog); + if ($result <= 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } else { + // Load new object + $newobject = new Task($db); + $newobject->fetch($result); + $newobject->fetch_optionals(); + $newobject->fetch_thirdparty(); // Load new object + $object = $newobject; + $action = ''; + } +} + if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->projet->supprimer) { $result = $projectstatic->fetch($object->fk_project); $projectstatic->fetch_thirdparty(); @@ -205,6 +227,7 @@ $help_url = ''; llxHeader('', $title, $help_url); + if ($id > 0 || !empty($ref)) { $res = $object->fetch_optionals(); if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object, 'fetchComments') && empty($object->comments)) { @@ -385,6 +408,22 @@ if ($id > 0 || !empty($ref)) { //$userAccess = $projectstatic->restrictedProjectArea($user); // We allow task affected to user even if a not allowed project //$arrayofuseridoftask=$object->getListContactId('internal'); + if ($action == 'clone') { + $formquestion = array( + 'text' => $langs->trans("ConfirmClone"), + //array('type' => 'checkbox', 'name' => 'clone_contacts', 'label' => $langs->trans("CloneContacts"), 'value' => true), + array('type' => 'checkbox', 'name' => 'clone_change_dt', 'label' => $langs->trans("CloneChanges"), 'value' => true), + array('type' => 'checkbox', 'name' => 'clone_affectation', 'label' => $langs->trans("CloneAffectation"), 'value' => true), + array('type' => 'checkbox', 'name' => 'clone_prog', 'label' => $langs->trans("CloneProgression"), 'value' => true), + array('type' => 'checkbox', 'name' => 'clone_time', 'label' => $langs->trans("CloneTimes"), 'value' => true), + array('type' => 'checkbox', 'name' => 'clone_file', 'label' => $langs->trans("CloneFile"), 'value' => true), + + ); + + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("ToClone"), $langs->trans("ConfirmCloneTask"), "confirm_clone", $formquestion, '', 1, 300, 590); + } + + $head = task_prepare_head($object); if ($action == 'edit' && $user->rights->projet->creer) { @@ -628,6 +667,7 @@ if ($id > 0 || !empty($ref)) { // Modify if ($user->rights->projet->creer) { print ''.$langs->trans('Modify').''; + print ''.$langs->trans('Clone').''; } else { print ''.$langs->trans('Modify').''; } diff --git a/htdocs/webhook/target_card.php b/htdocs/webhook/target_card.php index dd0d5e171e8..1e1f6522ea1 100644 --- a/htdocs/webhook/target_card.php +++ b/htdocs/webhook/target_card.php @@ -532,7 +532,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Clone - print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid)?'&socid='.$object->socid:'').'&action=clone&token='.newToken(), '', $permissiontoadd); + print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=clone&token='.newToken(), '', $permissiontoadd); /* if ($permissiontoadd) {