diff --git a/.tx/config b/.tx/config index a89b56c1013..c20f75769ae 100644 --- a/.tx/config +++ b/.tx/config @@ -272,12 +272,6 @@ source_file = htdocs/langs/en_US/sendings.lang source_lang = en_US type = MOZILLAPROPERTIES -[dolibarr.shop] -file_filter = htdocs/langs//shop.lang -source_file = htdocs/langs/en_US/shop.lang -source_lang = en_US -type = MOZILLAPROPERTIES - [dolibarr.sms] file_filter = htdocs/langs//sms.lang source_file = htdocs/langs/en_US/sms.lang diff --git a/ChangeLog b/ChangeLog index 37af36f3261..779be0eba39 100644 --- a/ChangeLog +++ b/ChangeLog @@ -122,6 +122,8 @@ For developers: - New: renamed table llx_c_pays to llx_c_country & libelle field to label. - New: Added hook "formConfirm" and "doActions" for fichinter card - New: Can search list of thirdparties from web service on part of name. +- New: Function getCurrencyAmount is marked as deprecated. Use function price to output a price + including currency symbol. - Qual: Renamed table llx_c_civilite into llx_c_civility, field civilite into label in the same table, and field civilite into civility in other table. diff --git a/dev/fixperms.sh b/dev/fixperms.sh index 731e45cf703..5844e8b2916 100755 --- a/dev/fixperms.sh +++ b/dev/fixperms.sh @@ -25,4 +25,6 @@ then find ./htdocs -type f -iname "*.php" -exec chmod a-x {} \; chmod a+x ./scripts/*/*.php chmod a+x ./scripts/*/*.sh + chmod g-w ./scripts/*/*.php + chmod g-w ./scripts/*/*.sh fi diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 1ec3d71c664..62e54c17948 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -159,7 +159,7 @@ if ($conf->use_javascript_ajax) print '
'; print ''; print ''; - print ''; } diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 2db6936e1d3..48387245c8a 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1028,7 +1028,7 @@ else // View by day $today=0; $todayarray=dol_getdate($now,'fast'); if ($todayarray['mday']==$day && $todayarray['mon']==$month && $todayarray['year']==$year) $today=1; - if ($today) $style='cal_today'; + //if ($today) $style='cal_today'; $timestamp=dol_mktime(12,0,0,$month,$day,$year); $arraytimestamp=dol_getdate($timestamp); @@ -1146,11 +1146,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa if (in_array($user->id, $keysofuserassigned)) { $nummytasks++; $cssclass='family_mytasks'; - // TODO Set a color using user color + // Must defined rule to choose color of who to use. // event->ownerid will still contains user id of owner // event->userassigned will be an array in future. - // $color=$user->color; + $color=$user->color; } else if ($event->type_code == 'ICALEVENT') { diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index fbd63e4006b..046ec450c26 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -44,6 +44,8 @@ $status=GETPOST("status",'alpha'); $type=GETPOST('type'); $actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':'')); $dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth'), GETPOST('dateselectday'), GETPOST('dateselectyear')); +$datestart=dol_mktime(0, 0, 0, GETPOST('datestartmonth'), GETPOST('datestartday'), GETPOST('datestartyear')); +$dateend=dol_mktime(0, 0, 0, GETPOST('dateendmonth'), GETPOST('dateendday'), GETPOST('dateendyear')); if ($actioncode == '') $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE); if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS); @@ -123,13 +125,19 @@ if (GETPOST("viewcal") || GETPOST("viewweek") || GETPOST("viewday")) * View */ +$form=new Form($db); + +$nav=''; +$nav.='   '; +$nav.=$form->select_date($dateselect, 'dateselect', 0, 0, 1, '', 1, 0, 1); +$nav.=' '; +$nav.=''; + $now=dol_now(); $help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda'; llxHeader('',$langs->trans("Agenda"),$help_url); -$form=new Form($db); - // Define list of all external calendars $listofextcals=array(); @@ -188,8 +196,9 @@ if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup > 0) if ($usergroup > 0) $sql.= ($filtera>0||$filtert>0||$filterd>0?" OR ":"")." ugu.fk_usergroup = ".$usergroup; $sql.= ")"; } -//if ($dateselect > 0) $sql.= " AND a.datep BETWEEN '".$db->idate($dateselect)."' AND '".$db->idate($dateselect+3600*24-1).'"'; -if ($dateselect > 0) $sql.= " AND a.datep BETWEEN '".$db->idate($dateselect)."' AND '".$db->idate($dateselect+3600*24-1)."'"; +if ($dateselect > 0) $sql.= " AND a.datep2 >= '".$db->idate($dateselect)."' AND a.datep <= '".$db->idate($dateselect+3600*24-1)."'"; +if ($datestart > 0) $sql.= " AND a.datep BETWEEN '".$db->idate($datestart)."' AND '".$db->idate($datestart+3600*24-1)."'"; +if ($dateend > 0) $sql.= " AND a.datep2 BETWEEN '".$db->idate($dateend)."' AND '".$db->idate($dateend+3600*24-1)."'"; $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit + 1, $offset); //print $sql; @@ -236,7 +245,7 @@ if ($resql) } */ - print_barre_liste($newtitle, $page, $_SERVER["PHP_SELF"], $param,$sortfield,$sortorder,$link,$num,0,''); + print_barre_liste($newtitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $link, $num, 0, '', 0, $nav); //print '
'; print ''."\n"; @@ -259,9 +268,11 @@ if ($resql) print ''; print ''; print ''; + print ''; - print ''; print ''; print ''; print ''; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 51ddb81c0b4..dacc7c5ce00 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -710,6 +710,11 @@ if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) print '
 
'; print $langs->trans("Other"); print '
'; + /* TODO Show this if at least one cumulated event + print '
 
'; + print $langs->trans("SeveralEvents"); + print '
'; + */ } // Add js code to manage click on a box @@ -734,7 +739,7 @@ jQuery(document).ready(function() { else if (ids.indexOf(",") > -1) /* There is several events */ { /* alert(\'several events\'); */ - url = "'.DOL_URL_ROOT.'/comm/action/listactions.php?usertodo="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+dateselectday; + url = "'.DOL_URL_ROOT.'/comm/action/listactions.php?usertodo="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+day; window.location.href = url; } else /* One event */ diff --git a/htdocs/comm/propal/apercu.php b/htdocs/comm/propal/apercu.php index ce80783c731..e575c8f27fc 100644 --- a/htdocs/comm/propal/apercu.php +++ b/htdocs/comm/propal/apercu.php @@ -186,7 +186,7 @@ if ($id > 0 || ! empty($ref)) // Si fichier png PDF d'1 page trouve if (file_exists($fileimage)) { - print ''; + print ''; } // Si fichier png PDF de plus d'1 page trouve elseif (file_exists($fileimagebis)) @@ -199,13 +199,12 @@ elseif (file_exists($fileimagebis)) if (file_exists($dir_output.$preview)) { - print '

'; + print '

'; } } } -print ''; - -$db->close(); llxFooter(); + +$db->close(); diff --git a/htdocs/commande/apercu.php b/htdocs/commande/apercu.php index abb2be95076..839ca73d5b9 100644 --- a/htdocs/commande/apercu.php +++ b/htdocs/commande/apercu.php @@ -206,7 +206,7 @@ if ($id > 0 || ! empty($ref)) // Si fichier png PDF d'1 page trouve if (file_exists($fileimage)) { - print ''; + print ''; } // Si fichier png PDF de plus d'1 page trouve elseif (file_exists($fileimagebis)) @@ -219,13 +219,12 @@ elseif (file_exists($fileimagebis)) if (file_exists($dir_output.$preview)) { - print '

'; + print '

'; } } } -print ''; - -$db->close(); llxFooter(); + +$db->close(); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 136ade4df3c..a7ced339087 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -629,8 +629,8 @@ else if ($action == 'addline' && $user->rights->commande->creer) { } } else - { - setEventMessage($prodcustprice->error,'errors'); + { + setEventMessage($prodcustprice->error,'errors'); } } diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index 921b1739767..e6961ed97dd 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -233,7 +233,11 @@ foreach ($accounts as $key=>$type) $total[$acc->currency_code] += $solde; } } -if (! $found) print '

'; +if (! $found) +{ + $var = !$var; + print ''; +} // Total foreach ($total as $key=>$solde) { diff --git a/htdocs/compta/facture/apercu.php b/htdocs/compta/facture/apercu.php index ee197e9cee3..211d9241a8f 100644 --- a/htdocs/compta/facture/apercu.php +++ b/htdocs/compta/facture/apercu.php @@ -398,7 +398,7 @@ if ($id > 0 || ! empty($ref)) // Si fichier png PDF d'1 page trouve if (file_exists($fileimage)) { - print ''; + print ''; } // Si fichier png PDF de plus d'1 page trouve elseif (file_exists($fileimagebis)) @@ -411,12 +411,12 @@ elseif (file_exists($fileimagebis)) if (file_exists($dir_output.$preview)) { - print '

'; + print '

'; } } } -$db->close(); - llxFooter(); + +$db->close(); diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 1ba775268a1..db83554c7ae 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -243,12 +243,12 @@ if (empty($reshook)) { if ($backtopage) { - header("Location: ".$backtopage); + header("Location: ".$backtopage); exit; } else { - header("Location: ".DOL_URL_ROOT.'/contact/list.php'); + header("Location: ".DOL_URL_ROOT.'/contact/list.php'); exit; } } diff --git a/htdocs/core/ajax/productonoff.php b/htdocs/core/ajax/productonoff.php new file mode 100644 index 00000000000..05eebc7a65f --- /dev/null +++ b/htdocs/core/ajax/productonoff.php @@ -0,0 +1,52 @@ +. + */ + +/** + * \file htdocs/core/ajax/productonoff.php + * \brief File to set tosell and tobuy for product + */ + +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); +if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); +if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); +if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); +if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/genericobject.class.php'; + +$action=GETPOST('action','alpha'); +$id=GETPOST('id', 'int'); +$value=GETPOST('value', 'int'); + +$object = new GenericObject($db); + +/* + * View + */ + +top_httphead(); + +print ''."\n"; + +// Registering new values +if (! empty($action) && ! empty($id) && $user->rights->produit->creer) { + if ($action == 'setstatus') + $object->setValueFrom('tosell', $value, 'product', $id); + else if ($action == 'setstatus_buy') + $object->setValueFrom('tobuy', $value, 'product', $id); +} diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 3da33709165..9996337736a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1747,6 +1747,7 @@ abstract class CommonObject * @param string $origin Linked element type * @param int $origin_id Linked element id * @return int <=0 if KO, >0 if OK + * @see fetchObjectLinked, updateObjectLinked, deleteObjectLinked */ function add_object_linked($origin=null, $origin_id=null) { @@ -1790,6 +1791,7 @@ abstract class CommonObject * @param string $targettype Object target type * @param string $clause 'OR' or 'AND' clause used when both source id and target id are provided * @return void + * @see add_object_linked, updateObjectLinked, deleteObjectLinked */ function fetchObjectLinked($sourceid='',$sourcetype='',$targetid='',$targettype='',$clause='OR') { @@ -1819,6 +1821,12 @@ abstract class CommonObject $sourcetype = (! empty($sourcetype) ? $sourcetype : $this->element); $targettype = (! empty($targettype) ? $targettype : $this->element); + if (empty($sourceid) && empty($targetid)) + { + dol_print_error('','Bad usage of function. No parameter defined and no id defined'); + return -1; + } + // Links beetween objects are stored in this table $sql = 'SELECT fk_source, sourcetype, fk_target, targettype'; $sql.= ' FROM '.MAIN_DB_PREFIX.'element_element'; @@ -1944,6 +1952,7 @@ abstract class CommonObject * @param int $targetid Object target id * @param string $targettype Object target type * @return int >0 if OK, <0 if KO + * @see add_object_linked, fetObjectLinked, deleteObjectLinked */ function updateObjectLinked($sourceid='', $sourcetype='', $targetid='', $targettype='') { @@ -1989,6 +1998,7 @@ abstract class CommonObject * @param int $targetid Object target id * @param string $targettype Object target type * @return int >0 if OK, <0 if KO + * @see add_object_linked, updateObjectLinked, fetchObjectLinked */ function deleteObjectLinked($sourceid='', $sourcetype='', $targetid='', $targettype='') { diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 4f7044e3d1f..298c36636bd 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -161,29 +161,29 @@ class HookManager { //print "Before hook ".get_class($actionclassinstance)." method=".$method." hooktype=".$hooktype." results=".count($actionclassinstance->results)." resprints=".count($actionclassinstance->resprints)." resaction=".$resaction." result=".$result."
\n"; - //print 'class='.get_class($actionclassinstance).' method='.$method.' action='.$action; - // jump to next class if method does not exists + // jump to next module/class if method does not exists if (! method_exists($actionclassinstance,$method)) continue; - // test to avoid to run twice a hook, when a module implements several active contexts + + // test to avoid to run twice a hook, when a module implements several active contexts if (in_array($module,$modulealreadyexecuted)) continue; $modulealreadyexecuted[$module]=$module; // Use the $currentcontext in method for avoid to run twice + + // Clean class (an error may have been set into a previous call of another method for same module/hook) + $actionclassinstance->error=0; + $actionclassinstance->errors=array(); + // Add current context for avoid method execution in bad context, you can add this test in your method : eg if($currentcontext != 'formfile') return; $parameters['currentcontext'] = $context; // Hooks that must return int (hooks with type 'addreplace') if ($hooktype == 'addreplace') { + dol_syslog("Call method ".$method." of class ".get_class($actionclassinstance).", module=".$module.", hooktype=".$hooktype, LOG_DEBUG); $resaction += $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example) if ($resaction < 0 || ! empty($actionclassinstance->error) || (! empty($actionclassinstance->errors) && count($actionclassinstance->errors) > 0)) { $error++; $this->error=$actionclassinstance->error; $this->errors=array_merge($this->errors, (array) $actionclassinstance->errors); - // TODO dead code to remove (do not enable this, but fix hook instead) - /* Change must be inside the method of hook if required. Only hook must decide if $action must be modified or not. - if ($method == 'doActions') - { - if ($action=='add') $action='create'; - if ($action=='update') $action='edit'; - }*/ + dol_syslog("Error on hook module=".$module.", method ".$method.", class ".get_class($actionclassinstance).", hooktype=".$hooktype.(empty($this->error)?'':" ".$this->error).(empty($this->errors)?'':" ".join(",",$this->errors)), LOG_ERR); } if (is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results); @@ -195,6 +195,7 @@ class HookManager // TODO. this should be done into the method of hook by returning nothing if (is_array($parameters) && ! empty($parameters['special_code']) && $parameters['special_code'] > 3 && $parameters['special_code'] != $actionclassinstance->module_number) continue; + //dol_syslog("Call method ".$method." of class ".get_class($actionclassinstance).", module=".$module.", hooktype=".$hooktype, LOG_DEBUG); $result = $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example) if (! empty($actionclassinstance->results) && is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 9460477439b..6dfc78c216c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -194,7 +194,7 @@ class Form { $ret.='

'; } @@ -2706,6 +2706,7 @@ class Form * @param int $maxlength Maximum length for labels * @param int $excludeafterid Exclude all categories after this leaf in category tree. * @return void + * @see select_categories */ function select_all_categories($type, $selected='', $htmlname="parent", $maxlength=64, $excludeafterid=0) { diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index ef58b6c7322..d32c0def5ab 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -682,22 +682,21 @@ class FormCompany * @param string $selected Default selected value * @param string $htmlname HTML select name * @param string $source Source ('internal' or 'external') - * @param string $order Sort criteria + * @param string $sortorder Sort criteria * @param int $showempty 1=Add en empty line * @return void */ - function selectTypeContact($object, $selected, $htmlname = 'type', $source='internal', $order='code', $showempty=0) + function selectTypeContact($object, $selected, $htmlname = 'type', $source='internal', $sortorder='code', $showempty=0) { if (is_object($object) && method_exists($object, 'liste_type_contact')) { - $lesTypes = $object->liste_type_contact($source, $order, 0, 1); + $lesTypes = $object->liste_type_contact($source, $sortorder, 0, 1); print '\n"; diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 7abe08729d2..1ed76cddd9b 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -307,6 +307,7 @@ class FormOther * @param string $htmlname Name of combo list * @param int $nocateg Show also an entry "Not categorized" * @return string Html combo list code + * @see select_all_categories */ function select_categories($type,$selected=0,$htmlname='search_categ',$nocateg=0) { @@ -318,7 +319,7 @@ class FormOther $tab_categs = $static_categs->get_full_arbo($type); // Print a select with each of them - $moreforfilter =''; $moreforfilter.=''; // Should use -1 to say nothing if (is_array($tab_categs)) diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 7462a40e897..6b24d5356df 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -701,6 +701,7 @@ class Translate * @param string $currency_code Currency Code * @param string $amount If not '', show currency + amount according to langs ($10, 10€). * @return string Amount + Currency symbol encoded into UTF8 + * @deprecated Use method price to output a price */ function getCurrencyAmount($currency_code, $amount) { diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 39813b9e191..075baf41161 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -965,6 +965,7 @@ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql { //var_dump($objMod->dictionaries['tabname']); $taborder[] = 0; + $tabfieldcheck[] = array(); $tabhelp[] = array(); foreach($objMod->dictionaries['tabname'] as $val) { $taborder[] = count($tabname)+1; @@ -978,7 +979,7 @@ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql foreach($objMod->dictionaries['tabfieldinsert'] as $val) $tabfieldinsert[] = $val; foreach($objMod->dictionaries['tabrowid'] as $val) $tabrowid[] = $val; foreach($objMod->dictionaries['tabcond'] as $val) $tabcond[] = $val; - foreach($objMod->dictionaries['tabfieldcheck'] as $val) $tabfieldcheck[] = $val; + if (! empty($objMod->dictionaries['tabfieldcheck'])) foreach($objMod->dictionaries['tabfieldcheck'] as $val) $tabfieldcheck[] = $val; if (! empty($objMod->dictionaries['tabhelp'])) foreach($objMod->dictionaries['tabhelp'] as $val) $tabhelp[] = $val; //foreach($objMod->dictionaries['tabsqlsort'] as $val) $tablib[] = $val; //$tabname = array_merge ($tabname, $objMod->dictionaries['tabname']); diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 9081fba5550..4bc6da083aa 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -459,3 +459,91 @@ function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, return $out; } +/** + * On/off button for product tosell or tobuy + * + * @param int $id Id product to set + * @param string $code Name of constant : status or status_buy + * @param array $input Array of type->list of CSS element to switch. Example: array('disabled'=>array(0=>'cssid')) + * @return void + */ +function ajax_productonoff($id, $code, $input=array()) +{ + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + global $conf, $langs, $db; + + $object = new Product($db); + $object->fetch($id); + + $out= ''; + if ($code=='status') { + $out.= ''.img_picto($langs->trans("ProductStatusNotOnSell"),'switch_off').''; + $out.= ''.img_picto($langs->trans("ProductStatusOnSell"),'switch_on').''; + } + if ($code=='status_buy') { + $out.= ''.img_picto($langs->trans("ProductStatusNotOnBuy"),'switch_off').''; + $out.= ''.img_picto($langs->trans("ProductStatusOnBuy"),'switch_on').''; + } + return $out; +} + diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index c5ba612b60f..e5723b9e2d6 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -67,7 +67,7 @@ function societe_prepare_head($object) if (! empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) { $head[$h][0] = DOL_URL_ROOT.'/societe/societecontact.php?socid='.$object->id; - $head[$h][1] = $langs->trans("Contact"); + $head[$h][1] = $langs->trans("ContactsAddresses"); $head[$h][2] = 'contact'; $h++; } @@ -110,25 +110,25 @@ function societe_prepare_head($object) if (! empty($conf->notification->enabled)) { $nbNote = 0; - $sql = "SELECT COUNT(n.rowid) as nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."notify_def as n"; - $sql.= " WHERE fk_soc = ".$object->id; - $resql=$db->query($sql); - if ($resql) - { - $num = $db->num_rows($resql); - $i = 0; - while ($i < $num) - { - $obj = $db->fetch_object($resql); - $nbNote=$obj->nb; - $i++; - } - } - else { - dol_print_error($db); - } - + $sql = "SELECT COUNT(n.rowid) as nb"; + $sql.= " FROM ".MAIN_DB_PREFIX."notify_def as n"; + $sql.= " WHERE fk_soc = ".$object->id; + $resql=$db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) + { + $obj = $db->fetch_object($resql); + $nbNote=$obj->nb; + $i++; + } + } + else { + dol_print_error($db); + } + $head[$h][0] = DOL_URL_ROOT.'/societe/notify/card.php?socid='.$object->id; $head[$h][1] = $langs->trans("Notifications"); if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; @@ -492,7 +492,7 @@ function show_projects($conf,$langs,$db,$object,$backtopage='') $projectstatic = new Project($db); $i=0; - $var=true; + $var=false; while ($i < $num) { $obj = $db->fetch_object($result); @@ -521,8 +521,9 @@ function show_projects($conf,$langs,$db,$object,$backtopage='') } } else - { - print ''; + { + $var = false; + print ''; } $db->free($result); } @@ -680,7 +681,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') $result = $db->query($sql); $num = $db->num_rows($result); - $var=true; + $var=false; if ($num) { $i=0; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index edf0b1b9dcd..4be2583aa63 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -170,7 +170,7 @@ function dol_shutdown() * Return value of a param into GET or POST supervariable * * @param string $paramname Name of parameter to found - * @param string $check Type of check (''=no check, 'int'=check it's numeric, 'alpha'=check it's text and sign, 'aZ'=check it's a-z only, 'array'=check it's array, 'san_alpha'= Use filter_var with FILTER_SANITIZE_STRING, 'custom'= custom filter specify $filter and $options) + * @param string $check Type of check (''=no check, 'int'=check it's numeric, 'alpha'=check it's text and sign, 'aZ'=check it's a-z only, 'array'=check it's array, 'san_alpha'= Use filter_var with FILTER_SANITIZE_STRING (do not use this for free text string), 'custom'= custom filter specify $filter and $options) * @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get, 4 = post then get then cookie) * @param int $filter Filter to apply when $check is set to custom. (See http://php.net/manual/en/filter.filters.php for détails) * @param mixed $options Options to pass to filter_var when $check is set to custom @@ -453,6 +453,18 @@ function dol_string_nospecial($str,$newstr='_',$badchars='') return str_replace($forbidden_chars_to_replace,$newstr,str_replace($forbidden_chars_to_remove,"",$str)); } + +/** + * Encode string for xml usage + * + * @param string $string String to encode + * @return string String encoded + */ +function dolEscapeXML($string) +{ + return strtr($string, array('\''=>''','"'=>'"','&'=>'&','<'=>'<','>'=>'>')); +} + /** * Returns text escaped for inclusion into javascript code * @@ -658,7 +670,7 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p { $isactive=(is_numeric($active) && $i == $active) || (! is_numeric($active) && $active == $links[$i][2]); - $out.='
'; + $out.='
'; if (isset($links[$i][2]) && $links[$i][2] == 'image') { if (!empty($links[$i][0])) @@ -2627,10 +2639,11 @@ function load_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpath * @param int $num number of records found by select with limit+1 * @param int $totalnboflines Total number of records/lines for all pages (if known) * @param string $picto Icon to use before title (should be a 32x32 transparent png file) - * @param int $pictoisfullpath 1=Icon name is a full absolute url of image + * @param int $pictoisfullpath 1=Icon name is a full absolute url of image + * @param string $morehtml More html to show * @return void */ -function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=0, $picto='title.png', $pictoisfullpath=0) +function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=0, $picto='title.png', $pictoisfullpath=0, $morehtml='') { global $conf,$langs; @@ -2706,6 +2719,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so } } print_fleche_navigation($page,$file,$options,$nextpage,$pagelist); + if ($morehtml) print $morehtml; print ''; print '
'.$langs->trans("Statistics").'
'; + print '
'; $SommeA=0; $SommeB=0; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 335716bc4c7..4f600b49b91 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -387,13 +387,14 @@ if ($id == 11) $langs->load("bills"); $langs->load("interventions"); $elementList = array( - 'proposal' => $langs->trans('Proposal'), - 'order' => $langs->trans('Order'), - 'invoice' => $langs->trans('Bill'), + '' => '', +// 'proposal' => $langs->trans('Proposal'), +// 'order' => $langs->trans('Order'), +// 'invoice' => $langs->trans('Bill'), 'invoice_supplier' => $langs->trans('SupplierBill'), 'order_supplier' => $langs->trans('SupplierOrder'), - 'intervention' => $langs->trans('InterventionCard'), - 'contract' => $langs->trans('Contract'), +// 'intervention' => $langs->trans('InterventionCard'), +// 'contract' => $langs->trans('Contract'), 'project' => $langs->trans('Project'), 'project_task' => $langs->trans('Task'), 'agenda' => $langs->trans('Agenda'), @@ -402,10 +403,11 @@ if ($id == 11) 'propal' => $langs->trans('Proposal'), 'commande' => $langs->trans('Order'), 'facture' => $langs->trans('Bill'), - 'facture_fourn' => $langs->trans('SupplierBill'), +// 'facture_fourn' => $langs->trans('SupplierBill'), 'fichinter' => $langs->trans('InterventionCard') ); if (! empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) $elementList["societe"] = $langs->trans('ThirdParty'); + asort($elementList); $sourceList = array( 'internal' => $langs->trans('Internal'), 'external' => $langs->trans('External') @@ -749,6 +751,7 @@ if ($action == 'delete') { print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$_GET["code"].'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); } +//var_dump($elementList); /* * Show a dictionary diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index eceeb2890bc..76a19c91d7d 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -171,7 +171,7 @@ $nbofentries=(count($data) - 1); if ($nbofentries > 0) { - print '
'; + print '
'; tree_recur($data,$data[0],0); print '
'; - print $form->select_date($dateselect, 'dateselect', 0, 0, 1, '', 1, 0, 1); + print $form->select_date($datestart, 'datestart', 0, 0, 1, '', 1, 0, 1); + print ''; + print $form->select_date($dateend, 'dateend', 0, 0, 1, '', 1, 0, 1); print '
'.$langs->trans("None").'
'.$langs->trans("None").'
'; $ret.=''; - $ret.='
'."\n"; + //$ret.='
'."\n"; $ret.=''; $ret.='
'.$langs->trans("None").'
'.$langs->trans("None").'
'."\n"; @@ -3715,6 +3729,7 @@ function dol_nl2br($stringtoencode,$nl2brmode=0,$forxml=false) } } + /** * This function is called to encode a string into a HTML string but differs from htmlentities because * all entities but &,<,> are converted. This permits to encode special chars to entities with no double diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index e6f6228eec9..a2420624695 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -573,17 +573,18 @@ function array2table($data,$tableMarkup=1,$tableoptions='',$troptions='',$tdopti /** * Return last or next value for a mask (according to area we should not reset) * - * @param DoliDB $db Database handler + * @param DoliDB $db Database handler * @param string $mask Mask to use * @param string $table Table containing field with counter * @param string $field Field containing already used values of counter * @param string $where To add a filter on selection (for exemple to filter on invoice types) * @param Societe $objsoc The company that own the object we need a counter for * @param string $date Date to use for the {y},{m},{d} tags. - * @param string $mode 'next' for next value or 'last' for last value - * @return string New value (numeric) or error message + * @param string $mode 'next' for next value or 'last' for last value + * @param bool $bentityon activate the entity filterdefault is true (for modules not compatible with multicompany) + * @return string New value (numeric) or error message */ -function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$mode='next') +function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$mode='next', $bentityon=true) { global $conf; @@ -784,7 +785,8 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $sql.= " FROM ".MAIN_DB_PREFIX.$table; $sql.= " WHERE ".$field." LIKE '".$maskLike."'"; $sql.= " AND ".$field." NOT LIKE '%PROV%'"; - $sql.= " AND entity IN (".getEntity($table, 1).")"; + if ($bentityon) // only if entity enable + $sql.= " AND entity IN (".getEntity($table, 1).")"; if ($where) $sql.=$where; if ($sqlwhere) $sql.=' AND '.$sqlwhere; @@ -824,7 +826,8 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $sql.= " FROM ".MAIN_DB_PREFIX.$table; $sql.= " WHERE ".$field." LIKE '".$maskLike."'"; $sql.= " AND ".$field." NOT LIKE '%PROV%'"; - $sql.= " AND entity IN (".getEntity($table, 1).")"; + if ($bentityon) // only if entity enable + $sql.= " AND entity IN (".getEntity($table, 1).")"; if ($where) $sql.=$where; if ($sqlwhere) $sql.=' AND '.$sqlwhere; @@ -877,7 +880,8 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $maskrefclient_sql.= " FROM ".MAIN_DB_PREFIX.$table; //$sql.= " WHERE ".$field." not like '(%'"; $maskrefclient_sql.= " WHERE ".$field." LIKE '".$maskrefclient_maskLike."'"; - $maskrefclient_sql.= " AND entity IN (".getEntity($table, 1).")"; + if ($bentityon) // only if entity enable + $maskrefclient_sql.= " AND entity IN (".getEntity($table, 1).")"; if ($where) $maskrefclient_sql.=$where; //use the same optional where as general mask if ($sqlwhere) $maskrefclient_sql.=' AND '.$sqlwhere; //use the same sqlwhere as general mask $maskrefclient_sql.=' AND (SUBSTRING('.$field.', '.(strpos($maskwithnocode,$maskrefclient)+1).', '.dol_strlen($maskrefclient_maskclientcode).")='".$maskrefclient_clientcode."')"; diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 51a3a13ff58..1b7da875073 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -334,7 +334,7 @@ class doc_generic_order_odt extends ModelePDFCommandes $array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs); $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); $array_objet=$this->get_substitutionarray_object($object,$outputlangs); - $array_other=$this->get_substitutionarray_other($user,$outputlangs); + $array_other=$this->get_substitutionarray_other($outputlangs); $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other); complete_substitutions_array($tmparray, $outputlangs, $object); diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 2ad6b87643a..2ca90b13ace 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -343,7 +343,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); $array_objet=$this->get_substitutionarray_object($object,$outputlangs); $array_propal=is_object($propal_object)?$this->get_substitutionarray_object($propal_object,$outputlangs,'propal'):array(); - $array_other=$this->get_substitutionarray_other($user,$outputlangs); + $array_other=$this->get_substitutionarray_other($outputlangs); $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_propal,$array_other); complete_substitutions_array($tmparray, $outputlangs, $object); diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 93df313ad4c..1364aeff65e 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -504,7 +504,7 @@ class doc_generic_project_odt extends ModelePDFProjects $array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs); $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); $array_objet=$this->get_substitutionarray_object($object,$outputlangs); - $array_other=$this->get_substitutionarray_other($user,$outputlangs); + $array_other=$this->get_substitutionarray_other($outputlangs); $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other); complete_substitutions_array($tmparray, $outputlangs, $object); diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index c5043857469..7f93851cc65 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -490,7 +490,7 @@ class doc_generic_task_odt extends ModelePDFTask $array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs); $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); $array_objet=$this->get_substitutionarray_object($project,$outputlangs); - $array_other=$this->get_substitutionarray_other($user,$outputlangs); + $array_other=$this->get_substitutionarray_other($outputlangs); $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other); complete_substitutions_array($tmparray, $outputlangs, $object); diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 080c781b404..8f79094befc 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -368,7 +368,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales $array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs); $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); $array_objet=$this->get_substitutionarray_object($object,$outputlangs); - $array_other=$this->get_substitutionarray_other($user,$outputlangs); + $array_other=$this->get_substitutionarray_other($outputlangs); $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other); complete_substitutions_array($tmparray, $outputlangs, $object); diff --git a/htdocs/fichinter/apercu.php b/htdocs/fichinter/apercu.php index 4edd52809df..65721bdcce1 100644 --- a/htdocs/fichinter/apercu.php +++ b/htdocs/fichinter/apercu.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent * @@ -40,6 +40,11 @@ $ref = GETPOST('ref','alpha'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'ficheinter', $id, 'fichinter'); + +/* + * View + */ + llxHeader(); $form = new Form($db); @@ -154,6 +159,8 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; + + dol_fiche_end(); } else { @@ -165,7 +172,7 @@ if ($id > 0 || ! empty($ref)) // Si fichier png PDF d'1 page trouve if (file_exists($fileimage)) { - print ''; + print ''; } // Si fichier png PDF de plus d'1 page trouve elseif (file_exists($fileimagebis)) @@ -178,13 +185,12 @@ elseif (file_exists($fileimagebis)) if (file_exists($dir_output.$preview)) { - print '

'; + print '

'; } } } -print ''; - -$db->close(); llxFooter(); + +$db->close(); diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index b3858c5f4aa..076ad9bc689 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -49,7 +49,11 @@ $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder="DESC"; -if (! $sortfield) $sortfield="fd.date"; +if (! $sortfield) +{ + if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sortfield="fd.date"; + else $sortfield="f.ref"; +} $limit = $conf->liste_limit; $search_ref=GETPOST('search_ref','alpha'); @@ -70,13 +74,12 @@ llxHeader('', $langs->trans("Intervention")); $sql = "SELECT"; $sql.= " f.ref, f.rowid as fichid, f.fk_statut, f.description,"; -$sql.= " fd.description as descriptiondetail, fd.date as dp, fd.duree,"; +if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sql.= " fd.description as descriptiondetail, fd.date as dp, fd.duree,"; $sql.= " s.nom as name, s.rowid as socid, s.client"; $sql.= " FROM (".MAIN_DB_PREFIX."societe as s"; -if (! $user->rights->societe->client->voir && empty($socid)) - $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; +if (! $user->rights->societe->client->voir && empty($socid)) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= ", ".MAIN_DB_PREFIX."fichinter as f)"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as fd ON fd.fk_fichinter = f.rowid"; +if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as fd ON fd.fk_fichinter = f.rowid"; $sql.= " WHERE f.fk_soc = s.rowid "; $sql.= " AND f.entity = ".$conf->entity; if ($search_ref) { @@ -86,7 +89,8 @@ if ($search_company) { $sql .= natural_search('s.nom', $search_company); } if ($search_desc) { - $sql .= natural_search(array('f.description', 'fd.description'), $search_desc); + if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sql .= natural_search(array('f.description', 'fd.description'), $search_desc); + else $sql .= natural_search(array('f.description'), $search_desc); } if ($search_status != '' && $search_status >= 0) { $sql .= ' AND f.fk_statut = '.$search_status; @@ -97,6 +101,7 @@ if ($socid) $sql.= " AND s.rowid = " . $socid; $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit+1, $offset); +//print $sql; $result=$db->query($sql); if ($result) diff --git a/htdocs/holiday/admin/tomergewithholiday.php b/htdocs/holiday/admin/tomergewithholiday.php old mode 100755 new mode 100644 diff --git a/htdocs/holiday/tomergewithdefine_holiday.php b/htdocs/holiday/tomergewithdefine_holiday.php old mode 100755 new mode 100644 diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index 67dba69dc93..2b140d19a15 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -1091,7 +1091,8 @@ ALTER TABLE llx_contrat ADD COLUMN model_pdf varchar(255) DEFAULT NULL AFTER not ALTER TABLE llx_c_country ADD COLUMN favorite tinyint DEFAULT 0 AFTER active; UPDATE llx_c_country SET favorite = '1' WHERE rowid = '0'; -ALTER TABLE llx_c_email_templates ADD UNIQUE INDEX uk_c_email_templates(label, lang); +ALTER TABLE llx_c_email_templates DROP INDEX uk_c_email_templates; +ALTER TABLE llx_c_email_templates ADD UNIQUE INDEX uk_c_email_templates(entity, label, lang); ALTER TABLE llx_c_email_templates ADD INDEX idx_type(type_template); -- Remove OSC module diff --git a/htdocs/install/mysql/tables/llx_c_email_templates.key.sql b/htdocs/install/mysql/tables/llx_c_email_templates.key.sql index f4a632e9afc..665b8d610f0 100644 --- a/htdocs/install/mysql/tables/llx_c_email_templates.key.sql +++ b/htdocs/install/mysql/tables/llx_c_email_templates.key.sql @@ -17,6 +17,6 @@ -- Table with templates of emails -- =================================================================== -ALTER TABLE llx_c_email_templates ADD UNIQUE INDEX uk_c_email_templates(label, lang); +ALTER TABLE llx_c_email_templates ADD UNIQUE INDEX uk_c_email_templates(entity, label, lang); ALTER TABLE llx_c_email_templates ADD INDEX idx_type(type_template); diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index 227f7a61118..84383b46f1f 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -89,5 +89,5 @@ ExtSiteUrlAgenda=URL to access .ical file ExtSiteNoLabel=No Description WorkingTimeRange=Working time range WorkingDaysRange=Working days range -AddEvent=Add event +AddEvent=Create event MyAvailability=My availability \ No newline at end of file diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 0af0a26fd19..177d82ef5b4 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -87,7 +87,7 @@ ClassifyCanceled=Classify 'Abandoned' ClassifyClosed=Classify 'Closed' ClassifyUnBilled=Classify 'Unbilled' CreateBill=Create Invoice -AddBill=Add invoice or credit note +AddBill=Create invoice or credit note AddToDraftInvoices=Add to draft invoice DeleteBill=Delete invoice SearchACustomerInvoice=Search for a customer invoice @@ -225,13 +225,13 @@ NonPercuRecuperable=Non-recoverable SetConditions=Set payment terms SetMode=Set payment mode Billed=Billed -RepeatableInvoice=Pre-defined invoice -RepeatableInvoices=Pre-defined invoices -Repeatable=Pre-defined -Repeatables=Pre-defined -ChangeIntoRepeatableInvoice=Convert into pre-defined -CreateRepeatableInvoice=Create pre-defined invoice -CreateFromRepeatableInvoice=Create from pre-defined invoice +RepeatableInvoice=Template invoice +RepeatableInvoices=Template invoices +Repeatable=Template +Repeatables=Templates +ChangeIntoRepeatableInvoice=Convert into template invoice +CreateRepeatableInvoice=Create template invoice +CreateFromRepeatableInvoice=Create from template invoice CustomersInvoicesAndInvoiceLines=Customer invoices and invoice's lines CustomersInvoicesAndPayments=Customer invoices and payments ExportDataset_invoice_1=Customer invoices list and invoice's lines diff --git a/htdocs/langs/en_US/commercial.lang b/htdocs/langs/en_US/commercial.lang index 73c399eb604..390a7f837e8 100644 --- a/htdocs/langs/en_US/commercial.lang +++ b/htdocs/langs/en_US/commercial.lang @@ -9,9 +9,9 @@ Prospect=Prospect Prospects=Prospects DeleteAction=Delete an event/task NewAction=New event/task -AddAction=Add event/task -AddAnAction=Add an event/task -AddActionRendezVous=Add a Rendez-vous event +AddAction=Create event/task +AddAnAction=Create an event/task +AddActionRendezVous=Create a Rendez-vous event Rendez-Vous=Rendezvous ConfirmDeleteAction=Are you sure you want to delete this event/task ? CardAction=Event card diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 06c350039a3..7bfaf799f3a 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -259,8 +259,8 @@ AvailableGlobalDiscounts=Absolute discounts available DiscountNone=None Supplier=Supplier CompanyList=Company's list -AddContact=Add contact -AddContactAddress=Add contact/address +AddContact=Create contact +AddContactAddress=Create contact/address EditContact=Edit contact EditContactAddress=Edit contact/address Contact=Contact @@ -268,8 +268,8 @@ ContactsAddresses=Contacts/Addresses NoContactDefinedForThirdParty=No contact defined for this third party NoContactDefined=No contact defined DefaultContact=Default contact/address -AddCompany=Add company -AddThirdParty=Add third party +AddCompany=Create company +AddThirdParty=Create third party DeleteACompany=Delete a company PersonalInformations=Personal data AccountancyCode=Accountancy code @@ -379,8 +379,8 @@ DeliveryAddressLabel=Delivery address label DeleteDeliveryAddress=Delete a delivery address ConfirmDeleteDeliveryAddress=Are you sure you want to delete this delivery address? NewDeliveryAddress=New delivery address -AddDeliveryAddress=Add address -AddAddress=Add address +AddDeliveryAddress=Create address +AddAddress=Create address NoOtherDeliveryAddress=No alternative delivery address defined SupplierCategory=Supplier category JuridicalStatus200=Independant diff --git a/htdocs/langs/en_US/contracts.lang b/htdocs/langs/en_US/contracts.lang index 8a554a9770b..e06aadef531 100644 --- a/htdocs/langs/en_US/contracts.lang +++ b/htdocs/langs/en_US/contracts.lang @@ -27,7 +27,7 @@ MenuRunningServices=Running services MenuExpiredServices=Expired services MenuClosedServices=Closed services NewContract=New contract -AddContract=Add contract +AddContract=Create contract SearchAContract=Search a contract DeleteAContract=Delete a contract CloseAContract=Close a contract diff --git a/htdocs/langs/en_US/donations.lang b/htdocs/langs/en_US/donations.lang index 66ddea95a5c..85dfdd8ff4d 100644 --- a/htdocs/langs/en_US/donations.lang +++ b/htdocs/langs/en_US/donations.lang @@ -4,7 +4,7 @@ Donations=Donations DonationRef=Donation ref. Donor=Donor Donors=Donors -AddDonation=Add a donation +AddDonation=Create a donation NewDonation=New donation ShowDonation=Show donation DonationPromise=Gift promise diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang index 17641a0ab3e..70fcbf7f22d 100644 --- a/htdocs/langs/en_US/interventions.lang +++ b/htdocs/langs/en_US/interventions.lang @@ -3,7 +3,7 @@ Intervention=Intervention Interventions=Interventions InterventionCard=Intervention card NewIntervention=New intervention -AddIntervention=Add intervention +AddIntervention=Create intervention ListOfInterventions=List of interventions EditIntervention=Edit intervention ActionsOnFicheInter=Actions on intervention diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index fd17000a8e0..b789f2f8423 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -85,7 +85,7 @@ SubscriptionLateShort=Late SubscriptionNotReceivedShort=Never received ListOfSubscriptions=List of subscriptions SendCardByMail=Send card by Email -AddMember=Add member +AddMember=Create member NoTypeDefinedGoToSetup=No member types defined. Go to menu "Members types" NewMemberType=New member type WelcomeEMail=Welcome e-mail @@ -125,7 +125,7 @@ Date=Date DateAndTime=Date and time PublicMemberCard=Member public card MemberNotOrNoMoreExpectedToSubscribe=Member not or no more expected to subscribe -AddSubscription=Add subscription +AddSubscription=Create subscription ShowSubscription=Show subscription MemberModifiedInDolibarr=Member modified in Dolibarr SendAnEMailToMember=Send information email to member diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index d50f8615dc8..76986b67621 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -65,7 +65,7 @@ ValidateOrder=Validate order UnvalidateOrder=Unvalidate order DeleteOrder=Delete order CancelOrder=Cancel order -AddOrder=Add order +AddOrder=Create order AddToMyOrders=Add to my orders AddToOtherOrders=Add to other orders AddToDraftOrders=Add to draft order diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 6758b2b482e..10e4403f4fb 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -1,7 +1,6 @@ # Dolibarr language file - Source file is en_US - other SecurityCode=Security code Calendar=Calendar -AddTrip=Add trip Tools=Tools ToolsDesc=This area is dedicated to group miscellaneous tools not available into other menu entries.

Those tools can be reached from menu on the side. Birthday=Birthday diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index d5b1db83495..b38bcd150a9 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -117,12 +117,12 @@ ServiceLimitedDuration=If product is a service with limited duration: MultiPricesAbility=Several level of prices per product/service MultiPricesNumPrices=Number of prices MultiPriceLevelsName=Price categories -AssociatedProductsAbility=Activate the virtual products feature -AssociatedProducts=Virtual product -AssociatedProductsNumber=Number of products composing this virtual product -ParentProductsNumber=Number of parent virtual product -IfZeroItIsNotAVirtualProduct=If 0, this product is not a virtual product -IfZeroItIsNotUsedByVirtualProduct=If 0, this product is not used by any virtual product +AssociatedProductsAbility=Activate the virtual package feature +AssociatedProducts=Package product +AssociatedProductsNumber=Number of products composing this virtual package product +ParentProductsNumber=Number of parent packaging product +IfZeroItIsNotAVirtualProduct=If 0, this product is not a virtual package product +IfZeroItIsNotUsedByVirtualProduct=If 0, this product is not used by any virtual package product EditAssociate=Associate Translation=Translation KeywordFilter=Keyword filter @@ -132,7 +132,7 @@ AddDel=Add/Delete Quantity=Quantity NoMatchFound=No match found ProductAssociationList=List of related products/services: name of product/service (quantity affected) -ProductParentList=List of virtual products/services with this product as a component +ProductParentList=List of package products/services with this product as a component ErrorAssociationIsFatherOfThis=One of selected product is parent with current product DeleteProduct=Delete a product/service ConfirmDeleteProduct=Are you sure you want to delete this product/service? @@ -179,7 +179,7 @@ CloneProduct=Clone product or service ConfirmCloneProduct=Are you sure you want to clone product or service %s ? CloneContentProduct=Clone all main informations of product/service ClonePricesProduct=Clone main informations and prices -CloneCompositionProduct=Clone virtual product/services +CloneCompositionProduct=Clone packaged product/services ProductIsUsed=This product is used NewRefForClone=Ref. of new product/service CustomerPrices=Customers prices diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 3e1ecea0be4..32b7d57e9b0 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -14,7 +14,7 @@ TasksDesc=This view presents all projects and tasks (your user permissions grant Myprojects=My projects ProjectsArea=Projects area NewProject=New project -AddProject=Add project +AddProject=Create project DeleteAProject=Delete a project DeleteATask=Delete a task ConfirmDeleteAProject=Are you sure you want to delete this project ? @@ -45,7 +45,7 @@ TaskDateStart=Task start date TaskDateEnd=Task end date TaskDescription=Task description NewTask=New task -AddTask=Add task +AddTask=Create task AddDuration=Add duration Activity=Activity Activities=Tasks/activities diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang index 8970d1eb2df..b10f0db3fd4 100644 --- a/htdocs/langs/en_US/propal.lang +++ b/htdocs/langs/en_US/propal.lang @@ -16,7 +16,7 @@ Prospect=Prospect ProspectList=Prospect list DeleteProp=Delete commercial proposal ValidateProp=Validate commercial proposal -AddProp=Add proposal +AddProp=Create proposal ConfirmDeleteProp=Are you sure you want to delete this commercial proposal ? ConfirmValidateProp=Are you sure you want to validate this commercial proposal under name %s ? LastPropals=Last %s proposals diff --git a/htdocs/langs/en_US/resource.lang b/htdocs/langs/en_US/resource.lang index 502d328d7c3..fbc55081185 100755 --- a/htdocs/langs/en_US/resource.lang +++ b/htdocs/langs/en_US/resource.lang @@ -10,7 +10,7 @@ NoResourceLinked=No resource linked ResourcePageIndex=Resources list ResourceSingular=Resource ResourceCard=Resource card -AddResource=Add a resource +AddResource=Create a resource ResourceFormLabel_ref=Resource name ResourceType=Resource type ResourceFormLabel_description=Resource description diff --git a/htdocs/langs/en_US/suppliers.lang b/htdocs/langs/en_US/suppliers.lang index 50502c15c7e..ca3a81639bf 100644 --- a/htdocs/langs/en_US/suppliers.lang +++ b/htdocs/langs/en_US/suppliers.lang @@ -1,7 +1,7 @@ # Dolibarr language file - Source file is en_US - suppliers Suppliers=Suppliers Supplier=Supplier -AddSupplier=Add a supplier +AddSupplier=Create a supplier SupplierRemoved=Supplier removed SuppliersInvoice=Suppliers invoice NewSupplier=New supplier diff --git a/htdocs/langs/en_US/trips.lang b/htdocs/langs/en_US/trips.lang index 1759ca8e174..64adbeb0dd6 100644 --- a/htdocs/langs/en_US/trips.lang +++ b/htdocs/langs/en_US/trips.lang @@ -4,7 +4,7 @@ Trips=Trips TripsAndExpenses=Trips and expenses TripsAndExpensesStatistics=Trips and expenses statistics TripCard=Trip card -AddTrip=Add trip +AddTrip=Create trip ListOfTrips=List of trips ListOfFees=List of fees NewTrip=New trip diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index 495cb3981c6..c13e3e767bb 100644 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -119,4 +119,5 @@ HierarchicView=Hierarchical view UseTypeFieldToChange=Use field Type to change OpenIDURL=OpenID URL LoginUsingOpenID=Use OpenID to login -WeeklyHours=Weekly hours \ No newline at end of file +WeeklyHours=Weekly hours +ColorUser=Color of the user \ No newline at end of file diff --git a/htdocs/langs/es_ES/main.lang b/htdocs/langs/es_ES/main.lang index d92caea7ab2..a9f20e07d72 100644 --- a/htdocs/langs/es_ES/main.lang +++ b/htdocs/langs/es_ES/main.lang @@ -266,6 +266,7 @@ Afternoon=Tarde Quadri=Trimestre MonthOfDay=Mes del día HourShort=H +MinuteShort=min Rate=Tipo UseLocalTax=Incluir tasas Bytes=Bytes @@ -679,7 +680,7 @@ ViewPrivateNote=Ver notas XMoreLines=%s línea(s) ocultas PublicUrl=URL pública AddBox=Añadir caja - +SelectElementAndClickRefresh=Seleccione un elemento y haga clic en Refrescar # Week day Monday=Lunes Tuesday=Martes diff --git a/htdocs/product/card.php b/htdocs/product/card.php index a9f533ba40b..5644e41df1c 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1420,12 +1420,20 @@ else // Status (to sell) print ''.$langs->trans("Status").' ('.$langs->trans("Sell").')'; - print $object->getLibStatut(2,0); + if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { + print ajax_productonoff($object->id, 'status'); + } else { + print $object->getLibStatut(2,0); + } print ''; // Status (to buy) print ''.$langs->trans("Status").' ('.$langs->trans("Buy").')'; - print $object->getLibStatut(2,1); + if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { + print ajax_productonoff($object->id, 'status_buy'); + } else { + print $object->getLibStatut(2,1); + } print ''; // Batch number management (to batch) diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 3e18cc5d042..45f90823747 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -173,7 +173,7 @@ if (! empty($conf->categorie->enabled)) print '
'; print ''; print ''; - print ''; - // Date start - print ''; - - // Date end - print ''; - - // Planned workload - print ''; - - // Progress declared - print ''; - - // Progress calculated + // Date start + print ''; + + // Date end + print ''; + + // Planned workload + print ''; + + // Progress declared + print ''; + + // Progress calculated print ''; - + else print ''; + print ''; + // Project if (empty($withproject)) { diff --git a/htdocs/resource/add.php b/htdocs/resource/add.php old mode 100755 new mode 100644 diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php old mode 100755 new mode 100644 diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 0aa9f0e5979..f89212e5fbc 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -494,10 +494,10 @@ if ($sql_select) } else if (empty($type_element) || $type_element == -1) { - print ''; + print ''; } else { - print ''; + print ''; } print "
'.$langs->trans("Categories").'
'; + print '
'; $sql = "SELECT c.label, count(*) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie_product as cs"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid"; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 13b1e48f477..676b17a5951 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -292,37 +292,37 @@ if ($id > 0 || ! empty($ref)) // Label print '
'.$langs->trans("Label").''.$object->label.'
'.$langs->trans("DateStart").''; - print dol_print_date($object->date_start,'dayhour'); - print '
'.$langs->trans("DateEnd").''; - print dol_print_date($object->date_end,'dayhour'); - print '
'.$langs->trans("PlannedWorkload").''; - print convertSecondToTime($object->planned_workload,'allhourmin'); - print '
'.$langs->trans("ProgressDeclared").''; - print $object->progress.' %'; - print '
'.$langs->trans("DateStart").''; + print dol_print_date($object->date_start,'dayhour'); + print '
'.$langs->trans("DateEnd").''; + print dol_print_date($object->date_end,'dayhour'); + print '
'.$langs->trans("PlannedWorkload").''; + print convertSecondToTime($object->planned_workload,'allhourmin'); + print '
'.$langs->trans("ProgressDeclared").''; + print $object->progress.' %'; + print '
'.$langs->trans("ProgressCalculated").''; if ($object->planned_workload) { - $tmparray=$object->getSummaryOfTimeSpent(); + $tmparray=$object->getSummaryOfTimeSpent(); if ($tmparray['total_duration'] > 0) print round($tmparray['total_duration']/$object->planned_workload*100, 2).' %'; else print '0 %'; } - else print ''; - print '
'.$langs->trans("SelectElementAndClickRefresh").'
'.$langs->trans("SelectElementAndClickRefresh").'
'.$langs->trans("FeatureNotYetAvailable").'
'.$langs->trans("FeatureNotYetAvailable").'
"; diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 740a6157809..243b55f01ca 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -183,7 +183,7 @@ if (! empty($conf->categorie->enabled)) print '
'; print ''; print ''; - print ''; - + if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { print ''; } - + if ($object->client) { print ''; } - + if ($object->fournisseur) { print '
'.$langs->trans("Categories").'
'; + print '
'; $sql = "SELECT c.label, count(*) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie_societe as cs"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid"; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index e9e79d52130..a0b9bda1c8e 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -136,48 +136,48 @@ if (empty($reshook)) { $object->particulier = GETPOST("private"); - $object->name = dolGetFirstLastname(GETPOST('firstname','san_alpha'),GETPOST('nom','san_alpha')?GETPOST('nom','san_alpha'):GETPOST('name','san_alpha')); + $object->name = dolGetFirstLastname(GETPOST('firstname','alpha'),GETPOST('nom','alpha')?GETPOST('nom','alpha'):GETPOST('name','alpha')); $object->civility_id = GETPOST('civility_id', 'int'); // Add non official properties - $object->name_bis = GETPOST('name','san_alpha')?GETPOST('name','san_alpha'):GETPOST('nom','san_alpha'); - $object->firstname = GETPOST('firstname','san_alpha'); + $object->name_bis = GETPOST('name','alpha')?GETPOST('name','alpha'):GETPOST('nom','alpha'); + $object->firstname = GETPOST('firstname','alpha'); } else { - $object->name = GETPOST('name', 'san_alpha')?GETPOST('name', 'san_alpha'):GETPOST('nom', 'san_alpha'); + $object->name = GETPOST('name', 'alpha')?GETPOST('name', 'alpha'):GETPOST('nom', 'alpha'); } - $object->address = GETPOST('address', 'san_alpha'); - $object->zip = GETPOST('zipcode', 'san_alpha'); - $object->town = GETPOST('town', 'san_alpha'); + $object->address = GETPOST('address', 'alpha'); + $object->zip = GETPOST('zipcode', 'alpha'); + $object->town = GETPOST('town', 'alpha'); $object->country_id = GETPOST('country_id', 'int'); $object->state_id = GETPOST('state_id', 'int'); - $object->skype = GETPOST('skype', 'san_alpha'); - $object->phone = GETPOST('phone', 'san_alpha'); - $object->fax = GETPOST('fax','san_alpha'); + $object->skype = GETPOST('skype', 'alpha'); + $object->phone = GETPOST('phone', 'alpha'); + $object->fax = GETPOST('fax','alpha'); $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); - $object->idprof1 = GETPOST('idprof1', 'san_alpha'); - $object->idprof2 = GETPOST('idprof2', 'san_alpha'); - $object->idprof3 = GETPOST('idprof3', 'san_alpha'); - $object->idprof4 = GETPOST('idprof4', 'san_alpha'); - $object->idprof5 = GETPOST('idprof5', 'san_alpha'); - $object->idprof6 = GETPOST('idprof6', 'san_alpha'); - $object->prefix_comm = GETPOST('prefix_comm', 'san_alpha'); - $object->code_client = GETPOST('code_client', 'san_alpha'); - $object->code_fournisseur = GETPOST('code_fournisseur', 'san_alpha'); - $object->capital = GETPOST('capital', 'san_alpha'); - $object->barcode = GETPOST('barcode', 'san_alpha'); + $object->idprof1 = GETPOST('idprof1', 'alpha'); + $object->idprof2 = GETPOST('idprof2', 'alpha'); + $object->idprof3 = GETPOST('idprof3', 'alpha'); + $object->idprof4 = GETPOST('idprof4', 'alpha'); + $object->idprof5 = GETPOST('idprof5', 'alpha'); + $object->idprof6 = GETPOST('idprof6', 'alpha'); + $object->prefix_comm = GETPOST('prefix_comm', 'alpha'); + $object->code_client = GETPOST('code_client', 'alpha'); + $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha'); + $object->capital = GETPOST('capital', 'alpha'); + $object->barcode = GETPOST('barcode', 'alpha'); - $object->tva_intra = GETPOST('tva_intra', 'san_alpha'); - $object->tva_assuj = GETPOST('assujtva_value', 'san_alpha'); - $object->status = GETPOST('status', 'san_alpha'); + $object->tva_intra = GETPOST('tva_intra', 'alpha'); + $object->tva_assuj = GETPOST('assujtva_value', 'alpha'); + $object->status = GETPOST('status', 'alpha'); // Local Taxes - $object->localtax1_assuj = GETPOST('localtax1assuj_value', 'san_alpha'); - $object->localtax2_assuj = GETPOST('localtax2assuj_value', 'san_alpha'); + $object->localtax1_assuj = GETPOST('localtax1assuj_value', 'alpha'); + $object->localtax2_assuj = GETPOST('localtax2assuj_value', 'alpha'); - $object->localtax1_value = GETPOST('lt1', 'san_alpha'); - $object->localtax2_value = GETPOST('lt2', 'san_alpha'); + $object->localtax1_value = GETPOST('lt1', 'alpha'); + $object->localtax2_value = GETPOST('lt2', 'alpha'); $object->forme_juridique_code = GETPOST('forme_juridique_code', 'int'); $object->effectif_id = GETPOST('effectif_id', 'int'); @@ -446,7 +446,6 @@ if (empty($reshook)) $sql = "UPDATE ".MAIN_DB_PREFIX."adherent"; $sql.= " SET fk_soc = NULL WHERE fk_soc = " . $id; - dol_syslog(get_class($object)."::delete", LOG_DEBUG); if (! $object->db->query($sql)) { $error++; @@ -528,7 +527,7 @@ if (empty($reshook)) // Define output language $outputlangs = $langs; $newlang=''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$fac->client->default_lang; if (! empty($newlang)) { @@ -638,31 +637,31 @@ else if (GETPOST("type")=='p') { $object->client=2; } if (! empty($conf->fournisseur->enabled) && (GETPOST("type")=='f' || GETPOST("type")=='')) { $object->fournisseur=1; } - $object->name = GETPOST('nom', 'san_alpha'); - $object->firstname = GETPOST('firstname', 'san_alpha'); + $object->name = GETPOST('nom', 'alpha'); + $object->firstname = GETPOST('firstname', 'alpha'); $object->particulier = $private; $object->prefix_comm = GETPOST('prefix_comm'); $object->client = GETPOST('client')?GETPOST('client'):$object->client; - $object->code_client = GETPOST('code_client', 'san_alpha'); + $object->code_client = GETPOST('code_client', 'alpha'); $object->fournisseur = GETPOST('fournisseur')?GETPOST('fournisseur'):$object->fournisseur; - $object->code_fournisseur = GETPOST('code_fournisseur', 'san_alpha'); - $object->address = GETPOST('address', 'san_alpha'); - $object->zip = GETPOST('zipcode', 'san_alpha'); - $object->town = GETPOST('town', 'san_alpha'); + $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha'); + $object->address = GETPOST('address', 'alpha'); + $object->zip = GETPOST('zipcode', 'alpha'); + $object->town = GETPOST('town', 'alpha'); $object->state_id = GETPOST('state_id', 'int'); - $object->skype = GETPOST('skype', 'san_alpha'); - $object->phone = GETPOST('phone', 'san_alpha'); - $object->fax = GETPOST('fax', 'san_alpha'); + $object->skype = GETPOST('skype', 'alpha'); + $object->phone = GETPOST('phone', 'alpha'); + $object->fax = GETPOST('fax', 'alpha'); $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); $object->capital = GETPOST('capital', 'int'); - $object->barcode = GETPOST('barcode', 'san_alpha'); - $object->idprof1 = GETPOST('idprof1', 'san_alpha'); - $object->idprof2 = GETPOST('idprof2', 'san_alpha'); - $object->idprof3 = GETPOST('idprof3', 'san_alpha'); - $object->idprof4 = GETPOST('idprof4', 'san_alpha'); - $object->idprof5 = GETPOST('idprof5', 'san_alpha'); - $object->idprof6 = GETPOST('idprof6', 'san_alpha'); + $object->barcode = GETPOST('barcode', 'alpha'); + $object->idprof1 = GETPOST('idprof1', 'alpha'); + $object->idprof2 = GETPOST('idprof2', 'alpha'); + $object->idprof3 = GETPOST('idprof3', 'alpha'); + $object->idprof4 = GETPOST('idprof4', 'alpha'); + $object->idprof5 = GETPOST('idprof5', 'alpha'); + $object->idprof6 = GETPOST('idprof6', 'alpha'); $object->typent_id = GETPOST('typent_id', 'int'); $object->effectif_id = GETPOST('effectif_id', 'int'); $object->civility_id = GETPOST('civility_id', 'int'); @@ -677,7 +676,7 @@ else $object->localtax1_value =GETPOST('lt1', 'int'); $object->localtax2_value =GETPOST('lt2', 'int'); - $object->tva_intra = GETPOST('tva_intra', 'san_alpha'); + $object->tva_intra = GETPOST('tva_intra', 'alpha'); $object->commercial_id = GETPOST('commercial_id', 'int'); $object->default_lang = GETPOST('default_lang'); @@ -1147,37 +1146,37 @@ else if (GETPOST('nom')) { // We overwrite with values if posted - $object->name = GETPOST('nom', 'san_alpha'); - $object->prefix_comm = GETPOST('prefix_comm', 'san_alpha'); + $object->name = GETPOST('nom', 'alpha'); + $object->prefix_comm = GETPOST('prefix_comm', 'alpha'); $object->client = GETPOST('client', 'int'); - $object->code_client = GETPOST('code_client', 'san_alpha'); + $object->code_client = GETPOST('code_client', 'alpha'); $object->fournisseur = GETPOST('fournisseur', 'int'); - $object->code_fournisseur = GETPOST('code_fournisseur', 'san_alpha'); - $object->address = GETPOST('address', 'san_alpha'); - $object->zip = GETPOST('zipcode', 'san_alpha'); - $object->town = GETPOST('town', 'san_alpha'); + $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha'); + $object->address = GETPOST('address', 'alpha'); + $object->zip = GETPOST('zipcode', 'alpha'); + $object->town = GETPOST('town', 'alpha'); $object->country_id = GETPOST('country_id')?GETPOST('country_id', 'int'):$mysoc->country_id; $object->state_id = GETPOST('state_id', 'int'); - $object->skype = GETPOST('skype', 'san_alpha'); - $object->phone = GETPOST('phone', 'san_alpha'); - $object->fax = GETPOST('fax', 'san_alpha'); + $object->skype = GETPOST('skype', 'alpha'); + $object->phone = GETPOST('phone', 'alpha'); + $object->fax = GETPOST('fax', 'alpha'); $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); $object->capital = GETPOST('capital', 'int'); - $object->idprof1 = GETPOST('idprof1', 'san_alpha'); - $object->idprof2 = GETPOST('idprof2', 'san_alpha'); - $object->idprof3 = GETPOST('idprof3', 'san_alpha'); - $object->idprof4 = GETPOST('idprof4', 'san_alpha'); - $object->idprof5 = GETPOST('idprof5', 'san_alpha'); - $object->idprof6 = GETPOST('idprof6', 'san_alpha'); + $object->idprof1 = GETPOST('idprof1', 'alpha'); + $object->idprof2 = GETPOST('idprof2', 'alpha'); + $object->idprof3 = GETPOST('idprof3', 'alpha'); + $object->idprof4 = GETPOST('idprof4', 'alpha'); + $object->idprof5 = GETPOST('idprof5', 'alpha'); + $object->idprof6 = GETPOST('idprof6', 'alpha'); $object->typent_id = GETPOST('typent_id', 'int'); $object->effectif_id = GETPOST('effectif_id', 'int'); - $object->barcode = GETPOST('barcode', 'san_alpha'); + $object->barcode = GETPOST('barcode', 'alpha'); $object->forme_juridique_code = GETPOST('forme_juridique_code', 'int'); - $object->default_lang = GETPOST('default_lang', 'san_alpha'); + $object->default_lang = GETPOST('default_lang', 'alpha'); $object->tva_assuj = GETPOST('assujtva_value', 'int'); - $object->tva_intra = GETPOST('tva_intra', 'san_alpha'); + $object->tva_intra = GETPOST('tva_intra', 'alpha'); $object->status = GETPOST('status', 'int'); //Local Taxes diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index 9e82e1a052f..7a2274e81b5 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; $langs->load("orders"); $langs->load("companies"); -$id=GETPOST('id','int'); +$id=GETPOST('id','int')?GETPOST('id','int'):GETPOST('socid','int'); $ref=GETPOST('ref','alpha'); $action=GETPOST('action','alpha'); @@ -44,8 +44,9 @@ $result = restrictedArea($user, 'societe', $id,''); $object = new Societe($db); + /* - * Ajout d'un nouveau contact + * Actions */ if ($action == 'addcontact' && $user->rights->societe->creer) @@ -133,12 +134,9 @@ $userstatic=new User($db); /* Mode vue et edition */ /* */ /* *************************************************************************** */ -dol_htmloutput_mesg($mesg); if ($id > 0 || ! empty($ref)) { - $langs->trans("OrderCard"); - if ($object->fetch($id, $ref) > 0) { $soc = new Societe($db); @@ -154,12 +152,12 @@ if ($id > 0 || ! empty($ref)) print ''; print $form->showrefnav($object,'id','',($user->societe_id?0:1),'rowid','nom'); print '
'.$langs->trans('Prefix').''.$object->prefix_comm.'
'; @@ -168,7 +166,7 @@ if ($id > 0 || ! empty($ref)) if ($object->check_codeclient() <> 0) print ' ('.$langs->trans("WrongCustomerCode").')'; print '
'; @@ -216,7 +214,7 @@ if ($id > 0 || ! empty($ref)) { $titre=$langs->trans("MembersListOfTiers"); print '
'; - + print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,''); print ""; @@ -230,13 +228,13 @@ if ($id > 0 || ! empty($ref)) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"d.statut,d.datefin",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("EndSubscription"),$_SERVER["PHP_SELF"],"d.datefin",$param,"",'align="center"',$sortfield,$sortorder); print "\n"; - + $var=True; $i=0; while ($i < $num && $i < $conf->liste_limit) { $objp = $db->fetch_object($resql); - + $datefin=$db->jdate($objp->datefin); $memberstatic->id=$objp->rowid; $memberstatic->ref=$objp->rowid; @@ -244,43 +242,43 @@ if ($id > 0 || ! empty($ref)) $memberstatic->firstname=$objp->firstname; $companyname=$objp->company; - + $var=!$var; print ""; - + // Ref print "\n"; - + // Lastname print "\n"; - + // Login print "\n"; - + // Type $membertypestatic->id=$objp->type_id; $membertypestatic->libelle=$objp->type; print ''; - + // Moral/Physique print "\n"; - + // EMail print "\n"; - + // Statut print '"; - + // End of subscription date if ($datefin) { @@ -303,7 +301,7 @@ if ($id > 0 || ! empty($ref)) } print ''; } - + print "\n"; $i++; } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 34a653b61ea..66de6a9be12 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1325,7 +1325,8 @@ div.tabs { /* margin: 0px 0px 2px 6px; padding: 0px 6px 3px 0px; */ text-align: ; - margin-left: 4px !important; + margin-left: 6px !important; + margin-right: 6px !important; clear:both; height:100%; } @@ -1655,7 +1656,7 @@ table.border, table.dataTable, .table-border, .table-border-col, .table-key-bord } table.border td, div.border div div.tagtd { - padding: 1px 2px 1px 2px; + padding: 2px 2px 2px 2px; border: 1px solid #D0D0D0; border-collapse: collapse; } diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php index 4109e7ab9a4..1993f12bd5c 100644 --- a/htdocs/user/agenda_extsites.php +++ b/htdocs/user/agenda_extsites.php @@ -46,7 +46,7 @@ $actionsave=GETPOST('save','alpha'); if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5; $MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB; -// List of aviable colors +// List of available colors $colorlist=array('BECEDD','DDBECE','BFDDBE','F598B4','F68654','CBF654','A4A4A5'); // Security check diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 01b6ec32f52..4e17875f1ed 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -36,6 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +if (! empty($conf->agenda->enabled))require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; if (! empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php'; if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; if (! empty($conf->multicompany->enabled)) dol_include_once('/multicompany/class/actions_multicompany.class.php'); @@ -154,7 +155,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $candisableuser) } } -// Action ajout user +// Action Add user if ($action == 'add' && $canadduser) { $error = 0; @@ -205,6 +206,8 @@ if ($action == 'add' && $canadduser) $object->salary = GETPOST("salary")!=''?GETPOST("salary"):''; $object->salaryextra = GETPOST("salaryextra")!=''?GETPOST("salaryextra"):''; $object->weeklyhours = GETPOST("weeklyhours")!=''?GETPOST("weeklyhours"):''; + + $object->color = GETPOST("color")!=''?GETPOST("color"):''; // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); @@ -258,7 +261,7 @@ if ($action == 'add' && $canadduser) } } -// Action ajout groupe utilisateur +// Action add usergroup if (($action == 'addgroup' || $action == 'removegroup') && $caneditfield) { if ($group) @@ -350,6 +353,8 @@ if ($action == 'update' && ! $_POST["cancel"]) $object->salary = GETPOST("salary")!=''?GETPOST("salary"):''; $object->salaryextra = GETPOST("salaryextra")!=''?GETPOST("salaryextra"):''; $object->weeklyhours = GETPOST("weeklyhours")!=''?GETPOST("weeklyhours"):''; + + $object->color = GETPOST("color")!=''?GETPOST("color"):''; // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); @@ -589,6 +594,7 @@ if ($action == 'adduserldap') */ $form = new Form($db); +$formother=new FormOther($db); llxHeader('',$langs->trans("UserCard")); @@ -670,7 +676,7 @@ if (($action == 'create') || ($action == 'adduserldap')) setEventMessage($ldap->error, 'errors'); } - // Si la liste des users est rempli, on affiche la liste deroulante + // If user list is full, we show drop-down list print "\n\n\n"; print ''; @@ -767,7 +773,7 @@ if (($action == 'create') || ($action == 'adduserldap')) } $password=$generated_password; - // Mot de passe + // Password print ''; print ''; - // Administrateur + // Administrator if (! empty($user->admin)) { print ''; @@ -974,6 +980,15 @@ if (($action == 'create') || ($action == 'adduserldap')) print ''; print ''; print "\n"; + + // User color + if (! empty($conf->agenda->enabled)) + { + print ''; + print ''; + } // Note print '
"; print $memberstatic->getNomUrl(1); print "rowid\">"; print ((! empty($objp->lastname) || ! empty($objp->firstname)) ? dol_trunc($memberstatic->getFullName($langs)) : ''); print (((! empty($objp->lastname) || ! empty($objp->firstname)) && ! empty($companyname)) ? ' / ' : ''); print (! empty($companyname) ? dol_trunc($companyname, 32) : ''); print "".$objp->login."'; print $membertypestatic->getNomUrl(1,32); print '".$memberstatic->getmorphylib($objp->morphy)."".dol_print_email($objp->email,0,0,1)."'; print $memberstatic->LibStatut($objp->statut,$objp->cotisation,$datefin,2); print "
'.$langs->trans("Password").''; if (! empty($ldap_sid)) @@ -789,7 +795,7 @@ if (($action == 'create') || ($action == 'adduserldap')) } print '
'.$langs->trans("Administrator").'
'.$langs->trans("ColorUser").''; + print $formother->selectColor(GETPOST('color')?GETPOST('color'):$object->color, 'color', 'usercolorconfig', 1, '', 'hideifnotset'); + print '
'; @@ -1002,7 +1017,7 @@ else { /* ************************************************************************** */ /* */ - /* Visu et edition */ + /* View and edition */ /* */ /* ************************************************************************** */ @@ -1032,7 +1047,7 @@ else $userDisabled = 0; $statutUACF = ''; - //On verifie les options du compte + // Check options of user account if (count($ldap->uacf) > 0) { foreach ($ldap->uacf as $key => $statut) @@ -1080,7 +1095,7 @@ else } /* - * Confirmation desactivation + * Confirm deactivation */ if ($action == 'disable') { @@ -1088,7 +1103,7 @@ else } /* - * Confirmation activation + * Confirm activation */ if ($action == 'enable') { @@ -1108,13 +1123,13 @@ else */ if ($action != 'edit') { - $rowspan=16; - + $rowspan=17; + print ''; // Ref print ''; - print ''; print ''."\n"; @@ -1123,10 +1138,12 @@ else if (! empty($conf->societe->enabled)) $rowspan++; if (! empty($conf->adherent->enabled)) $rowspan++; if (! empty($conf->skype->enabled)) $rowspan++; + if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) $rowspan = $rowspan+3; + if (! empty($conf->agenda->enabled)) $rowspan++; // Lastname print ''; - print ''; + print ''; // Photo print ''; - print ''; + print ''; print ''."\n"; // Position/Job print ''; - print ''; + print ''; print ''."\n"; // Login print ''; if (! empty($object->ldap_sid) && $object->statut==0) { - print ''; + print ''; } else { - print ''; + print ''; } print ''."\n"; @@ -1163,24 +1180,24 @@ else { if ($passDoNotExpire) { - print ''; + print ''; } else if($userChangePassNextLogon) { - print ''; + print ''; } else if($userDisabled) { - print ''; + print ''; } else { - print ''; + print ''; } } else { - print ''."\n"; // Administrator - print ''."\n"; // Type - print ''."\n"; } // Tel pro print ''; - print ''; + print ''; print ''."\n"; // Tel mobile print ''; - print ''; + print ''; print ''."\n"; // Fax print ''; - print ''; + print ''; print ''."\n"; // Skype if (! empty($conf->skype->enabled)) { - print ''; - print ''; + print ''; + print ''; print "\n"; } // EMail print ''; - print ''; + print ''; print "\n"; // Signature - print '\n"; // Hierarchy print ''; - print ''; print "\n"; - if ($conf->salaries->enabled && ! empty($user->rights->salaries->read)) + if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) { $langs->load("salaries"); // THM print ''; - print ''; print "\n"; // TJM print ''; - print ''; print "\n"; // Salary print ''; - print ''; print "\n"; @@ -1296,7 +1313,7 @@ else // Weeklyhours print ''; - print ''; print "\n"; @@ -1306,28 +1323,39 @@ else { $rowspan++; print ''; - print ''; + print ''; + } + + // Color user + if (! empty($conf->agenda->enabled)) + { + print ''; + print ''; + print ''; + print "\n"; } // Status print ''; - print ''; print ''."\n"; print ''; - print ''; + print ''; print "\n"; print ''; - print ''; + print ''; print "\n"; if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) { print ''; - print ''; + print ''; print "\n"; } @@ -1335,7 +1363,7 @@ else if (! empty($conf->societe->enabled)) { print ''; - print ''; - print ''; @@ -1957,7 +1988,7 @@ else print ''; print "\n"; - if ($conf->salaries->enabled && ! empty($user->rights->salaries->read)) + if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) { $langs->load("salaries"); @@ -2008,6 +2039,15 @@ else print ''; print ""; } + + // User color + if (! empty($conf->agenda->enabled)) + { + print ''; + print ''; + } // Status print ''; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 4afd650f4ae..91f85d4cb0b 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -51,7 +51,7 @@ class User extends CommonObject var $firstname; var $note; var $email; - var $skype; + var $skype; var $job; var $signature; var $office_phone; @@ -101,13 +101,14 @@ class User extends CommonObject var $users; // To store all tree of users hierarchy var $parentof; // To store an array of all parents for all ids. - var $accountancy_code; // Accountancy code in prevision of the complete accountancy module - var $thm; // Average cost of employee - var $tjm; // Average cost of employee - var $salary; // Monthly salary - var $salaryextra; // Monthly salary extra - var $weeklyhours; // Weekly hours + var $accountancy_code; // Accountancy code in prevision of the complete accountancy module + var $thm; // Average cost of employee + var $tjm; // Average cost of employee + var $salary; // Monthly salary + var $salaryextra; // Monthly salary extra + var $weeklyhours; // Weekly hours + var $color; // Define background color for user in agenda /** * Constructor de la classe @@ -166,6 +167,7 @@ class User extends CommonObject $sql.= " u.salary,"; $sql.= " u.salaryextra,"; $sql.= " u.weeklyhours,"; + $sql.= " u.color,"; $sql.= " u.ref_int, u.ref_ext"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; @@ -233,6 +235,7 @@ class User extends CommonObject $this->salary = $obj->salary; $this->salaryextra = $obj->salaryextra; $this->weeklyhours = $obj->weeklyhours; + $this->color = $obj->color; $this->datec = $this->db->jdate($obj->datec); $this->datem = $this->db->jdate($obj->datem); @@ -270,7 +273,7 @@ class User extends CommonObject return -1; } - // Recupere parametrage global propre a l'utilisateur + // To get back the global configuration unique to the user if ($loadpersonalconf) { $sql = "SELECT param, value FROM ".MAIN_DB_PREFIX."user_param"; @@ -302,7 +305,7 @@ class User extends CommonObject } /** - * Ajoute un droit a l'utilisateur + * Add a right to the user * * @param int $rid id du droit a ajouter * @param string $allmodule Ajouter tous les droits du module allmodule @@ -404,7 +407,7 @@ class User extends CommonObject /** - * Retire un droit a l'utilisateur + * Remove a right to the user * * @param int $rid Id du droit a retirer * @param string $allmodule Retirer tous les droits du module allmodule @@ -672,7 +675,7 @@ class User extends CommonObject $this->db->begin(); - // Desactive utilisateur + // Deactivate user $sql = "UPDATE ".MAIN_DB_PREFIX."user"; $sql.= " SET statut = ".$this->statut; $sql.= " WHERE rowid = ".$this->id; @@ -717,7 +720,7 @@ class User extends CommonObject dol_syslog(get_class($this)."::delete", LOG_DEBUG); - // Supprime droits + // Remove rights $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_rights WHERE fk_user = ".$this->id; if (! $error && ! $this->db->query($sql)) @@ -734,7 +737,7 @@ class User extends CommonObject $this->error = $this->db->lasterror(); } - // Si contact, supprime lien + // If contact, remove link if ($this->contact_id) { $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET fk_user_creat = null WHERE rowid = ".$this->contact_id; @@ -1063,7 +1066,7 @@ class User extends CommonObject } /** - * Affectation des permissions par defaut + * Assign rights by default * * @return Si erreur <0, si ok renvoi le nbre de droits par defaut positionnes */ @@ -1142,6 +1145,7 @@ class User extends CommonObject $this->zip = empty($this->zip)?'':$this->zip; $this->town = empty($this->town)?'':$this->town; $this->accountancy_code = trim($this->accountancy_code); + $this->color = empty($this->color)?'':$this->color; // Check parameters if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email)) @@ -1150,7 +1154,7 @@ class User extends CommonObject $this->error = $langs->trans("ErrorBadEMail",$this->email); return -1; } - + $this->db->begin(); // Mise a jour autres infos @@ -1172,6 +1176,7 @@ class User extends CommonObject $sql.= ", job = '".$this->db->escape($this->job)."'"; $sql.= ", signature = '".$this->db->escape($this->signature)."'"; $sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'"; + $sql.= ", color = '".$this->db->escape($this->color)."'"; $sql.= ", note = '".$this->db->escape($this->note)."'"; $sql.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null"); $sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null"); diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index 8916ff011ed..9903c6b4ed9 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -664,6 +664,8 @@ function createOrder($authentication,$order) $newline->total_ht=$line['total_net']; $newline->total_tva=$line['total_vat']; $newline->total_ttc=$line['total']; + $newline->date_start=$line['date_start']; + $newline->date_end=$line['date_end']; $newobject->lines[]=$newline; } diff --git a/scripts/accountancy/export-thirdpartyaccount.php b/scripts/accountancy/export-thirdpartyaccount.php old mode 100644 new mode 100755
'.$langs->trans("Ref").''; + print ''; print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin); print '
'.$langs->trans("Lastname").''.$object->lastname.''.$object->lastname.''; @@ -1137,23 +1154,23 @@ else // Firstname print '
'.$langs->trans("Firstname").''.$object->firstname.''.$object->firstname.'
'.$langs->trans("PostOrFunction").''.$object->job.''.$object->job.'
'.$langs->trans("Login").''.$langs->trans("LoginAccountDisableInDolibarr").''.$langs->trans("LoginAccountDisableInDolibarr").''.$object->login.''.$object->login.'
'.$langs->trans("LdapUacf_".$statutUACF).''.$langs->trans("LdapUacf_".$statutUACF).''.$langs->trans("UserMustChangePassNextLogon",$ldap->domainFQDN).''.$langs->trans("UserMustChangePassNextLogon",$ldap->domainFQDN).''.$langs->trans("LdapUacf_".$statutUACF,$ldap->domainFQDN).''.$langs->trans("LdapUacf_".$statutUACF,$ldap->domainFQDN).''.$langs->trans("DomainPassword").''.$langs->trans("DomainPassword").''; + print ''; if ($object->pass) print preg_replace('/./i','*',$object->pass); else { @@ -1192,7 +1209,7 @@ else print '
'.$langs->trans("Administrator").''; + print '
'.$langs->trans("Administrator").''; if (! empty($conf->multicompany->enabled) && $object->admin && ! $object->entity) { print $form->textwithpicto(yn($object->admin),$langs->trans("SuperAdministratorDesc"),1,"superadmin"); @@ -1208,7 +1225,7 @@ else print '
'.$langs->trans("Type").''; + print '
'.$langs->trans("Type").''; $type=$langs->trans("Internal"); if ($object->societe_id) $type=$langs->trans("External"); print $form->textwithpicto($type,$langs->trans("InternalExternalDesc")); @@ -1218,47 +1235,47 @@ else // Ldap sid if ($object->ldap_sid) { - print '
'.$langs->trans("Type").''; + print '
'.$langs->trans("Type").''; print $langs->trans("DomainUser",$ldap->domainFQDN); print '
'.$langs->trans("PhonePro").''.dol_print_phone($object->office_phone,'',0,0,1).''.dol_print_phone($object->office_phone,'',0,0,1).'
'.$langs->trans("PhoneMobile").''.dol_print_phone($object->user_mobile,'',0,0,1).''.dol_print_phone($object->user_mobile,'',0,0,1).'
'.$langs->trans("Fax").''.dol_print_phone($object->office_fax,'',0,0,1).''.dol_print_phone($object->office_fax,'',0,0,1).'
'.$langs->trans("Skype").''.dol_print_skype($object->skype,0,0,1).'
'.$langs->trans("Skype").''.dol_print_skype($object->skype,0,0,1).'
'.$langs->trans("EMail").''.dol_print_email($object->email,0,0,1).''.dol_print_email($object->email,0,0,1).'
'.$langs->trans('Signature').''; + print '
'.$langs->trans('Signature').''; print dol_htmlentitiesbr($object->signature); print "
'.$langs->trans("HierarchicalResponsible").''; + print ''; if (empty($object->fk_user)) print $langs->trans("None"); else { $huser=new User($db); @@ -1268,27 +1285,27 @@ else print '
'.$langs->trans("THM").''; + print ''; print ($object->thm!=''?price($object->thm,'',$langs,1,-1,-1,$conf->currency):''); print '
'.$langs->trans("TJM").''; + print ''; print ($object->tjm!=''?price($object->tjm,'',$langs,1,-1,-1,$conf->currency):''); print '
'.$langs->trans("Salary").''; + print ''; print ($object->salary!=''?price($object->salary,'',$langs,1,-1,-1,$conf->currency):''); print '
'.$langs->trans("WeeklyHours").''; + print ''; print price2num($object->weeklyhours); print '
'.$langs->trans("AccountancyCode").''.$object->accountancy_code.''.$object->accountancy_code.'
'.$langs->trans("ColorUser").''; + print $object->color; + print ' 
'.$langs->trans("Status").''; + print ''; print $object->getLibStatut(4); print '
'.$langs->trans("LastConnexion").''.dol_print_date($object->datelastlogin,"dayhour").''.dol_print_date($object->datelastlogin,"dayhour").'
'.$langs->trans("PreviousConnexion").''.dol_print_date($object->datepreviouslogin,"dayhour").''.dol_print_date($object->datepreviouslogin,"dayhour").'
'.$langs->trans("OpenIDURL").''.$object->openid.''.$object->openid.'
'.$langs->trans("LinkToCompanyContact").''; + print ''; if (isset($object->societe_id) && $object->societe_id > 0) { $societe = new Societe($db); @@ -1363,7 +1391,7 @@ else { $langs->load("members"); print '
'.$langs->trans("LinkedToDolibarrMember").''; + print ''; if ($object->fk_member) { $adh=new Adherent($db); @@ -1631,7 +1659,10 @@ else if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) $rowspan++; if (! empty($conf->societe->enabled)) $rowspan++; if (! empty($conf->adherent->enabled)) $rowspan++; - + if (! empty($conf->skype->enabled)) $rowspan++; + if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) $rowspan = $rowspan+3; + if (! empty($conf->agenda->enabled)) $rowspan++; + print ''; print ''; print ''; @@ -1696,7 +1727,7 @@ else print ''; } else - { + { print ''; print $object->job; } @@ -1918,7 +1949,7 @@ else print $doleditor->Create(1); } else - { + { print dol_htmlentitiesbr($object->signature); } print '
'.$langs->trans("ColorUser").''; + print $formother->selectColor(GETPOST('color')?GETPOST('color'):$object->color, 'color', 'usercolorconfig', 1, '', 'hideifnotset'); + print '
'.$langs->trans("Status").'