diff --git a/ChangeLog b/ChangeLog index 82771d980ab..0e57d0be48a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,7 @@ Following changes may create regressions for some external modules, but were nec * The method get_substitutionarray_shipment_lines() has been removed. Use the generic get_substitutionarray_lines() instead. * Recheck setup of your module workflow to see if you need to enable the new setting to have shipment set to billed automatically when an invoice from a shipment is validated (and if your process is to make invoice on shipment and not on order). +* It was possible to use a variable $soc or $right inside a php code condition of some extrafields properties, this is no more true (this vars are no more defined globaly). ***** ChangeLog for 18.0.1 compared to 18.0.0 ***** diff --git a/dev/tools/apstats.php b/dev/tools/apstats.php index 271bd264270..7b6b1f08cda 100755 --- a/dev/tools/apstats.php +++ b/dev/tools/apstats.php @@ -246,11 +246,11 @@ th,td { margin-left: 10px; } .back1 { - background-color: #888800; + background-color: #884466; color: #FFF; } -.back1 { - background-color: #880088; +.back2 { + background-color: #664488; color: #FFF; } '; diff --git a/htdocs/bookcal/class/availabilities.class.php b/htdocs/bookcal/class/availabilities.class.php index 40e07b821c5..6da76ad4a80 100644 --- a/htdocs/bookcal/class/availabilities.class.php +++ b/htdocs/bookcal/class/availabilities.class.php @@ -102,7 +102,7 @@ class Availabilities extends CommonObject * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields=array( - 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), + 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>2, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'cssview'=>'wordbreak', 'help'=>"Help text", 'showoncombobox'=>'2', 'validate'=>'1',), 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>3, 'validate'=>'1',), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0, 'cssview'=>'wordbreak', 'validate'=>'1',), diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 2de8736b39f..836562067f8 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -300,6 +300,11 @@ class ActionComm extends CommonObject */ public $elementtype; + /** + * @var int id of availability + */ + public $fk_bookcal_availability; + /** * @var string Ical name */ @@ -539,6 +544,7 @@ class ActionComm extends CommonObject $sql .= "transparency,"; $sql .= "fk_element,"; $sql .= "elementtype,"; + $sql .= "fk_bookcal_availability,"; $sql .= "entity,"; $sql .= "extraparams,"; // Fields emails @@ -581,6 +587,7 @@ class ActionComm extends CommonObject $sql .= "'".$this->db->escape($this->transparency)."', "; $sql .= (!empty($this->fk_element) ? ((int) $this->fk_element) : "null").", "; $sql .= (!empty($this->elementtype) ? "'".$this->db->escape($this->elementtype)."'" : "null").", "; + $sql .= (!empty($this->fk_bookcal_availability) ? "'".$this->db->escape($this->fk_bookcal_availability)."'" : "null").", "; $sql .= ((int) $conf->entity).","; $sql .= (!empty($this->extraparams) ? "'".$this->db->escape($this->extraparams)."'" : "null").", "; // Fields emails diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 7316ee3daaf..e03b4bd1473 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -557,6 +557,34 @@ if ($user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allac $s = ''; $link = ''; $showextcals = $listofextcals; +$bookcalcalendars = array(); + +// Load Bookcal Calendars +if (isModEnabled("bookcal")) { + $sql = "SELECT ba.rowid, bc.label, bc.ref, bc.rowid as id_cal"; + $sql .= " FROM ".MAIN_DB_PREFIX."bookcal_availabilities as ba"; + $sql .= " JOIN ".MAIN_DB_PREFIX."bookcal_calendar as bc"; + $sql .= " ON bc.rowid = ba.fk_bookcal_calendar"; + $sql .= " WHERE bc.status = 1"; + $sql .= " AND ba.status = 1"; + if (!empty($filtert) && $filtert != -1) { + $sql .= " AND bc.visibility = ".(int) $filtert ; + } + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) { + $objp = $db->fetch_object($resql); + $label = !empty($objp->label) ? $objp->label : $objp->ref; + $bookcalcalendars["calendars"][] = array("id" => $objp->id_cal, "label" => $label); + $bookcalcalendars["availabilitieslink"][$objp->rowid] = $objp->id_cal; + $i++; + } + } else { + dol_print_error($db); + } +} if (!empty($conf->use_javascript_ajax)) { // If javascript on $s .= "\n".''."\n"; @@ -564,6 +592,11 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on $s .= 'jQuery(document).ready(function () {'."\n"; $s .= 'jQuery(".check_birthday").click(function() { console.log("Toggle birthdays"); jQuery(".family_birthday").toggle(); });'."\n"; $s .= 'jQuery(".check_holiday").click(function() { console.log("Toggle holidays"); jQuery(".family_holiday").toggle(); });'."\n"; + if (isModEnabled("bookcal")) { + foreach ($bookcalcalendars["calendars"] as $key => $value) { + $s .= 'jQuery(".check_bookcal_calendar_'.$value['id'].'").click(function() { console.log("Toggle Bookcal Calendar '.$value['id'].'"); jQuery(".family_bookcal_calendar_'.$value['id'].'").toggle(); });'."\n"; + } + } if ($mode == "show_week" || $mode == "show_month" || empty($mode)) { // Code to enable drag and drop $s .= 'jQuery( "div.sortable" ).sortable({connectWith: ".sortable", placeholder: "ui-state-highlight", items: "div.movable", receive: function( event, ui ) {'."\n"; @@ -631,6 +664,14 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on // Birthdays $s .= '
 
'; + // Bookcal Calendar + if (isModEnabled("bookcal")) { + foreach ($bookcalcalendars["calendars"] as $key => $value) { + $label = $value['label']; + $s .= '
 
'; + } + } + // Calendars from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('addCalendarChoice', $parameters, $object, $action); @@ -673,7 +714,7 @@ $sql .= ' a.datep2,'; $sql .= ' a.percent,'; $sql .= ' a.fk_user_author,a.fk_user_action,'; $sql .= ' a.transparency, a.priority, a.fulldayevent, a.location,'; -$sql .= ' a.fk_soc, a.fk_contact, a.fk_project,'; +$sql .= ' a.fk_soc, a.fk_contact, a.fk_project, a.fk_bookcal_availability,'; $sql .= ' a.fk_element, a.elementtype,'; $sql .= ' ca.code as type_code, ca.libelle as type_label, ca.color as type_color, ca.type as type_type, ca.picto as type_picto'; $sql .= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a"; @@ -862,6 +903,10 @@ if ($resql) { $event->socid = $obj->fk_soc; $event->contact_id = $obj->fk_contact; + $event->fk_bookcal_availability = $obj->fk_bookcal_availability; + if (!empty($event->fk_bookcal_availability)) { + $event->type = "bookcal_calendar"; + } // Defined date_start_in_calendar and date_end_in_calendar property // They are date start and end of action but modified to not be outside calendar view. @@ -1505,7 +1550,7 @@ if (empty($mode) || $mode == 'show_month') { // View by month } //var_dump($todayarray['mday']."==".$tmpday." && ".$todayarray['mon']."==".$month." && ".$todayarray['year']."==".$year.' -> '.$style); echo ' '; - show_day_events($db, $tmpday, $month, $year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam); + show_day_events($db, $tmpday, $month, $year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam, 0, 60, 0, $bookcalcalendars); echo "\n"; } else { /* Show days after the current month (next month) */ @@ -1578,7 +1623,7 @@ if (empty($mode) || $mode == 'show_month') { // View by month } echo ' '; - show_day_events($db, $tmpday, $tmpmonth, $tmpyear, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300); + show_day_events($db, $tmpday, $tmpmonth, $tmpyear, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, 0, $bookcalcalendars); echo " \n"; } echo " \n"; @@ -1668,13 +1713,13 @@ if (empty($mode) || $mode == 'show_month') { // View by month echo ''; - show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, 1); + show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, 1, $bookcalcalendars); print ''; } else { print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table - show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, 0); + show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, 0, $bookcalcalendars); print '
'; } @@ -1703,9 +1748,10 @@ $db->close(); * @param int $showinfo Add extended information (used by day and week view) * @param int $minheight Minimum height for each event. 60px by default. * @param string $nonew 0=Add "new entry button", 1=No "new entry button", -1=Only "new entry button" + * @param string $bookcalcalendarsarray Used for Bookcal module array of calendar of bookcal * @return void */ -function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint = 0, $maxnbofchar = 16, $newparam = '', $showinfo = 0, $minheight = 60, $nonew = 0) +function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint = 0, $maxnbofchar = 16, $newparam = '', $showinfo = 0, $minheight = 60, $nonew = 0, $bookcalcalendarsarray = array()) { global $user, $conf, $langs; global $action, $mode, $filter, $filtert, $status, $actioncode, $usergroup; // Filters used into search form @@ -1817,6 +1863,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $colorindex = 2; $cssclass = 'family_birthday '; $color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]); + } elseif ($event->type == 'bookcal_calendar') { + $numbirthday++; + $colorindex = 3; + $cssclass = 'family_bookcal_calendar_'.(!empty($bookcalcalendarsarray[$fk_bookcal_availability]) ? $bookcalcalendarsarray[$fk_bookcal_availability][$event->fk_bookcal_availability] : ""); + $color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]); } else { $numother++; $color = ($event->icalcolor ? $event->icalcolor : -1); @@ -1904,6 +1955,9 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa if ($event->type == 'holiday' && !GETPOST('check_holiday')) { $morecss = 'hidden'; } + if ($event->type == 'bookcal_calendar' && !GETPOST('check_bookcal_calendar_'.$bookcalcalendarsarray["availabilitieslink"][$event->fk_bookcal_availability])) { + $morecss = 'hidden'; + } if ($morecss != 'hidden') { $itoshow++; } @@ -1911,8 +1965,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $ireallyshown++; } //var_dump($event->type.' - '.$morecss.' - '.$cssclass.' - '.$i.' - '.$ireallyshown.' - '.$itoshow); - - print '
type == 'bookcal_calendar') { + print '
fk_bookcal_availability].' '.$cssclass.($morecss ? ' '.$morecss : '').'"'; + } else { + print '
0) { $sql .= " AND pd.rowid = ".((int) $did); } - dol_syslog(__METHOD__." Read invoices,", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -937,7 +942,9 @@ class BonPrelevement extends CommonObject dol_syslog(__METHOD__." Read invoices, ".$i." invoices to withdraw", LOG_DEBUG); } else { $error++; - dol_syslog(__METHOD__." Read invoices error ".$this->db->error(), LOG_ERR); + $this->error = $this->db->lasterror(); + dol_syslog(__METHOD__." Read invoices error ".$this->db->lasterror(), LOG_ERR); + return -1; } } @@ -961,7 +968,7 @@ class BonPrelevement extends CommonObject if ($resfetch >= 0) { // Field 0 of $fac is rowid of invoice */ - // Check if $fac[8] s.nom is null + // Check if $fac[8] s.nom is null if ($fac[8] != null) { //$bac = new CompanyBankAccount($this->db); //$bac->fetch(0, $soc->id); diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 62d84cd444c..2555ab9d37e 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -128,6 +128,7 @@ if (empty($reshook)) { if (!$error) { // getDolGlobalString('PRELEVEMENT_CODE_BANQUE') and getDolGlobalString('PRELEVEMENT_CODE_GUICHET') should be empty (we don't use them anymore) $result = $bprev->create(getDolGlobalString('PRELEVEMENT_CODE_BANQUE'), getDolGlobalString('PRELEVEMENT_CODE_GUICHET'), $mode, $format, $executiondate, 0, $type); + if ($result < 0) { setEventMessages($bprev->error, $bprev->errors, 'errors'); } elseif ($result == 0) { diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index b599480f583..de30b356b03 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -191,7 +191,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes' && !empty($permissionto } } elseif ($action == 'confirm_updateline' && GETPOST('save', 'alpha') && GETPOST('link', 'alpha') && !empty($permissiontoadd)) { require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $langs->load('link'); + $link = new Link($db); $f = $link->fetch(GETPOST('linkid', 'int')); if ($f) { diff --git a/htdocs/core/ajax/bookcalAjax.php b/htdocs/core/ajax/bookcalAjax.php index 80323b0fee9..4859d5b5941 100644 --- a/htdocs/core/ajax/bookcalAjax.php +++ b/htdocs/core/ajax/bookcalAjax.php @@ -80,11 +80,11 @@ if ($action == 'verifyavailability') { } if (!$error) { $datetocheckbooking_end = dol_time_plus_duree($datetocheckbooking, 1, 'd'); - $sql = "SELECT b.start, b.rowid"; - $sql .= " FROM ".MAIN_DB_PREFIX."bookcal_booking as b"; + $sql = "SELECT b.datep, b.id"; + $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as b"; $sql .= " WHERE fk_bookcal_availability = ".((int) $idavailability); - $sql .= " AND b.start >= '".$db->idate($datetocheckbooking)."'"; - $sql .= " AND b.start < '".$db->idate($datetocheckbooking_end)."'"; + $sql .= " AND b.datep >= '".$db->idate($datetocheckbooking)."'"; + $sql .= " AND b.datep < '".$db->idate($datetocheckbooking_end)."'"; $resql = $db->query($sql); if ($resql) { @@ -94,7 +94,7 @@ if ($action == 'verifyavailability') { $response["content"] = array(); while ($i < $num) { $obj = $db->fetch_object($resql); - $dateobject = $obj->start; + $dateobject = $obj->datep; $dateobject = explode(" ", $dateobject)[1]; $dateobject = explode(":", $dateobject); diff --git a/htdocs/core/boxes/box_scheduled_jobs.php b/htdocs/core/boxes/box_scheduled_jobs.php index f0868036e9d..7073e886301 100644 --- a/htdocs/core/boxes/box_scheduled_jobs.php +++ b/htdocs/core/boxes/box_scheduled_jobs.php @@ -103,7 +103,7 @@ class box_scheduled_jobs extends ModeleBoxes while ($i < $num) { $objp = $this->db->fetch_object($result); - if (dol_eval($objp->test, 1, 1, '')) { + if (dol_eval($objp->test, 1, 1, '2')) { $nextrun = $this->db->jdate($objp->datenextrun); if (empty($nextrun)) { $nextrun = $this->db->jdate($objp->datestart); diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index bfec5a6c199..ccb379ea531 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -150,6 +150,8 @@ abstract class CommonDocGenerator */ public $result; + public $posxlabel; + public $posxup; public $posxref; public $posxpicture; // For picture public $posxdesc; // For description diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 56fe182f10b..16df81f610b 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6165,7 +6165,7 @@ abstract class CommonObject if (empty($conf->disable_compute)) { global $objectoffield; // We set a global variable to $objectoffield so $objectoffield = $this; // we can use it inside computed formula - $this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, ''); + $this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); } } } @@ -6294,8 +6294,8 @@ abstract class CommonObject if (!empty($attrfieldcomputed)) { if (!empty($conf->global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) { - $value = dol_eval($attrfieldcomputed, 1, 0, ''); - dol_syslog($langs->trans("Extrafieldcomputed")." sur ".$attributeLabel."(".$value.")", LOG_DEBUG); + $value = dol_eval($attrfieldcomputed, 1, 0, '2'); + dol_syslog($langs->trans("Extrafieldcomputed")." on ".$attributeLabel."(".$value.")", LOG_DEBUG); $new_array_options[$key] = $value; } else { $new_array_options[$key] = null; @@ -6675,7 +6675,7 @@ abstract class CommonObject if (!empty($attrfieldcomputed)) { if (!empty($conf->global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) { - $value = dol_eval($attrfieldcomputed, 1, 0, ''); + $value = dol_eval($attrfieldcomputed, 1, 0, '2'); dol_syslog($langs->trans("Extrafieldcomputed")." sur ".$attributeLabel."(".$value.")", LOG_DEBUG); $this->array_options["options_".$key] = $value; } else { @@ -7597,7 +7597,7 @@ abstract class CommonObject if ($computed) { // Make the eval of compute string //var_dump($computed); - $value = dol_eval($computed, 1, 0, ''); + $value = dol_eval($computed, 1, 0, '2'); } if (empty($morecss)) { diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index faa8251ad0a..33694e798e6 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -188,15 +188,13 @@ class FormContract * @param int $showempty Show empty line * @param int $showRef Show customer and supplier reference on each contract (when found) * @param int $noouput 1=Return the output instead of display - * @return int Nbr of project if OK, <0 if KO + * @return string|void html string */ public function formSelectContract($page, $socid = -1, $selected = '', $htmlname = 'contrattid', $maxlength = 16, $showempty = 1, $showRef = 0, $noouput = 0) { global $langs; - $ret = ''; - - $ret .= '
'; + $ret = ''; $ret .= ''; $ret .= ''; $ret .= $this->select_contract($socid, $selected, $htmlname, $maxlength, $showempty, $showRef, 1); @@ -208,7 +206,5 @@ class FormContract } print $ret; - - return $result; } } diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index fc3a8753a59..28da9f9a72d 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -52,6 +52,11 @@ class RssParser private $_rssarray = array(); private $current_namespace; + public $items = array(); + public $current_item = array(); + public $channel = array(); + public $textinput = array(); + public $image = array(); private $initem; private $intextinput; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 20534d827a3..7fb73c6d696 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -869,7 +869,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel // Ref print ''; - print $projecttmp->getNomUrl(1); + print $projecttmp->getNomUrl(1, '', 0, '', '-', 0, 1, '', 'project:'.$_SERVER["PHP_SELF"].'?socid=__SOCID__'); print ''; // Label diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 69ce183cc0d..44cbe0ec1e2 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1885,7 +1885,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess $linkObject->objectid = GETPOST('objectid', 'int'); $linkObject->label = GETPOST('label', 'alpha'); $res = $linkObject->create($user); - $langs->load('link'); + if ($res > 0) { setEventMessages($langs->trans("LinkComplete"), null, 'mesgs'); } else { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a984ef485c7..2ae73a96a64 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -274,6 +274,9 @@ function getEntity($element, $shared = 1, $currentobject = null) // fix different element names (France to English) switch ($element) { + case 'projet': + $element = 'project'; + break; case 'contrat': $element = 'contract'; break; // "/contrat/class/contrat.class.php" @@ -7561,6 +7564,7 @@ function dol_html_entity_decode($a, $b, $c = 'UTF-8', $keepsomeentities = 0) * @param string $encoding Encoding page code * @param bool $double_encode When double_encode is turned off, PHP will not encode existing html entities * @return string $ret Encoded string + * @see dol_htmlentitiesbr() */ function dol_htmlentities($string, $flags = ENT_QUOTES|ENT_SUBSTITUTE, $encoding = 'UTF-8', $double_encode = false) { @@ -9141,6 +9145,33 @@ function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid = } } +/** + * Check if a variable with name $var start with $text. + * Can be used to forge dol_eval() conditions. + * + * @param $var string Variable + * @param $regextext string Text that must be a valid regex string + * @param $matchrule int 1=Test if start with, 0=Test if equal + * @return boolean|string True or False, text if bad use. + */ +function isStringVarMatching($var, $regextext, $matchrule = 1) +{ + if ($matchrule == 1) { + if ($var == 'mainmenu') { + global $mainmenu; + return (preg_match('/^'.$regextext.'/', $mainmenu)); + } elseif ($var == 'leftmenu') { + global $leftmenu; + return (preg_match('/^'.$regextext.'/', $leftmenu)); + } else { + return 'This variable is not accessible with dol_eval'; + } + } else { + return 'This value for matchrule is not implemented'; + } +} + + /** * Verify if condition in string is ok or not * @@ -9149,15 +9180,15 @@ function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid = */ function verifCond($strToEvaluate) { - global $user, $conf, $langs; + global $conf; // Read of const is done with getDolGlobalString() but we need $conf->currency for example + global $user, $langs; global $leftmenu; - global $rights; // To export to dol_eval function //print $strToEvaluate."
\n"; $rights = true; if (isset($strToEvaluate) && $strToEvaluate !== '') { //var_dump($strToEvaluate); - $rep = dol_eval($strToEvaluate, 1, 1, '1'); // The dol_eval must contains all the global $xxx for all variables $xxx found into the string condition + $rep = dol_eval($strToEvaluate, 1, 1, '1'); // The dol_eval() must contains all the "global $xxx;" for all variables $xxx found into the string condition $rights = $rep && (!is_string($rep) || strpos($rep, 'Bad string syntax to evaluate') === false); //var_dump($rights); } @@ -9171,29 +9202,36 @@ function verifCond($strToEvaluate) * @param string $s String to evaluate * @param int $returnvalue 0=No return (used to execute eval($a=something)). 1=Value of eval is returned (used to eval($something)). * @param int $hideerrors 1=Hide errors - * @param string $onlysimplestring '0' (used for computed property of extrafields)=Accept all chars, '1' (most common use)=Accept only simple string with char 'a-z0-9\s^$_+-.*>&|=!?():"\',/@';', '2' (rarely used)=Accept also '[]' + * @param string $onlysimplestring '0' (deprecated, used for computed property of extrafields)=Accept all chars, + * '1' (most common use)=Accept only simple string with char 'a-z0-9\s^$_+-.*>&|=!?():"\',/@';', + * '2' (rarely used)=Accept also '[]' * @return mixed Nothing or return result of eval + * @see verifCond() */ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1') { - // Only global variables can be changed by eval function and returned to caller - global $db, $langs, $user, $conf, $website, $websitepage; + // Only this global variables can be read by eval function and returned to caller + global $conf; // Read of const is done with getDolGlobalString() but we need $conf->currency for example + global $db, $langs, $user, $website, $websitepage; global $action, $mainmenu, $leftmenu; global $mysoc; - global $objectoffield; + global $objectoffield; // To allow the use of $objectoffield in computed fields // Old variables used - global $rights; global $object; - global $obj; // To get $obj used into list when dol_eval is used for computed fields and $obj is not yet $object - global $soc; // For backward compatibility + global $obj; // To get $obj used into list when dol_eval() is used for computed fields and $obj is not yet $object + //global $rights; + //global $soc; // For backward compatibility + + if (!in_array($onlysimplestring, array('0', '1', '2'))) { + return "Bad call of dol_eval. Parameter onlysimplestring must be '0' (deprecated), '1' or '2'"; + } try { // Test on dangerous char (used for RCE), we allow only characters to make PHP variable testing if ($onlysimplestring == '1') { - // We must accept: '1 && getDolGlobalInt("doesnotexist1") && $conf->global->MAIN_FEATURES_LEVEL' - // We must accept: '$conf->barcode->enabled || preg_match(\'/^AAA/\',$leftmenu)' - // We must accept: '$user->rights->cabinetmed->read && !$object->canvas=="patient@cabinetmed"' + // We must accept: '1 && getDolGlobalInt("doesnotexist1") && getDolGlobalString("MAIN_FEATURES_LEVEL")' + // We must accept: '$user->hasRight("cabinetmed", "read") && !$object->canvas=="patient@cabinetmed"' if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*>&|=!?():"\',/@', '/').']/i', $s)) { if ($returnvalue) { return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s; @@ -9201,10 +9239,21 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' dol_syslog('Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s); return ''; } - // TODO - // We can exclude all parenthesis ( that are not '($db' and 'getDolGlobalInt(' and 'getDolGlobalString(' and 'preg_match(' and 'isModEnabled(' - // ... } + $scheck = preg_replace('/->[a-zA-Z0-9_]+\(/', '->__METHOD__', $s); + $scheck = preg_replace('/\s[a-zA-Z0-9_]+\(/', ' __FUNCTION__', $scheck); + $scheck = preg_replace('/(\^|\')\(/', '__REGEXSTART__', $scheck); // To allow preg_match('/^(aaa|bbb)/'... or isStringVarMatching('leftmenu', '(aaa|bbb)') + //print 'scheck='.$scheck." : ".strpos($scheck, '(')."\n"; + if (strpos($scheck, '(') !== false) { + if ($returnvalue) { + return 'Bad string syntax to evaluate (found call of a function or method without using direct name): '.$s; + } else { + dol_syslog('Bad string syntax to evaluate (found call of a function or method without using direct name): '.$s); + return ''; + } + } + // TODO + // We can exclude $ char that are not: $db, $langs, $leftmenu, $topmenu, $user, $langs, $objectoffield, $object..., } elseif ($onlysimplestring == '2') { // We must accept: (($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : "Parent project not found" if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*>&|=!?():"\',/@[]', '/').']/i', $s)) { @@ -9214,10 +9263,17 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' dol_syslog('Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s); return ''; } - // TODO - // We can exclude all parenthesis ( that are not '($db' and 'getDolGlobalInt(' and 'getDolGlobalString(' and 'preg_match(' and 'isModEnabled(' - // ... } + if (strpos($scheck, '(') !== false) { + if ($returnvalue) { + return 'Bad string syntax to evaluate (found call of a function or method without using direct name): '.$s; + } else { + dol_syslog('Bad string syntax to evaluate (found call of a function or method without using direct name): '.$s); + return ''; + } + } + // TODO + // We can exclude $ char that are not: $db, $leftmenu, $topmenu, $user, $langs, $object..., } if (is_array($s) || $s === 'Array') { return 'Bad string syntax to evaluate (value is Array) '.var_export($s, true); @@ -9251,8 +9307,11 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' $forbiddenphpstrings = array('$$'); $forbiddenphpstrings = array_merge($forbiddenphpstrings, array('_ENV', '_SESSION', '_COOKIE', '_GET', '_POST', '_REQUEST')); - $forbiddenphpfunctions = array("exec", "passthru", "shell_exec", "system", "proc_open", "popen", "eval", "dol_eval", "executeCLI", "verifCond", "base64_decode"); + $forbiddenphpfunctions = array("exec", "passthru", "shell_exec", "system", "proc_open", "popen", "eval"); + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("dol_eval", "executeCLI", "verifCond")); // native dolibarr functions + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("base64_decode", "rawurldecode", "urldecode")); // decode string functions $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "require", "include", "mkdir", "rmdir", "symlink", "touch", "unlink", "umask")); + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("get_defined_functions", "get_defined_vars", "get_defined_constants", "get_declared_classes")); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("function", "call_user_func")); $forbiddenphpregex = 'global\s+\$|\b('.implode('|', $forbiddenphpfunctions).')\b'; diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index 7281936216a..32fd00752b6 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -448,7 +448,34 @@ function dolGetListOfObjectClasses($destdir) return -1; } +/** + * function for check if comment begin an end exist in modMyModule class + * @param string $file filename or path + * @param int $number 0 = For Menus,1 = For permissions, 2 = For Dictionaries + * @return int 1 if OK , -1 if KO + */ +function checkExistComment($file, $number) +{ + if (!file_exists($file)) { + return -1; + } + $content = file_get_contents($file); + if ($number === 0) { + if (strpos($content, '/* BEGIN MODULEBUILDER LEFTMENU MYOBJECT */') !== false && strpos($content, '/* END MODULEBUILDER LEFTMENU MYOBJECT */') !== false) { + return 1; + } + } elseif ($number === 1) { + if (strpos($content, '/* BEGIN MODULEBUILDER PERMISSIONS */') !== false && strpos($content, '/* END MODULEBUILDER PERMISSIONS */') !== false) { + return 1; + } + } elseif ($number == 2) { + if (strpos($content, '/* BEGIN MODULEBUILDER DICTIONARIES */') !== false && strpos($content, '/* END MODULEBUILDER DICTIONARIES */') !== false) { + return 1; + } + } + return -1; +} /** * Delete all permissions * @@ -1290,3 +1317,31 @@ function writeApiUrlsInDoc($file_api, $file_doc) } return -1; } + + +/** + * count directories or files in modulebuilder folder + * @param string $path path of directory + * @param int $type type of file 1= file,2=directory + * @return int|bool + */ +function countItemsInDirectory($path, $type = 1) +{ + if (!is_dir($path)) { + return false; + } + + $allFilesAndDirs = scandir($path); + $count = 0; + + foreach ($allFilesAndDirs as $item) { + if ($item != '.' && $item != '..') { + if ($type == 1 && is_file($path . DIRECTORY_SEPARATOR . $item) && strpos($item, '.back') === false) { + $count++; + } elseif ($type == 2 && is_dir($path . DIRECTORY_SEPARATOR . $item)) { + $count++; + } + } + } + return $count; +} diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index d6bc0027da4..0a2d2572889 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -371,7 +371,7 @@ function restrictedArea(User $user, $features, $object = 0, $tableandshare = '', //dol_syslog("functions.lib:restrictedArea $feature, $objectid, $dbtablename, $feature2, $dbt_socfield, $dbt_select, $isdraft"); /*print "user_id=".$user->id.", features=".$features.", feature2=".$feature2.", objectid=".$objectid; print ", dbtablename=".$tableandshare.", dbt_socfield=".$dbt_keyfield.", dbt_select=".$dbt_select; - print ", perm: user->right->".$features.($feature2 ? "->".$feature2 : "")."=".($user->hasRight($features, $feature2, 'lire'))."
"; + print ", perm: user->hasRight(".$features.($feature2 ? ",".$feature2 : "").", lire) = ".($feature2 ? $user->hasRight($features, $feature2, 'lire') : $user->hasRight($features, 'lire'))."
"; */ $parentfortableentity = ''; @@ -389,6 +389,10 @@ function restrictedArea(User $user, $features, $object = 0, $tableandshare = '', if ($features == 'facturerec') { $features = 'facture'; } + if ($features == 'supplier_invoicerec') { + $features = 'fournisseur'; + $feature2 = 'facture'; + } if ($features == 'mo') { $features = 'mrp'; } @@ -430,19 +434,21 @@ function restrictedArea(User $user, $features, $object = 0, $tableandshare = '', // Get more permissions checks from hooks $parameters = array('features'=>$features, 'originalfeatures'=>$originalfeatures, 'objectid'=>$objectid, 'dbt_select'=>$dbt_select, 'idtype'=>$dbt_select, 'isdraft'=>$isdraft); - $reshook = $hookmanager->executeHooks('restrictedArea', $parameters); + if (!empty($hookmanager)) { + $reshook = $hookmanager->executeHooks('restrictedArea', $parameters); - if (isset($hookmanager->resArray['result'])) { - if ($hookmanager->resArray['result'] == 0) { - if ($mode) { - return 0; - } else { - accessforbidden(); // Module returns 0, so access forbidden + if (isset($hookmanager->resArray['result'])) { + if ($hookmanager->resArray['result'] == 0) { + if ($mode) { + return 0; + } else { + accessforbidden(); // Module returns 0, so access forbidden + } } } - } - if ($reshook > 0) { // No other test done. - return 1; + if ($reshook > 0) { // No other test done. + return 1; + } } // Features/modules to check diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index d27c4dac376..ee77e7dd316 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -76,6 +76,9 @@ function dolStripPhpCode($str, $replacewith = '') function dolKeepOnlyPhpCode($str) { $str = str_replace('virtualhost) { $content = preg_replace('/^(]*rel="canonical" href=")\//m', '\1'.$website->virtualhost.'/', $content, -1, $nbrep); diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 87a964c9419..1668d640f02 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -248,7 +248,7 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage, // Add js $tplcontent .= ''."\n"; $tplcontent .= ''."\n"; - $tplcontent .= ''."\n"; + $tplcontent .= ''."\n"; // Add headers $tplcontent .= ''."\n"; $tplcontent .= ''."\n"; diff --git a/htdocs/core/modules/contract/mod_contract_magre.php b/htdocs/core/modules/contract/mod_contract_magre.php index fd476eb2bc5..8deebdcffb5 100644 --- a/htdocs/core/modules/contract/mod_contract_magre.php +++ b/htdocs/core/modules/contract/mod_contract_magre.php @@ -102,7 +102,7 @@ class mod_contract_magre extends ModelNumRefContracts */ public function getExample() { - global $conf, $langs, $mysoc; + global $langs, $mysoc; $old_code_client = $mysoc->code_client; $mysoc->code_client = 'CCCCCCCCCC'; diff --git a/htdocs/core/modules/contract/mod_contract_olive.php b/htdocs/core/modules/contract/mod_contract_olive.php index 4051ac7c779..2737899a65c 100644 --- a/htdocs/core/modules/contract/mod_contract_olive.php +++ b/htdocs/core/modules/contract/mod_contract_olive.php @@ -78,6 +78,16 @@ class mod_contract_olive extends ModelNumRefContracts return $langs->trans("LeopardNumRefModelDesc"); } + /** + * Return numbering example + * + * @return string Example + */ + public function getExample() + { + return ''; + } + /** * Return an example of result returned by getNextValue * @@ -87,7 +97,6 @@ class mod_contract_olive extends ModelNumRefContracts */ public function getNextValue($objsoc, $contract) { - global $langs; return ''; } @@ -112,9 +121,9 @@ class mod_contract_olive extends ModelNumRefContracts $result = 0; $code = strtoupper(trim($code)); - if (empty($code) && $this->code_null && empty($conf->global->MAIN_CONTARCT_CODE_ALWAYS_REQUIRED)) { + if (empty($code) && $this->code_null && empty($conf->global->MAIN_CONTRACT_CODE_ALWAYS_REQUIRED)) { $result = 0; - } elseif (empty($code) && (!$this->code_null || !empty($conf->global->MAIN_CONTARCT_CODE_ALWAYS_REQUIRED))) { + } elseif (empty($code) && (!$this->code_null || !empty($conf->global->MAIN_CONTRACT_CODE_ALWAYS_REQUIRED))) { $result = -2; } diff --git a/htdocs/core/modules/modApi.class.php b/htdocs/core/modules/modApi.class.php index acceaa822d1..9621904ebe6 100644 --- a/htdocs/core/modules/modApi.class.php +++ b/htdocs/core/modules/modApi.class.php @@ -163,7 +163,6 @@ class modApi extends DolibarrModules 'langs'=>'modulebuilder', 'position'=>100, 'perms'=>'1', - //'enabled'=>'isModEnabled("api") && preg_match(\'/^(devtools)/\',$leftmenu)', 'enabled'=>'isModEnabled("api")', 'target'=>'_apiexplorer', 'user'=>0); diff --git a/htdocs/core/modules/modBookCal.class.php b/htdocs/core/modules/modBookCal.class.php index fbbc4180423..07237b63d45 100644 --- a/htdocs/core/modules/modBookCal.class.php +++ b/htdocs/core/modules/modBookCal.class.php @@ -297,7 +297,7 @@ class modBookCal extends DolibarrModules $r = 0; // Add here entries to declare new menus /* BEGIN MODULEBUILDER TOPMENU */ - $this->menu[$r++] = array( + /*$this->menu[$r++] = array( 'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'top', // This is a Top menu entry 'titre'=>'ModuleBookCalName', @@ -311,18 +311,33 @@ class modBookCal extends DolibarrModules 'perms'=>'$user->rights->bookcal->availabilities->read', // Use 'perms'=>'$user->rights->bookcal->availabilities->read' if you want your menu with a permission rules 'target'=>'', 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both - ); + );*/ /* END MODULEBUILDER TOPMENU */ /* BEGIN MODULEBUILDER LEFTMENU CALENDAR */ + $this->menu[$r++] = array( + 'fk_menu'=>'fk_mainmenu=agenda', + 'type'=>'left', + 'titre'=> 'MenuBookcalIndex', + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth em92"'), + 'mainmenu'=>'agenda', + 'leftmenu'=> 'bookcal', + 'url'=> '/bookcal/bookcalindex.php', + 'langs'=> 'bookcal', + 'position'=> 1100+$r, + 'enabled'=> '1', + 'perms'=> '$user->rights->bookcal->calendar->read', + 'user'=> 0 + ); + $this->menu[$r++]=array( // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'fk_menu'=>'fk_mainmenu=bookcal', + 'fk_menu'=>'fk_mainmenu=agenda,fk_leftmenu=bookcal', // This is a Left menu entry 'type'=>'left', - 'titre'=>'List Calendar', - 'mainmenu'=>'bookcal', - 'leftmenu'=>'bookcal_calendar', + 'titre'=>'Calendar', + 'mainmenu'=>'agenda', + 'leftmenu'=>'bookcal_calendar_list', 'url'=>'/bookcal/calendar_list.php', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'bookcal', @@ -337,12 +352,12 @@ class modBookCal extends DolibarrModules ); $this->menu[$r++]=array( // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'fk_menu'=>'fk_mainmenu=bookcal,fk_leftmenu=bookcal_calendar', + 'fk_menu'=>'fk_mainmenu=agenda,fk_leftmenu=bookcal_calendar_list', // This is a Left menu entry 'type'=>'left', - 'titre'=>'New Calendar', - 'mainmenu'=>'bookcal', - 'leftmenu'=>'bookcal_calendar', + 'titre'=>'NewCalendar', + 'mainmenu'=>'agenda', + 'leftmenu'=>'bookcal_new', 'url'=>'/bookcal/calendar_card.php?action=create', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'bookcal', @@ -405,11 +420,11 @@ class modBookCal extends DolibarrModules $this->menu[$r++]=array( // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'fk_menu'=>'fk_mainmenu=bookcal', + 'fk_menu'=>'fk_mainmenu=agenda,fk_leftmenu=bookcal', // This is a Left menu entry 'type'=>'left', - 'titre'=>'List Availabilities', - 'mainmenu'=>'bookcal', + 'titre'=>'Availabilities', + 'mainmenu'=>'agenda', 'leftmenu'=>'bookcal_availabilities', 'url'=>'/bookcal/availabilities_list.php', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. @@ -425,11 +440,11 @@ class modBookCal extends DolibarrModules ); $this->menu[$r++]=array( // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'fk_menu'=>'fk_mainmenu=bookcal,fk_leftmenu=bookcal_availabilities', + 'fk_menu'=>'fk_mainmenu=agenda,fk_leftmenu=bookcal_availabilities', // This is a Left menu entry 'type'=>'left', - 'titre'=>'New Availabilities', - 'mainmenu'=>'bookcal', + 'titre'=>'NewAvailabilities', + 'mainmenu'=>'agenda', 'leftmenu'=>'bookcal_availabilities', 'url'=>'/bookcal/availabilities_card.php?action=create', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index cf6a3b35648..0f0add8e9ae 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -35,7 +35,7 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield // If field is a computed field, we make computation to get value if ($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]) { $objectoffield = $object; //For compatibily with the computed formula - $value = dol_eval($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key], 1, 1, '0'); + $value = dol_eval($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key], 1, 1, '2'); if (is_numeric(price2num($value)) && $extrafields->attributes[$extrafieldsobjectkey]['totalizable'][$key]) { $obj->$tmpkey = price2num($value); } diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 54557539b26..c5c561c5ec5 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -31,7 +31,6 @@ // $sendto // $withmaindocfilemail - if ($massaction == 'predeletedraft') { print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassDraftDeletion"), $langs->trans("ConfirmMassDeletionQuestion", count($toselect)), "delete", null, '', 0, 200, 500, 1); } @@ -94,7 +93,7 @@ if ($massaction == 'preaffecttag' && isModEnabled('category')) { } } -if ($massaction == 'preupdateprice' && isModEnabled('category')) { +if ($massaction == 'preupdateprice') { $formquestion = array(); $valuefield = '
'; diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index f20d21463af..8a3e2634699 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -3225,6 +3225,7 @@ class EmailCollector extends CommonObject } else { $langs->load("admin"); $output = $langs->trans('NoNewEmailToProcess'); + $output .= ' (defaultlang='.$langs->defaultlang.')'; } // Disconnect diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index cec7cba23b7..17a3a16485f 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -366,7 +366,7 @@ $num = $db->num_rows($resql); if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) { $obj = $db->fetch_object($resql); $id = $obj->rowid; - header("Location: ".dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.$id); + header("Location: ".dol_buildpath('/fichinter/card.php', 1).'?id='.$id); exit; } diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php index 126a11e1ec5..3d8bdf23d36 100644 --- a/htdocs/fourn/facture/card-rec.php +++ b/htdocs/fourn/facture/card-rec.php @@ -126,7 +126,8 @@ $now = dol_now(); $error = 0; -$result = restrictedArea($user, 'facture', $object->id, $objecttype); +$result = restrictedArea($user, 'supplier_invoicerec', $object->id, $objecttype); + /* diff --git a/htdocs/fourn/facture/list-rec.php b/htdocs/fourn/facture/list-rec.php index f699765e2dd..e90aca5a576 100644 --- a/htdocs/fourn/facture/list-rec.php +++ b/htdocs/fourn/facture/list-rec.php @@ -66,7 +66,6 @@ $objecttype = 'facture_fourn_rec'; if ($action == "create" || $action == "add") { $objecttype = ''; } -$result = restrictedArea($user, 'facture', $id, $objecttype); $search_ref = GETPOST('search_ref'); $search_societe = GETPOST('search_societe'); @@ -169,7 +168,7 @@ if ($socid > 0) { } $objecttype = 'facture_fourn_rec'; -$result = restrictedArea($user, 'facture', $object->id, $objecttype); +$result = restrictedArea($user, 'supplier_invoicerec', $object->id, $objecttype); /* diff --git a/htdocs/index.php b/htdocs/index.php index b1ef9a66d0a..40f3fa7e9ea 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -455,7 +455,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { // We calculate $totallate. Must be defined before start of next loop because it is show in first fetch on next loop foreach ($valid_dashboardlines as $board) { - if ($board->nbtodolate > 0) { + if (is_numeric($board->nbtodo) && is_numeric($board->nbtodolate) && $board->nbtodolate > 0) { $totaltodo += $board->nbtodo; $totallate += $board->nbtodolate; } diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 12f8d2e21f5..af66817c339 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4100,6 +4100,7 @@ function migrate_delete_old_files($db, $langs, $conf) // List of files to delete $filetodeletearray = array( + '/core/ajax/ajaxcompanies.php', '/core/triggers/interface_demo.class.php', '/core/menus/barre_left/default.php', '/core/menus/barre_top/default.php', diff --git a/htdocs/langs/am_ET/link.lang b/htdocs/langs/am_ET/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/am_ET/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/ar_DZ/link.lang b/htdocs/langs/ar_DZ/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/ar_DZ/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/ar_JO/link.lang b/htdocs/langs/ar_JO/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/ar_JO/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/ar_SA/link.lang b/htdocs/langs/ar_SA/link.lang deleted file mode 100644 index 2e0aa65c6f3..00000000000 --- a/htdocs/langs/ar_SA/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=ربط ملف جديد/ وثيقة -LinkedFiles=الملفات والمستندات المرتبطة -NoLinkFound=لا يوجد روابط مسجلة -LinkComplete=تم ربط الملف بنجاح -ErrorFileNotLinked=لا يمكن ربط الملف -LinkRemoved= الرابط%sتم إزالتة -ErrorFailedToDeleteLink= فشل في إزالة الرابط ' %s ' -ErrorFailedToUpdateLink= فشل تحديث الرابط ' %s ' -URLToLink=عنوان URL للربط -OverwriteIfExists=إستبدال محتوى الملف إذا كان موجوداً diff --git a/htdocs/langs/ar_SY/link.lang b/htdocs/langs/ar_SY/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/ar_SY/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/az_AZ/link.lang b/htdocs/langs/az_AZ/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/az_AZ/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/bg_BG/link.lang b/htdocs/langs/bg_BG/link.lang deleted file mode 100644 index c513bbfbbbe..00000000000 --- a/htdocs/langs/bg_BG/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Свързване на нов файл / документ -LinkedFiles=Свързани файлове и документи -NoLinkFound=Няма регистрирани връзки -LinkComplete=Файлът е успешно свързан -ErrorFileNotLinked=Файлът не може да бъде свързан -LinkRemoved=Връзката %s е премахната -ErrorFailedToDeleteLink= Премахването на връзката '%s' не е успешно -ErrorFailedToUpdateLink= Актуализацията на връзката '%s' не е успешна -URLToLink=URL адрес -OverwriteIfExists=Презаписване на файл, ако съществува diff --git a/htdocs/langs/bn_BD/link.lang b/htdocs/langs/bn_BD/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/bn_BD/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/bn_IN/link.lang b/htdocs/langs/bn_IN/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/bn_IN/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/bs_BA/link.lang b/htdocs/langs/bs_BA/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/bs_BA/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/ca_ES/link.lang b/htdocs/langs/ca_ES/link.lang deleted file mode 100644 index 60bb39b3786..00000000000 --- a/htdocs/langs/ca_ES/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Enllaça un nou arxiu/document -LinkedFiles=Arxius i documents enllaçats -NoLinkFound=No hi ha enllaços registrats -LinkComplete=L'arxiu s'ha enllaçat correctament -ErrorFileNotLinked=L'arxiu no s'ha enllaçat -LinkRemoved=L'enllaç %s s'ha eliminat -ErrorFailedToDeleteLink= Error en eliminar l'enllaç '%s' -ErrorFailedToUpdateLink= Error en actualitzar l'enllaç '%s' -URLToLink=URL a enllaçar -OverwriteIfExists=Sobreescriu el fitxer si existeix diff --git a/htdocs/langs/cs_CZ/link.lang b/htdocs/langs/cs_CZ/link.lang deleted file mode 100644 index 310b3935630..00000000000 --- a/htdocs/langs/cs_CZ/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Připojit nový soubor/dokument -LinkedFiles=Připojené soubory a dokumenty -NoLinkFound=Žádné odkazy -LinkComplete=Soubor byl úspěšně připojen -ErrorFileNotLinked=Soubor nemohl být připojen -LinkRemoved=Odkaz %s byl odstraněn -ErrorFailedToDeleteLink= Nepodařilo se odstranit odkaz '%s' -ErrorFailedToUpdateLink= Nepodařilo se aktualizovat odkaz '%s' -URLToLink=Připojit URL -OverwriteIfExists=Pokud existuje, přepište soubor diff --git a/htdocs/langs/cy_GB/link.lang b/htdocs/langs/cy_GB/link.lang deleted file mode 100644 index 2cdbc0e3d5b..00000000000 --- a/htdocs/langs/cy_GB/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Cysylltwch ffeil/dogfen newydd -LinkedFiles=Ffeiliau a dogfennau cysylltiedig -NoLinkFound=Dim dolenni cofrestredig -LinkComplete=Mae'r ffeil wedi'i chysylltu'n llwyddiannus -ErrorFileNotLinked=Nid oedd modd cysylltu'r ffeil -LinkRemoved=Mae'r cyswllt %s wedi'i ddileu -ErrorFailedToDeleteLink= Wedi methu tynnu dolen ' %s ' -ErrorFailedToUpdateLink= Wedi methu diweddaru'r ddolen ' %s ' -URLToLink=URL i'r ddolen -OverwriteIfExists=Trosysgrifo ffeil os yw'n bodoli diff --git a/htdocs/langs/da_DK/link.lang b/htdocs/langs/da_DK/link.lang deleted file mode 100644 index 8f538298baf..00000000000 --- a/htdocs/langs/da_DK/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link en ny fil / et dokument -LinkedFiles=Sammenkædede filer og dokumenter -NoLinkFound=Ingen registrerede links -LinkComplete=Filen er blevet linket korrekt -ErrorFileNotLinked=Filen kunne ikke forbindes -LinkRemoved=Linket %s er blevet fjernet -ErrorFailedToDeleteLink= Kunne ikke fjerne linket ' %s ' -ErrorFailedToUpdateLink= Kunne ikke opdatere linket ' %s ' -URLToLink=URL til link -OverwriteIfExists=Overskriv fil, hvis den findes diff --git a/htdocs/langs/de_CH/link.lang b/htdocs/langs/de_CH/link.lang deleted file mode 100644 index db7e1395400..00000000000 --- a/htdocs/langs/de_CH/link.lang +++ /dev/null @@ -1,5 +0,0 @@ -# Dolibarr language file - Source file is en_US - link -LinkANewFile=Verknüpfe eine neue Datei /Dokument -LinkComplete=Die Datei wurde erfolgreich verlinkt -ErrorFileNotLinked=Die Datei konnte nicht verlinkt werden -URLToLink=URL zum Verlinken diff --git a/htdocs/langs/de_DE/link.lang b/htdocs/langs/de_DE/link.lang deleted file mode 100644 index e66eb1bdf6f..00000000000 --- a/htdocs/langs/de_DE/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Neue Verknüpfung erstellen -LinkedFiles=Verknüpfte Dateien -NoLinkFound=Keine verknüpften Links -LinkComplete=Die Datei wurde erfolgreich verlinkt. -ErrorFileNotLinked=Die Datei konnte nicht verlinkt werden. -LinkRemoved=Der Link %s wurde entfernt -ErrorFailedToDeleteLink= Fehler beim entfernen des Links '%s' -ErrorFailedToUpdateLink= Fehler beim aktualisieren des Link '%s' -URLToLink=zu verlinkende URL -OverwriteIfExists=Datei überschreiben, falls vorhanden diff --git a/htdocs/langs/el_GR/link.lang b/htdocs/langs/el_GR/link.lang deleted file mode 100644 index 1057e624b10..00000000000 --- a/htdocs/langs/el_GR/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Συνδέστε ένα νέο αρχείο / έγγραφο -LinkedFiles=Συνδεδεμένα αρχεία και έγγραφα -NoLinkFound=Δεν υπάρχουν εγγεγραμμένοι σύνδεσμοι -LinkComplete=Το αρχείο έχει συνδεθεί με επιτυχία -ErrorFileNotLinked=Το αρχείο δεν μπορεί να συνδεθεί -LinkRemoved=Ο σύνδεσμος %s έχει αφαιρεθεί -ErrorFailedToDeleteLink= Απέτυχε η αφαίρεση του συνδέσμου '%s' -ErrorFailedToUpdateLink= Απέτυχε η ενημέρωση του σύνδεσμο '%s' -URLToLink=Διεύθυνση URL για σύνδεση -OverwriteIfExists=Επανεγγραφή αρχείου εάν υπάρχει diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index abdbdbed6a1..07d97bb967f 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -180,4 +180,5 @@ BrowserPush=Browser Popup Notification Reminders=Reminders ActiveByDefault=Enabled by default Until=until -DataFromWasMerged=Data from %s was merged \ No newline at end of file +DataFromWasMerged=Data from %s was merged +AgendaShowBookcalCalendar=Booking calendar: %s \ No newline at end of file diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 19b17a73dff..871d9a72809 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -1,5 +1,5 @@ # Dolibarr language file - Source file is en_US - companies -newSocieteAdded=Your contact has been recorded. We will go back to you soon... +newSocieteAdded=Your contact details have been recorded. We will get back to you soon... ContactUsDesc=This form allows you to send us a message for a first contact. ErrorCompanyNameAlreadyExists=Company name %s already exists. Choose another one. ErrorSetACountryFirst=Set the country first diff --git a/htdocs/langs/en_US/ecm.lang b/htdocs/langs/en_US/ecm.lang index c10f3a088b7..941977b3e40 100644 --- a/htdocs/langs/en_US/ecm.lang +++ b/htdocs/langs/en_US/ecm.lang @@ -45,7 +45,7 @@ ExtraFieldsEcmFiles=Extrafields Ecm Files ExtraFieldsEcmDirectories=Extrafields Ecm Directories ECMSetup=ECM Setup GenerateImgWebp=Duplicate all images with another version with .webp format -ConfirmGenerateImgWebp=If you confirm, you will generate an image in .webp format for all images currently into this folder (subfolders are not included)... +ConfirmGenerateImgWebp=If you confirm, you will generate an image in .webp format for all images currently into this folder (subfolders are not included, webp images will not be generated if size is greater than original)... ConfirmImgWebpCreation=Confirm all images duplication GenerateChosenImgWebp=Duplicate chosen image with another version with .webp format ConfirmGenerateChosenImgWebp=If you confirm, you will generate an image in .webp format for the image %s diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index a4546054f65..058dc422b81 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -363,6 +363,7 @@ WarningModuleNeedRefrech = Module %s has been disabled. Don't forget to e WarningPermissionAlreadyExist=Existing permissions for this object WarningGoOnAccountancySetupToAddAccounts=If this list is empty, go into menu %s - %s - %s to load or create accounts for your chart of account. WarningCorrectedInvoiceNotFound=Corrected invoice not found +WarningCommentNotFound=Please check placement of start and end comments for %s section in file %s before submitting your action SwissQrOnlyVIR = SwissQR invoice can only be added on invoices set to be paid with credit transfer payments. SwissQrCreditorAddressInvalid = Creditor address is invalid (are ZIP and city set? (%s) diff --git a/htdocs/langs/en_US/link.lang b/htdocs/langs/en_US/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/en_US/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index d6f21c973a1..b20aee98e69 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1239,3 +1239,13 @@ DateOfPrinting=Date of printing ClickFullScreenEscapeToLeave=Click here to switch in Full screen mode. Press ESCAPE to leave Full screen mode. UserNotYetValid=Not yet valid UserExpired=Expired +LinkANewFile=Link a new file/document +LinkedFiles=Linked files and documents +NoLinkFound=No registered links +LinkComplete=The file has been linked successfully +ErrorFileNotLinked=The file could not be linked +LinkRemoved=The link %s has been removed +ErrorFailedToDeleteLink= Failed to remove link '%s' +ErrorFailedToUpdateLink= Failed to update link '%s' +URLToLink=URL to link +OverwriteIfExists=Overwrite if file exists diff --git a/htdocs/langs/es_AR/link.lang b/htdocs/langs/es_AR/link.lang deleted file mode 100644 index 3dbd72adba5..00000000000 --- a/htdocs/langs/es_AR/link.lang +++ /dev/null @@ -1,10 +0,0 @@ -# Dolibarr language file - Source file is en_US - link -LinkANewFile=Enlazar a un nuevo archivo/documento -LinkedFiles=Archivos y documentos enlazados -NoLinkFound=No hay enlaces registrados -LinkComplete=El archivo se ha enlazado correctamente -ErrorFileNotLinked=El archivo no pudo ser enlazado -LinkRemoved=El enlace %s ha sido eliminado -ErrorFailedToDeleteLink=Error al eliminar el enlace '%s' -ErrorFailedToUpdateLink=Error al actualizar enlace '%s' -URLToLink=URL del enlace diff --git a/htdocs/langs/es_CL/link.lang b/htdocs/langs/es_CL/link.lang deleted file mode 100644 index b3f562fac79..00000000000 --- a/htdocs/langs/es_CL/link.lang +++ /dev/null @@ -1,10 +0,0 @@ -# Dolibarr language file - Source file is en_US - link -LinkANewFile=Enlace un nuevo archivo / documento -LinkedFiles=Links archivos y documentos -NoLinkFound=No hay enlaces registrados -LinkComplete=El archivo ha sido vinculado exitosamente -ErrorFileNotLinked=El archivo no pudo ser vinculado -LinkRemoved=El enlace %s ha sido eliminado -ErrorFailedToDeleteLink=Error al eliminar el enlace '%s' -ErrorFailedToUpdateLink=Error al actualizar el enlace '%s' -URLToLink=URL para enlazar diff --git a/htdocs/langs/es_CO/link.lang b/htdocs/langs/es_CO/link.lang deleted file mode 100644 index 3f1aa9375e2..00000000000 --- a/htdocs/langs/es_CO/link.lang +++ /dev/null @@ -1,9 +0,0 @@ -# Dolibarr language file - Source file is en_US - link -LinkANewFile=Vincular un nuevo archivo / documento -NoLinkFound=No hay enlaces registrados -LinkComplete=El archivo se ha vinculado correctamente -ErrorFileNotLinked=El archivo no se pudo vincular -LinkRemoved=El enlace %s ha sido eliminado -ErrorFailedToDeleteLink=Error al eliminar el enlace ' %s ' -ErrorFailedToUpdateLink=Error al actualizar el enlace ' %s ' -URLToLink=URL para vincular diff --git a/htdocs/langs/es_CR/link.lang b/htdocs/langs/es_CR/link.lang deleted file mode 100644 index 1c76a193ca7..00000000000 --- a/htdocs/langs/es_CR/link.lang +++ /dev/null @@ -1,8 +0,0 @@ -# Dolibarr language file - Source file is en_US - link -NoLinkFound=No hay enlaces registrados -LinkComplete=El archivo se ha vinculado con éxito. -ErrorFileNotLinked=No se pudo vincular el archivo -LinkRemoved=El enlace %s ha sido eliminado -ErrorFailedToDeleteLink=Error al eliminar el enlace ' %s ' -ErrorFailedToUpdateLink=Error al actualizar el enlace ' %s ' -URLToLink=URL para vincular diff --git a/htdocs/langs/es_CU/link.lang b/htdocs/langs/es_CU/link.lang deleted file mode 100644 index 7740f83bf62..00000000000 --- a/htdocs/langs/es_CU/link.lang +++ /dev/null @@ -1,7 +0,0 @@ -# Dolibarr language file - Source file is en_US - link -LinkComplete=El archivo se ha vinculado con éxito. -ErrorFileNotLinked=No se pudo vincular el archivo -LinkRemoved=El enlace %s ha sido eliminado -ErrorFailedToDeleteLink=Error al eliminar el enlace ' %s ' -ErrorFailedToUpdateLink=Error al actualizar el enlace ' %s ' -URLToLink=URL para vincular diff --git a/htdocs/langs/es_EC/link.lang b/htdocs/langs/es_EC/link.lang deleted file mode 100644 index 0ad5de1e897..00000000000 --- a/htdocs/langs/es_EC/link.lang +++ /dev/null @@ -1,8 +0,0 @@ -# Dolibarr language file - Source file is en_US - link -LinkedFiles=Archivos enlazados y documentos -NoLinkFound=No hay enlaces registrados -LinkComplete=El archivo se ha vinculado correctamente -ErrorFileNotLinked=No se pudo vincular el archivo. -LinkRemoved=Se ha eliminado el enlace %s -ErrorFailedToDeleteLink=No se pudo eliminar el vínculo '%s' -URLToLink=URL para vincular diff --git a/htdocs/langs/es_ES/link.lang b/htdocs/langs/es_ES/link.lang deleted file mode 100644 index feb76151fde..00000000000 --- a/htdocs/langs/es_ES/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Vincular un nuevo archivo/documento -LinkedFiles=Archivos y documentos vinculados -NoLinkFound=Sin enlaces registrados -LinkComplete=El archivo ha sido vinculado correctamente -ErrorFileNotLinked=El archivo no ha podido ser vinculado -LinkRemoved=El vínculo %s ha sido eliminado -ErrorFailedToDeleteLink= Error al eliminar el vínculo '%s' -ErrorFailedToUpdateLink= Error al actualizar el vínculo '%s' -URLToLink=URL a enlazar -OverwriteIfExists=Sobrescribir archivo si existe diff --git a/htdocs/langs/es_MX/link.lang b/htdocs/langs/es_MX/link.lang deleted file mode 100644 index b97dcbc1a69..00000000000 --- a/htdocs/langs/es_MX/link.lang +++ /dev/null @@ -1,10 +0,0 @@ -# Dolibarr language file - Source file is en_US - link -LinkANewFile=Vincular un nuevo archivo / documento -LinkedFiles=Archivos enlazados y documentos -NoLinkFound=No hay enlaces registrados -LinkComplete=El archivo se ha vinculado correctamente -ErrorFileNotLinked=No se pudo vincular el archivo. -LinkRemoved=Se ha eliminado el enlace %s -ErrorFailedToDeleteLink=No se pudo eliminar el vínculo ' %s ' -ErrorFailedToUpdateLink=Error al actualizar el vínculo ' %s ' -URLToLink=URL para vincular diff --git a/htdocs/langs/et_EE/link.lang b/htdocs/langs/et_EE/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/et_EE/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/eu_ES/link.lang b/htdocs/langs/eu_ES/link.lang deleted file mode 100644 index d3a0fc9370e..00000000000 --- a/htdocs/langs/eu_ES/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Fitxategi/dokumentu berria estekatu -LinkedFiles=Estekatutako fitxategi eta dokumentuak -NoLinkFound=Ez dago gordetako estekarik -LinkComplete=Fitxategia ondo estekatu da -ErrorFileNotLinked=Ezin izan da fitxategia estekatu -LinkRemoved=%s esteka ezabatua izan da -ErrorFailedToDeleteLink= Ezin izan da '%s' esteka ezabatu -ErrorFailedToUpdateLink= Ezin izan da '%s' esteka berritu -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/fa_IR/link.lang b/htdocs/langs/fa_IR/link.lang deleted file mode 100644 index 012040c2baa..00000000000 --- a/htdocs/langs/fa_IR/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=پیوند یک فایل/سند -LinkedFiles=اسناد و فایل‌های مرتبط -NoLinkFound=پیوند ثبت‌شده‌ای وجود ندارد -LinkComplete=فایل با موفقیت پیوند شد -ErrorFileNotLinked=امکان پیوند فایل وجود ندارد -LinkRemoved=پیوند %s برداشته شد -ErrorFailedToDeleteLink= امکان حذف پیوند '%s' نبود -ErrorFailedToUpdateLink= امکان روزآمدسازی پیوند '%s' نبود -URLToLink=نشانی برای پیوند کردن -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/fi_FI/link.lang b/htdocs/langs/fi_FI/link.lang deleted file mode 100644 index 62802ede960..00000000000 --- a/htdocs/langs/fi_FI/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Luo uusi linkki tiedostoon/dokumenttiin -LinkedFiles=Linkitetyt tiedostot ja dokumentit -NoLinkFound=Rekisteröityjä linkkejä ei ole -LinkComplete=Tiedosto on linkitetty onnistuneesti -ErrorFileNotLinked=Tiedostoa ei voitu linkittää -LinkRemoved=%s linkki on poistettu -ErrorFailedToDeleteLink= Linkin '%s' poisto ei onnistunut -ErrorFailedToUpdateLink= Linkin '%s' päivitys ei onnistunut -URLToLink=URL linkiksi -OverwriteIfExists=Korvaa tiedosto jos olemassa diff --git a/htdocs/langs/fr_CA/link.lang b/htdocs/langs/fr_CA/link.lang deleted file mode 100644 index 8acd890c9a0..00000000000 --- a/htdocs/langs/fr_CA/link.lang +++ /dev/null @@ -1,6 +0,0 @@ -# Dolibarr language file - Source file is en_US - link -LinkANewFile=Relier un nouveau fichier / document -NoLinkFound=Pas de liens enregistrés -LinkComplete=Le fichier a été lié avec succès -ErrorFailedToDeleteLink=Impossible d'enlever le lien '%s' -ErrorFailedToUpdateLink=Impossible de mettre à jour le lien '%s' diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index 655c22e31ba..41ca1f5c7f0 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -363,6 +363,7 @@ WarningModuleNeedRefrech = Le module %s a été désactivé. N'oubliez pa WarningPermissionAlreadyExist=Autorisations existantes pour cet objet WarningGoOnAccountancySetupToAddAccounts=Si cette liste est vide, allez dans le menu %s - %s - %s pour charger ou créer des comptes pour votre plan comptable. WarningCorrectedInvoiceNotFound=Facture corrigée introuvable +WarningCommentNotFound=Verifier l'emplacement des commentaires debut et fin pour la section %s dans le fichier %s avant de soumettre votre action SwissQrOnlyVIR = La facture SwissQR ne peut être ajoutée que sur les factures définies pour être payées avec des paiements par virement. SwissQrCreditorAddressInvalid = L'adresse du créancier n'est pas valide (le code postal et la ville sont-ils définis ? (%s) diff --git a/htdocs/langs/fr_FR/link.lang b/htdocs/langs/fr_FR/link.lang deleted file mode 100644 index 4534b8420e7..00000000000 --- a/htdocs/langs/fr_FR/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Lier un nouveau fichier/document -LinkedFiles=Fichiers et documents liés -NoLinkFound=Aucun lien associé -LinkComplete=Le fichier a été correctement lié -ErrorFileNotLinked=Le fichier n'a pas pu être lié -LinkRemoved=Le lien %s a été supprimé -ErrorFailedToDeleteLink= Impossible de supprimer le lien '%s' -ErrorFailedToUpdateLink= Impossible de modifier le lien '%s' -URLToLink=URL à lier -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/gl_ES/link.lang b/htdocs/langs/gl_ES/link.lang deleted file mode 100644 index 4815cf15e64..00000000000 --- a/htdocs/langs/gl_ES/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Ligar un novo ficheiro/documento -LinkedFiles=Ficheiros e documentos ligados -NoLinkFound=Sen ligazóns registrados -LinkComplete=O ficheiro foi ligado correctamente -ErrorFileNotLinked=O ficheiro non puido ser ligado -LinkRemoved=A ligazón %s foi eliminada -ErrorFailedToDeleteLink= Erro ao eliminar a ligazón '%s' -ErrorFailedToUpdateLink= Erro ao actualizar a ligazón '%s' -URLToLink=URL a ligar -OverwriteIfExists=Sobrescribir ficheiro se existe diff --git a/htdocs/langs/he_IL/link.lang b/htdocs/langs/he_IL/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/he_IL/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/hi_IN/link.lang b/htdocs/langs/hi_IN/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/hi_IN/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/hr_HR/link.lang b/htdocs/langs/hr_HR/link.lang deleted file mode 100644 index ee140b37440..00000000000 --- a/htdocs/langs/hr_HR/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Poveži novu datoteku/dokument -LinkedFiles=Povezane datoteke i dokumenti -NoLinkFound=Nema registriranih veza -LinkComplete=Datoteka je uspješno povezana -ErrorFileNotLinked=Datoteku je nemoguće povezati -LinkRemoved=Veza %s je obrisana -ErrorFailedToDeleteLink= Neuspješno brisanje veze '%s' -ErrorFailedToUpdateLink= Neuspješna promjena veze '%s' -URLToLink=URL prema vezi -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/hu_HU/link.lang b/htdocs/langs/hu_HU/link.lang deleted file mode 100644 index 05653373fbd..00000000000 --- a/htdocs/langs/hu_HU/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Új fájl/dokumentum hivatkozása -LinkedFiles=Hivatkozott fájlok és dokumentumok -NoLinkFound=Nincs mentett hivatkozás -LinkComplete=A fájlra történt hivatkozás sikerült -ErrorFileNotLinked=A fájlra nem lehet hivatkozni -LinkRemoved=A %s hivatkozás törölve -ErrorFailedToDeleteLink= A '%s' hivakozás törlése sikertelen -ErrorFailedToUpdateLink= A '%s' hivakozás frissítése sikertelen -URLToLink=A hivatkozás címe -OverwriteIfExists=Fájl felülírása, ha létezik diff --git a/htdocs/langs/id_ID/link.lang b/htdocs/langs/id_ID/link.lang deleted file mode 100644 index 4b6d73e7c52..00000000000 --- a/htdocs/langs/id_ID/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Tautan untuk berkas/dokumen baru -LinkedFiles=Tautan berkas dan dokumen -NoLinkFound=Link tidak terdaftar -LinkComplete=Berkas telah berhasil ditautkan -ErrorFileNotLinked=Berkas tidak dapat ditautkan -LinkRemoved=Tautan %s telah dihapus -ErrorFailedToDeleteLink= gagal untuk menghapus tautan '%s' -ErrorFailedToUpdateLink= Gagal untuk memperbaharui tautan '%s' -URLToLink=URL untuk ditautkan -OverwriteIfExists=Timpa file jika ada diff --git a/htdocs/langs/is_IS/link.lang b/htdocs/langs/is_IS/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/is_IS/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/it_IT/link.lang b/htdocs/langs/it_IT/link.lang deleted file mode 100644 index 551802192d1..00000000000 --- a/htdocs/langs/it_IT/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Collega un nuovo file/documento -LinkedFiles=File e documenti collegati -NoLinkFound=Nessun collegamento registrato -LinkComplete=Il file è stato correttamente collegato -ErrorFileNotLinked=Il file non può essere collegato -LinkRemoved=Il collegamento %s è stato rimosso -ErrorFailedToDeleteLink= Impossibile rimuovere il collegamento '%s' -ErrorFailedToUpdateLink= Impossibile caricare il collegamento '%s' -URLToLink=Indirizzo del link -OverwriteIfExists=Sovrascrivi file se esiste diff --git a/htdocs/langs/ja_JP/link.lang b/htdocs/langs/ja_JP/link.lang deleted file mode 100644 index 71b9e42f923..00000000000 --- a/htdocs/langs/ja_JP/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=新規ファイル/ドキュメントをリンクする -LinkedFiles=ファイルとドキュメントをリンクした -NoLinkFound=リンクは登録されていない -LinkComplete=ファイルを正常にリンクした -ErrorFileNotLinked=ファイルをリンクできなかった -LinkRemoved=リンク %s が削除された -ErrorFailedToDeleteLink= リンク '%s' を削除できなかった -ErrorFailedToUpdateLink= リンク '%s' を更新できなかった -URLToLink=リンクの URL -OverwriteIfExists=存在する場合はファイルを上書きする diff --git a/htdocs/langs/ka_GE/link.lang b/htdocs/langs/ka_GE/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/ka_GE/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/kk_KZ/link.lang b/htdocs/langs/kk_KZ/link.lang deleted file mode 100644 index 5ef5de861ec..00000000000 --- a/htdocs/langs/kk_KZ/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Жаңа файлды/құжатты байланыстырыңыз -LinkedFiles=Байланысты файлдар мен құжаттар -NoLinkFound=Тіркелген сілтемелер жоқ -LinkComplete=Файл сәтті байланыстырылды -ErrorFileNotLinked=Файлды байланыстыру мүмкін болмады -LinkRemoved=%s сілтемесі жойылды -ErrorFailedToDeleteLink= ' %s ' сілтемесі жойылмады -ErrorFailedToUpdateLink= ' %s ' сілтемесі жаңартылмады -URLToLink=Сілтеме үшін URL -OverwriteIfExists=Егер бар болса, файлды қайта жазыңыз diff --git a/htdocs/langs/km_KH/link.lang b/htdocs/langs/km_KH/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/km_KH/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/kn_IN/link.lang b/htdocs/langs/kn_IN/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/kn_IN/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/ko_KR/link.lang b/htdocs/langs/ko_KR/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/ko_KR/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/lo_LA/link.lang b/htdocs/langs/lo_LA/link.lang deleted file mode 100644 index 80f013d66bd..00000000000 --- a/htdocs/langs/lo_LA/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=ເຊື່ອມໂຍງໄຟລ//ເອກະສານໃ່ -LinkedFiles=ໄຟລ Linked ແລະເອກະສານທີ່ເຊື່ອມໂຍງ -NoLinkFound=ບໍ່ມີລິ້ງເຊື່ອມຕໍ່ທີ່ລົງທະບຽນ -LinkComplete=ໄຟລ has ໄດ້ຖືກເຊື່ອມຕໍ່ ສຳ ເລັດແລ້ວ -ErrorFileNotLinked=ບໍ່ສາມາດເຊື່ອມໂຍງໄຟລໄດ້ -LinkRemoved=ລິ້ງ %s ໄດ້ຖືກລຶບອອກແລ້ວ -ErrorFailedToDeleteLink= ລຶບລິ້ງ ' %s ບໍ່ ສຳ ເລັດ' -ErrorFailedToUpdateLink= ອັບເດດລິ້ງ ' %s ບໍ່ ສຳ ເລັດ' -URLToLink=URL ເພື່ອເຊື່ອມຕໍ່ -OverwriteIfExists=ຂຽນທັບໄຟລ if ຖ້າມີ diff --git a/htdocs/langs/lt_LT/link.lang b/htdocs/langs/lt_LT/link.lang deleted file mode 100644 index c9e19c70173..00000000000 --- a/htdocs/langs/lt_LT/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Susieti naują filą / dokumentą -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Nesėkmingas sąsajos '%s' atnaujinimas -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/lv_LV/link.lang b/htdocs/langs/lv_LV/link.lang deleted file mode 100644 index e649eb2874b..00000000000 --- a/htdocs/langs/lv_LV/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Salinkot jaunu failu/dokumentu -LinkedFiles=Salinkotie faili un dokumenti -NoLinkFound=Nav reģistrētas saites -LinkComplete=Fails veiksmīgi salinkots -ErrorFileNotLinked=Failu nevar salinkot -LinkRemoved=Saite %s tika dzēsta -ErrorFailedToDeleteLink= Kļūda dzēšot saiti '%s' -ErrorFailedToUpdateLink= Kļūda atjaunojot saiti '%s' -URLToLink=Saites uz URL -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/mk_MK/link.lang b/htdocs/langs/mk_MK/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/mk_MK/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/mn_MN/link.lang b/htdocs/langs/mn_MN/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/mn_MN/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/ms_MY/link.lang b/htdocs/langs/ms_MY/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/ms_MY/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/my_MM/link.lang b/htdocs/langs/my_MM/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/my_MM/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/nb_NO/link.lang b/htdocs/langs/nb_NO/link.lang deleted file mode 100644 index d8f4d669605..00000000000 --- a/htdocs/langs/nb_NO/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Koble en ny fil/dokument -LinkedFiles=Koblede filer og dokumenter -NoLinkFound=Ingen registrerte koblinger -LinkComplete=Filkoblingen ble opprettet -ErrorFileNotLinked=Filen kunne ikke kobles -LinkRemoved=Koblingen til %s ble fjernet -ErrorFailedToDeleteLink= Klarte ikke å fjerne kobling'%s' -ErrorFailedToUpdateLink= Klarte ikke å oppdatere koblingen til '%s' -URLToLink=URL til link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/ne_NP/link.lang b/htdocs/langs/ne_NP/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/ne_NP/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/nl_NL/link.lang b/htdocs/langs/nl_NL/link.lang deleted file mode 100644 index 3b82167aab4..00000000000 --- a/htdocs/langs/nl_NL/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Koppel een nieuw bestand/document -LinkedFiles=Gekoppelde bestanden en documenten -NoLinkFound=Geen geregistreerde koppelingen -LinkComplete=Het bestand is succesvol gekoppeld -ErrorFileNotLinked=Het bestand kon niet gekoppeld worden -LinkRemoved=De koppeling %s is verwijderd -ErrorFailedToDeleteLink= Kon de verbinding '%s' niet verwijderen -ErrorFailedToUpdateLink= Kon verbinding '%s' niet bijwerken -URLToLink=URL naar link -OverwriteIfExists=Overschrijf bestand indien aanwezig diff --git a/htdocs/langs/pl_PL/link.lang b/htdocs/langs/pl_PL/link.lang deleted file mode 100644 index f067994f757..00000000000 --- a/htdocs/langs/pl_PL/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Podepnij nowy plik/dokument -LinkedFiles=Podpięte pliki i dokumenty -NoLinkFound=Brak zarejestrowanych linków -LinkComplete=Plik został podlinkowany poprawnie -ErrorFileNotLinked=Plik nie mógł zostać podlinkowany -LinkRemoved=Link %s został usunięty -ErrorFailedToDeleteLink= Niemożna usunąc linku '%s' -ErrorFailedToUpdateLink= Niemożna uaktualnić linku '%s' -URLToLink=Adres URL linka -OverwriteIfExists=Zastąp plik, jeśli istnieje diff --git a/htdocs/langs/pt_BR/link.lang b/htdocs/langs/pt_BR/link.lang deleted file mode 100644 index f86a13d83c3..00000000000 --- a/htdocs/langs/pt_BR/link.lang +++ /dev/null @@ -1,10 +0,0 @@ -# Dolibarr language file - Source file is en_US - link -LinkANewFile=Vincular um novo arquivo/documento -LinkedFiles=Arquivos vinculados e documentos -NoLinkFound=Não há links registrados -LinkComplete=O arquivo foi associada com sucesso -ErrorFileNotLinked=O arquivo não pôde ser vinculado -LinkRemoved=A ligação %s foi removida -ErrorFailedToDeleteLink=Falha ao remover link '%s' -ErrorFailedToUpdateLink=Falha ao atualizar link '%s' -URLToLink=URL para link diff --git a/htdocs/langs/pt_MZ/link.lang b/htdocs/langs/pt_MZ/link.lang deleted file mode 100644 index f86a13d83c3..00000000000 --- a/htdocs/langs/pt_MZ/link.lang +++ /dev/null @@ -1,10 +0,0 @@ -# Dolibarr language file - Source file is en_US - link -LinkANewFile=Vincular um novo arquivo/documento -LinkedFiles=Arquivos vinculados e documentos -NoLinkFound=Não há links registrados -LinkComplete=O arquivo foi associada com sucesso -ErrorFileNotLinked=O arquivo não pôde ser vinculado -LinkRemoved=A ligação %s foi removida -ErrorFailedToDeleteLink=Falha ao remover link '%s' -ErrorFailedToUpdateLink=Falha ao atualizar link '%s' -URLToLink=URL para link diff --git a/htdocs/langs/pt_PT/link.lang b/htdocs/langs/pt_PT/link.lang deleted file mode 100644 index 49a5aaaef43..00000000000 --- a/htdocs/langs/pt_PT/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Associar um novo ficheiro/documento -LinkedFiles=Ficheiros e documentos associados -NoLinkFound=Nenhumas ligações registadas -LinkComplete=Os ficheiros foram ligados com sucesso -ErrorFileNotLinked=Os ficheiros não puderam ser ligados -LinkRemoved=A hiperligação %s foi removida -ErrorFailedToDeleteLink= falhou a remoção da ligação '%s' -ErrorFailedToUpdateLink= Falha na atualização de ligação '%s' -URLToLink=URL para hiperligação -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/ro_RO/link.lang b/htdocs/langs/ro_RO/link.lang deleted file mode 100644 index 12147377aea..00000000000 --- a/htdocs/langs/ro_RO/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link fişier/document nou -LinkedFiles=Fişiere şi documente ataşate -NoLinkFound=Niciun link inregistrat -LinkComplete=Fişierul a fost ataşat cu succes -ErrorFileNotLinked=Fişierul nu a putut fi ataşat -LinkRemoved=Linkul %s a fost înlăturat -ErrorFailedToDeleteLink= Eşec la înlăturarea linkului '%s' -ErrorFailedToUpdateLink= Eşec la modificarea linkului '%s' -URLToLink=URL la link -OverwriteIfExists=Suprascrie dacă fişierul există diff --git a/htdocs/langs/ru_RU/link.lang b/htdocs/langs/ru_RU/link.lang deleted file mode 100644 index edfddc8994b..00000000000 --- a/htdocs/langs/ru_RU/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Создать ссылку на файл или документ -LinkedFiles=Ссылки на файлы и документы -NoLinkFound=Нет зарегистрированных ссылок -LinkComplete=Создана ссылка на файл -ErrorFileNotLinked=Не возможно создать ссылку на файл -LinkRemoved=Ссылка на файл %s удалена -ErrorFailedToDeleteLink= При удалении ссылки на файл '%s' возникла ошибка -ErrorFailedToUpdateLink= При обновлении ссылки на файл '%s' возникла ошибка -URLToLink=URL для ссылки -OverwriteIfExists=Перезаписать файл, если он существует diff --git a/htdocs/langs/sk_SK/link.lang b/htdocs/langs/sk_SK/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/sk_SK/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/sl_SI/link.lang b/htdocs/langs/sl_SI/link.lang deleted file mode 100644 index 8ec7ff7d758..00000000000 --- a/htdocs/langs/sl_SI/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Poveži novo datoteko/dokument -LinkedFiles=Povezane datoteke in dokumenti -NoLinkFound=Ni registriranih povezav -LinkComplete=Datoteka je bila uspešno povezana -ErrorFileNotLinked=Datoteke ni možno povezati -LinkRemoved=Povezava %s je bila odstranjena -ErrorFailedToDeleteLink= Napaka pri odstranitvi povezave '%s'. -ErrorFailedToUpdateLink= Napaka pri posodobitvi povezave '%s'. -URLToLink=URL za povezavo -OverwriteIfExists=Prepiši datoteko, če obstaja diff --git a/htdocs/langs/sq_AL/link.lang b/htdocs/langs/sq_AL/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/sq_AL/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/sr_RS/link.lang b/htdocs/langs/sr_RS/link.lang deleted file mode 100644 index 36e3aaf6aea..00000000000 --- a/htdocs/langs/sr_RS/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link ka novom fajlu/dokumentu -LinkedFiles=Linkovani fajlovi i dokumenti -NoLinkFound=Nema registrovanih linkova -LinkComplete=Fajl je uspešno linkovan -ErrorFileNotLinked=Fajl nije mogao biti linkovan -LinkRemoved=Link %s je uklonjen -ErrorFailedToDeleteLink= Greška prilikom uklanjanja linka '%s' -ErrorFailedToUpdateLink= Greška prilikom ažuriranja linka '%s' -URLToLink=URL za link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/sv_SE/link.lang b/htdocs/langs/sv_SE/link.lang deleted file mode 100644 index da38186f5b8..00000000000 --- a/htdocs/langs/sv_SE/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Länka en ny fil/dokument -LinkedFiles=Länkade filer och dokument -NoLinkFound=Inga registrerade länkar -LinkComplete=Filen har länkats -ErrorFileNotLinked=Filen kunde inte länkas -LinkRemoved=Länken %s har tagits bort -ErrorFailedToDeleteLink= Det gick inte att ta bort länk %s -ErrorFailedToUpdateLink= Det gick inte att uppdatera länken %s -URLToLink=URL för länk -OverwriteIfExists=Skriv över fil om den existerar diff --git a/htdocs/langs/sw_SW/link.lang b/htdocs/langs/sw_SW/link.lang deleted file mode 100644 index 4a4c19cb49c..00000000000 --- a/htdocs/langs/sw_SW/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Unganisha faili/hati mpya -LinkedFiles=Faili na hati zilizounganishwa -NoLinkFound=Hakuna viungo vilivyosajiliwa -LinkComplete=Faili imeunganishwa kwa mafanikio -ErrorFileNotLinked=Faili haikuweza kuunganishwa -LinkRemoved=Kiungo %s imeondolewa -ErrorFailedToDeleteLink= Imeshindwa kuondoa kiungo ' %s ' -ErrorFailedToUpdateLink= Imeshindwa kusasisha kiungo ' %s ' -URLToLink=URL ya kuunganisha -OverwriteIfExists=Batilisha faili ikiwa ipo diff --git a/htdocs/langs/ta_IN/link.lang b/htdocs/langs/ta_IN/link.lang deleted file mode 100644 index 177caf7ef14..00000000000 --- a/htdocs/langs/ta_IN/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=புதிய கோப்பு/ஆவணத்தை இணைக்கவும் -LinkedFiles=இணைக்கப்பட்ட கோப்புகள் மற்றும் ஆவணங்கள் -NoLinkFound=பதிவு செய்யப்பட்ட இணைப்புகள் இல்லை -LinkComplete=கோப்பு வெற்றிகரமாக இணைக்கப்பட்டது -ErrorFileNotLinked=கோப்பை இணைக்க முடியவில்லை -LinkRemoved=%s இணைப்பு அகற்றப்பட்டது -ErrorFailedToDeleteLink= ' %s ' இணைப்பை அகற்ற முடியவில்லை -ErrorFailedToUpdateLink= ' %s ' இணைப்பைப் புதுப்பிக்க முடியவில்லை -URLToLink=இணைக்க வேண்டிய URL -OverwriteIfExists=கோப்பு இருந்தால் மேலெழுதவும் diff --git a/htdocs/langs/tg_TJ/link.lang b/htdocs/langs/tg_TJ/link.lang deleted file mode 100644 index d9f2ddbfd93..00000000000 --- a/htdocs/langs/tg_TJ/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Файл/ҳуҷҷати навро пайванд кунед -LinkedFiles=Ҳуҷҷатҳо ва файлҳои алоқаманд -NoLinkFound=Истинодҳои ба қайд гирифташуда вуҷуд надоранд -LinkComplete=Файл бомуваффақият пайваст карда шуд -ErrorFileNotLinked=Файлро пайванд кардан ғайриимкон буд -LinkRemoved=Истиноди %s хориҷ карда шуд -ErrorFailedToDeleteLink= Истиноди ' %s ' хориҷ карда нашуд -ErrorFailedToUpdateLink= Истиноди ' %s ' навсозӣ карда нашуд -URLToLink=URL барои пайванд -OverwriteIfExists=Агар мавҷуд бошад, файлро аз нав сабт кунед diff --git a/htdocs/langs/th_TH/link.lang b/htdocs/langs/th_TH/link.lang deleted file mode 100644 index 7a1e16ba362..00000000000 --- a/htdocs/langs/th_TH/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=เชื่อมโยงไฟล์ใหม่ / เอกสาร -LinkedFiles=แฟ้มที่เชื่อมโยงและเอกสาร -NoLinkFound=ไม่มีการเชื่อมโยงลงทะเบียน -LinkComplete=ไฟล์ที่ได้รับการประสบความสำเร็จในการเชื่อมโยง -ErrorFileNotLinked=ไฟล์ไม่สามารถเชื่อมโยง -LinkRemoved=การเชื่อมโยง% s ได้ถูกลบออก -ErrorFailedToDeleteLink= ล้มเหลวในการลบการเชื่อมโยง '% s' -ErrorFailedToUpdateLink= ล้มเหลวในการปรับปรุงการเชื่อมโยง '% s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/tr_TR/link.lang b/htdocs/langs/tr_TR/link.lang deleted file mode 100644 index 646d610a408..00000000000 --- a/htdocs/langs/tr_TR/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Yeni bir dosya/belge bağlantıla -LinkedFiles=Bağlantılı dosyalar ve belgeler -NoLinkFound=Kayıtlı bağlantı yok -LinkComplete=Dosya bağlantısı başarılı -ErrorFileNotLinked=Dosya bağlantılanamadı -LinkRemoved=%s bağlantısı kaldırıldı -ErrorFailedToDeleteLink= '%s' bağlantısı kaldırılamadı -ErrorFailedToUpdateLink= '%s' bağlantısı güncellenemedi -URLToLink=Bağlantılanalıcak URL -OverwriteIfExists=Dosya varsa üzerine yaz diff --git a/htdocs/langs/uk_UA/link.lang b/htdocs/langs/uk_UA/link.lang deleted file mode 100644 index 8fde3beae63..00000000000 --- a/htdocs/langs/uk_UA/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Зв’язати новий файл/документ -LinkedFiles=Пов’язані файли та документи -NoLinkFound=Немає зареєстрованих посилань -LinkComplete=Файл успішно пов’язано -ErrorFileNotLinked=Не вдалося зв’язати файл -LinkRemoved=Посилання %s видалено -ErrorFailedToDeleteLink= Не вдалося видалити посилання " %s " -ErrorFailedToUpdateLink= Не вдалося оновити посилання " %s " -URLToLink=URL для посилання -OverwriteIfExists=Перезаписати файл, якщо він існує diff --git a/htdocs/langs/ur_PK/link.lang b/htdocs/langs/ur_PK/link.lang deleted file mode 100644 index 256f4dc462b..00000000000 --- a/htdocs/langs/ur_PK/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=ایک نئی فائل/دستاویز سے لنک کریں۔ -LinkedFiles=منسلک فائلیں اور دستاویزات -NoLinkFound=کوئی رجسٹرڈ لنکس نہیں۔ -LinkComplete=فائل کو کامیابی سے جوڑ دیا گیا ہے۔ -ErrorFileNotLinked=فائل کو لنک نہیں کیا جا سکا -LinkRemoved=لنک %s ہٹا دیا گیا ہے۔ -ErrorFailedToDeleteLink= لنک ' %s ' کو ہٹانے میں ناکام -ErrorFailedToUpdateLink= لنک ' %s ' کو اپ ڈیٹ کرنے میں ناکام -URLToLink=لنک کرنے کے لیے URL -OverwriteIfExists=اگر موجود ہو تو فائل کو اوور رائٹ کریں۔ diff --git a/htdocs/langs/uz_UZ/link.lang b/htdocs/langs/uz_UZ/link.lang deleted file mode 100644 index e37e7f0be18..00000000000 --- a/htdocs/langs/uz_UZ/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Yangi fayl / hujjatni bog'lang -LinkedFiles=Bog'langan fayllar va hujjatlar -NoLinkFound=Ro'yxatdan o'tgan havolalar yo'q -LinkComplete=Fayl muvaffaqiyatli ulandi -ErrorFileNotLinked=Faylni ulab bo‘lmadi -LinkRemoved=%s havolasi o'chirildi -ErrorFailedToDeleteLink= ' %s ' havolasi o'chirilmadi -ErrorFailedToUpdateLink= ' %s ' havolasi yangilanmadi -URLToLink=Ulanish uchun URL -OverwriteIfExists=Agar mavjud bo'lsa, faylni qayta yozing diff --git a/htdocs/langs/vi_VN/link.lang b/htdocs/langs/vi_VN/link.lang deleted file mode 100644 index bacbeaf98e2..00000000000 --- a/htdocs/langs/vi_VN/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Liên kết một tập tin / tài liệu mới -LinkedFiles=Các tập tin và tài liệu được liên kết -NoLinkFound=Không có liên kết đã đăng ký -LinkComplete=Các tập tin đã được liên kết thành công -ErrorFileNotLinked=Các tập tin không thể được liên kết -LinkRemoved=Liên kết %s đã bị xóa -ErrorFailedToDeleteLink= Không thể xóa liên kết ' %s ' -ErrorFailedToUpdateLink= Không thể cập nhật liên kết ' %s ' -URLToLink=URL để liên kết -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/zh_CN/link.lang b/htdocs/langs/zh_CN/link.lang deleted file mode 100644 index 00f14808c56..00000000000 --- a/htdocs/langs/zh_CN/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=链接一份新文件/文档 -LinkedFiles=链接文件和文档 -NoLinkFound=无注册链接 -LinkComplete=文件链接成功 -ErrorFileNotLinked=文件无法链接 -LinkRemoved=链接 %s 已移除 -ErrorFailedToDeleteLink= 移除链接失败 '%s' -ErrorFailedToUpdateLink= 更新链接失败 '%s' -URLToLink=URL网址超链接 -OverwriteIfExists=如果存在就覆盖文件 diff --git a/htdocs/langs/zh_HK/link.lang b/htdocs/langs/zh_HK/link.lang deleted file mode 100644 index 3205abcd1be..00000000000 --- a/htdocs/langs/zh_HK/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=鏈接新文件/文檔 -LinkedFiles=鏈接的文件和文檔 -NoLinkFound=沒有註冊鏈接 -LinkComplete=文件已鏈接成功 -ErrorFileNotLinked=該文件無法鏈接 -LinkRemoved=鏈接%s 已被刪除 -ErrorFailedToDeleteLink= 無法刪除鏈接“”\n %s ' -ErrorFailedToUpdateLink= 無法更新鏈接“”\n %s ' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/zh_TW/link.lang b/htdocs/langs/zh_TW/link.lang deleted file mode 100644 index 23949b86a29..00000000000 --- a/htdocs/langs/zh_TW/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=連接新文件/檔案 -LinkedFiles=連接新文件/檔案(複數) -NoLinkFound=沒有註冊連線 -LinkComplete=此文件已成功連接 -ErrorFileNotLinked=此文件無法連接 -LinkRemoved=此連線%s已被刪除 -ErrorFailedToDeleteLink= 無法刪除連線“ %s ” -ErrorFailedToUpdateLink= 無法更新連線' %s' -URLToLink=連線網址 -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 7e89129cdd7..c4f2d0b8bdd 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1085,6 +1085,18 @@ if (!defined('NOLOGIN')) { unset($_SESSION['lastsearch_mode_tmp_'.$relativepathstring]); } } + if (!empty($_GET['save_pageforbacktolist']) && !empty($_SERVER["HTTP_REFERER"])) { // We must use $_GET here + if (empty($_SESSION['pageforbacktolist'])) { + $pageforbacktolistarray = array(); + } else { + $pageforbacktolistarray = $_SESSION['pageforbacktolist']; + } + $tmparray = explode(':', $_GET['save_pageforbacktolist'], 2); + if (!empty($tmparray[0]) && !empty($tmparray[1])) { + $pageforbacktolistarray[$tmparray[0]] = $tmparray[1]; + $_SESSION['pageforbacktolist'] = $pageforbacktolistarray; + } + } $action = ''; $parameters = array(); diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 50a03e6fdb3..70c35008c8d 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -191,9 +191,9 @@ if (session_id() && !empty($_SESSION["dol_entity"])) { } elseif (!empty($_ENV["dol_entity"])) { // Entity inside a CLI script $conf->entity = $_ENV["dol_entity"]; -} elseif (GETPOSTISSET("loginfunction") && GETPOST("entity", 'int')) { +} elseif (GETPOSTISSET("loginfunction") && (GETPOST("entity", 'int') || GETPOST("switchentity", 'int'))) { // Just after a login page - $conf->entity = GETPOST("entity", 'int'); + $conf->entity = (GETPOSTISSET("entity") ? GETPOST("entity", 'int') : GETPOST("switchentity", 'int')); } elseif (defined('DOLENTITY') && is_numeric(constant('DOLENTITY'))) { // For public page with MultiCompany module $conf->entity = constant('DOLENTITY'); diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index d3f8ee41052..668991818b5 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1290,10 +1290,14 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { } $rights = $moduleobj->rights; $moduledescriptorfile = $destdir.'/core/modules/mod'.$module.'.class.php'; - - $generatePerms = reWriteAllPermissions($moduledescriptorfile, $rights, null, null, $objectname, $module, -2); - if ($generatePerms < 0) { - setEventMessages($langs->trans("WarningPermissionAlreadyExist", $langs->transnoentities($objectname)), null, 'warnings'); + $checkComment=checkExistComment($moduledescriptorfile, 1); + if ($checkComment < 0) { + setEventMessages($langs->trans("WarningCommentNotFound", $langs->trans("Permissions"), "mod".$module."class.php"), null, 'warnings'); + } else { + $generatePerms = reWriteAllPermissions($moduledescriptorfile, $rights, null, null, $objectname, $module, -2); + if ($generatePerms < 0) { + setEventMessages($langs->trans("WarningPermissionAlreadyExist", $langs->transnoentities($objectname)), null, 'warnings'); + } } } @@ -1459,7 +1463,13 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { } } if (!$counter) { - dolReplaceInFile($moduledescriptorfile, array('/* END MODULEBUILDER LEFTMENU MYOBJECT */' => '/*LEFTMENU '.strtoupper($objectname).'*/'.$stringtoadd."\n\t\t".'/*END LEFTMENU '.strtoupper($objectname).'*/'."\n\t\t".'/* END MODULEBUILDER LEFTMENU MYOBJECT */')); + $checkComment = checkExistComment($moduledescriptorfile, 0); + if ($checkComment < 0) { + $error++; + setEventMessages($langs->trans("WarningCommentNotFound", $langs->trans("Menus"), "mod".$module."class.php"), null, 'warnings'); + } else { + dolReplaceInFile($moduledescriptorfile, array('/* END MODULEBUILDER LEFTMENU MYOBJECT */' => '/*LEFTMENU '.strtoupper($objectname).'*/'.$stringtoadd."\n\t\t".'/*END LEFTMENU '.strtoupper($objectname).'*/'."\n\t\t".'/* END MODULEBUILDER LEFTMENU MYOBJECT */')); + } } // Add module descriptor to list of files to replace "MyObject' string with real name of object. $filetogenerate[] = 'core/modules/mod'.$module.'.class.php'; @@ -1585,13 +1595,18 @@ if ($dirins && $action == 'initdic' && $module && $dicname) { exit; } $dictionaries = $moduleobj->dictionaries; - createNewDictionnary($module, $moduledescriptorfile, $newdicname, $dictionaries); - if (function_exists('opcache_invalidate')) { - opcache_reset(); // remove the include cache hell ! + $checkComment = checkExistComment($moduledescriptorfile, 2); + if ($checkComment < 0) { + setEventMessages($langs->trans("WarningCommentNotFound", $langs->trans("Dictionaries"), "mod".$module."class.php"), null, 'warnings'); + } else { + createNewDictionnary($module, $moduledescriptorfile, $newdicname, $dictionaries); + if (function_exists('opcache_invalidate')) { + opcache_reset(); // remove the include cache hell ! + } + clearstatcache(true); + header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '')); + exit; } - clearstatcache(true); - header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '')); - exit; } } @@ -1895,35 +1910,45 @@ if ($dirins && $action == 'confirm_deleteobject' && $objectname) { // delete menus linked to the object $menus = $moduleobj->menu; - reWriteAllMenus($moduledescriptorfile, $menus, $objectname, null, -1); + $rewriteMenu = checkExistComment($moduledescriptorfile, 0); + + if ($rewriteMenu < 0) { + setEventMessages($langs->trans("WarningCommentNotFound", $langs->trans("Menus"), "mod".$module."class.php"), null, 'warnings'); + } else { + reWriteAllMenus($moduledescriptorfile, $menus, $objectname, null, -1); + } // regenerate permissions and delete them $permissions = $moduleobj->rights; - reWriteAllPermissions($moduledescriptorfile, $permissions, null, null, $objectname, '', -1); - - // check if documentation has been generated - $file_doc = $dirins.'/'.strtolower($module).'/doc/Documentation.asciidoc'; - if (file_exists($file_doc)) { - deletePropsAndPermsFromDoc($file_doc, $objectname); - } - - clearstatcache(true); - if (function_exists('opcache_invalidate')) { - opcache_reset(); // remove the include cache hell ! - } - $resultko = 0; - foreach ($filetodelete as $tmpfiletodelete) { - $resulttmp = dol_delete_file($dir.'/'.$tmpfiletodelete, 0, 0, 1); - $resulttmp = dol_delete_file($dir.'/'.$tmpfiletodelete.'.back', 0, 0, 1); - if (!$resulttmp) { - $resultko++; - } - } - - if ($resultko == 0) { - setEventMessages($langs->trans("FilesDeleted"), null); + $rewritePerms = checkExistComment($moduledescriptorfile, 1); + if ($rewritePerms < 0) { + setEventMessages($langs->trans("WarningCommentNotFound", $langs->trans("Permissions"), "mod".$module."class.php"), null, 'warnings'); } else { - setEventMessages($langs->trans("ErrorSomeFilesCouldNotBeDeleted"), null, 'warnings'); + reWriteAllPermissions($moduledescriptorfile, $permissions, null, null, $objectname, '', -1); + } + if ($rewritePerms && $rewriteMenu) { + // check if documentation has been generated + $file_doc = $dirins.'/'.strtolower($module).'/doc/Documentation.asciidoc'; + deletePropsAndPermsFromDoc($file_doc, $objectname); + + clearstatcache(true); + if (function_exists('opcache_invalidate')) { + opcache_reset(); // remove the include cache hell ! + } + $resultko = 0; + foreach ($filetodelete as $tmpfiletodelete) { + $resulttmp = dol_delete_file($dir.'/'.$tmpfiletodelete, 0, 0, 1); + $resulttmp = dol_delete_file($dir.'/'.$tmpfiletodelete.'.back', 0, 0, 1); + if (!$resulttmp) { + $resultko++; + } + } + + if ($resultko == 0) { + setEventMessages($langs->trans("FilesDeleted"), null); + } else { + setEventMessages($langs->trans("ErrorSomeFilesCouldNotBeDeleted"), null, 'warnings'); + } } } @@ -1978,6 +2003,11 @@ if (($dirins && $action == 'confirm_deletedictionary' && $dicname) || ($dirins & } $dicts = $moduleobj->dictionaries; + $checkComment = checkExistComment($moduledescriptorfile, 2); + if ($checkComment < 0) { + $error++; + setEventMessages($langs->trans("WarningCommentNotFound", $langs->trans("Dictionaries"), "mod".$module."class.php"), null, 'warnings'); + } if (!empty(GETPOST('dictionnarykey'))) { $newdicname = $dicts['tabname'][GETPOST('dictionnarykey')-1]; @@ -2021,13 +2051,16 @@ if (($dirins && $action == 'confirm_deletedictionary' && $dicname) || ($dirins & $result = updateDictionaryInFile($module, $moduledescriptorfile, $dicts); if ($result > 0) { setEventMessages($langs->trans("DictionaryDeleted", ucfirst(substr($newdicname, 2))), null); + } elseif (!$result) { + setEventMessages($langs->trans("WarningCommentNotFound", $langs->trans("Dictionaries"), "mod".$module."class.php"), null, 'warnings'); + } else { + if (function_exists('opcache_invalidate')) { + opcache_reset(); // remove the include cache hell ! + } + clearstatcache(true); + header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '')); + exit; } - if (function_exists('opcache_invalidate')) { - opcache_reset(); // remove the include cache hell ! - } - clearstatcache(true); - header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '')); - exit; } } if ($dirins && $action == 'updatedictionary' && GETPOST('dictionnarykey')) { @@ -2056,16 +2089,21 @@ if ($dirins && $action == 'updatedictionary' && GETPOST('dictionnarykey')) { $dicts = $moduleobj->dictionaries; if (!empty(GETPOST('tablib')) && GETPOST('tablib') !== $dicts['tablib'][$keydict]) { $dicts['tablib'][$keydict] = ucfirst(strtolower(GETPOST('tablib'))); - $updateDict = updateDictionaryInFile($module, $moduledescriptorfile, $dicts); - if ($updateDict > 0) { - setEventMessages($langs->trans("DictionaryNameUpdated", ucfirst(GETPOST('tablib'))), null); + $checkComment = checkExistComment($moduledescriptorfile, 2); + if ($checkComment < 0) { + setEventMessages($langs->trans("WarningCommentNotFound", $langs->trans("Dictionaries"), "mod".$module."class.php"), null, 'warnings'); + } else { + $updateDict = updateDictionaryInFile($module, $moduledescriptorfile, $dicts); + if ($updateDict > 0) { + setEventMessages($langs->trans("DictionaryNameUpdated", ucfirst(GETPOST('tablib'))), null); + } + if (function_exists('opcache_invalidate')) { + opcache_reset(); // remove the include cache hell ! + } + clearstatcache(true); + header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '')); + exit; } - if (function_exists('opcache_invalidate')) { - opcache_reset(); // remove the include cache hell ! - } - clearstatcache(true); - header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '')); - exit; } //var_dump(GETPOST('tablib'));exit; } @@ -2215,11 +2253,6 @@ if ($dirins && $action == 'addright' && !empty($module) && empty($cancel)) { 5=>$crud ]; - $moduledescriptorfile = $dirins.'/'.strtolower($module).'/core/modules/mod'.$module.'.class.php'; - //rewriting all permissions after add a right - reWriteAllPermissions($moduledescriptorfile, $permissions, $key, $rightToAdd, '', '', 1); - setEventMessages($langs->trans('PermissionAddedSuccesfuly'), null); - if (isModEnabled(strtolower($module))) { $result = unActivateModule(strtolower($module)); dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity); @@ -2229,14 +2262,22 @@ if ($dirins && $action == 'addright' && !empty($module) && empty($cancel)) { setEventMessages($langs->trans('WarningModuleNeedRefrech', $langs->transnoentities($module)), null, 'warnings'); } } + $moduledescriptorfile = $dirins.'/'.strtolower($module).'/core/modules/mod'.$module.'.class.php'; + //rewriting all permissions after add a right + $rewrite = checkExistComment($moduledescriptorfile, 1); + if ($rewrite < 0) { + setEventMessages($langs->trans("WarningCommentNotFound", $langs->trans("Permissions"), "mod".$module."class.php"), null, 'warnings'); + } else { + reWriteAllPermissions($moduledescriptorfile, $permissions, $key, $rightToAdd, '', '', 1); + setEventMessages($langs->trans('PermissionAddedSuccesfuly'), null); - clearstatcache(true); - if (function_exists('opcache_invalidate')) { - opcache_reset(); // remove the include cache hell ! + clearstatcache(true); + if (function_exists('opcache_invalidate')) { + opcache_reset(); // remove the include cache hell ! + } + header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=permissions&module='.$module); + exit; } - - header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=permissions&module='.$module); - exit; } @@ -2330,17 +2371,19 @@ if ($dirins && GETPOST('action') == 'update_right' && GETPOST('modifyright')&& e $moduledescriptorfile = $dirins.'/'.strtolower($module).'/core/modules/mod'.$module.'.class.php'; // rewriting all permissions after update permission needed - reWriteAllPermissions($moduledescriptorfile, $permissions, $key, $rightUpdated, '', '', 2); - - setEventMessages($langs->trans('PermissionUpdatedSuccesfuly'), null); - - clearstatcache(true); - if (function_exists('opcache_invalidate')) { - opcache_reset(); // remove the include cache hell ! + $rewrite = checkExistComment($moduledescriptorfile, 1); + if ($rewrite < 0) { + setEventMessages($langs->trans("WarningCommentNotFound", $langs->trans("Permissions"), "mod".$module."class.php"), null, 'warnings'); + } else { + reWriteAllPermissions($moduledescriptorfile, $permissions, $key, $rightUpdated, '', '', 2); + setEventMessages($langs->trans('PermissionUpdatedSuccesfuly'), null); + clearstatcache(true); + if (function_exists('opcache_invalidate')) { + opcache_reset(); // remove the include cache hell ! + } + header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=permissions&module='.$module); + exit; } - - header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=permissions&module='.$module); - exit; } } // Delete permission @@ -2363,11 +2406,6 @@ if ($dirins && $action == 'confirm_deleteright' && !empty($module) && GETPOST('p $key = (int) GETPOST('permskey', 'int')-1; if (!$error) { - $moduledescriptorfile = $dirins.'/'.strtolower($module).'/core/modules/mod'.$module.'.class.php'; - - // rewriting all permissions - reWriteAllPermissions($moduledescriptorfile, $permissions, $key, null, '', '', 0); - // check if module is enabled if (isModEnabled(strtolower($module))) { $result = unActivateModule(strtolower($module)); @@ -2375,12 +2413,18 @@ if ($dirins && $action == 'confirm_deleteright' && !empty($module) && GETPOST('p if ($result) { setEventMessages($result, null, 'errors'); } - setEventMessages($langs->trans('PermissionDeletedSuccesfuly'), null); setEventMessages($langs->trans('WarningModuleNeedRefrech', $langs->transnoentities($module)), null, 'warnings'); - header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=permissions&module='.$module); exit; + } + + // rewriting all permissions + $moduledescriptorfile = $dirins.'/'.strtolower($module).'/core/modules/mod'.$module.'.class.php'; + $rewrite = checkExistComment($moduledescriptorfile, 1); + if ($rewrite < 0) { + setEventMessages($langs->trans("WarningCommentNotFound", $langs->trans("Permissions"), "mod".$module."class.php"), null, 'warnings'); } else { + reWriteAllPermissions($moduledescriptorfile, $permissions, $key, null, '', '', 0); setEventMessages($langs->trans('PermissionDeletedSuccesfuly'), null); clearstatcache(true); @@ -2538,24 +2582,29 @@ if ($dirins && $action == 'confirm_deletemenu' && GETPOST('menukey', 'int')) { $key = (int) GETPOST('menukey', 'int'); $moduledescriptorfile = $dirins.'/'.strtolower($module).'/core/modules/mod'.$module.'.class.php'; - if ($menus[$key]['fk_menu'] === 'fk_mainmenu='.strtolower($module)) { - if (in_array(strtolower($menus[$key]['leftmenu']), $result)) { - reWriteAllMenus($moduledescriptorfile, $menus, $menus[$key]['leftmenu'], $key, -1); + $checkcomment = checkExistComment($moduledescriptorfile, 0); + if ($checkcomment < 0) { + setEventMessages($langs->trans("WarningCommentNotFound", $langs->trans("Menus"), "mod".$module."class.php"), null, 'warnings'); + } else { + if ($menus[$key]['fk_menu'] === 'fk_mainmenu='.strtolower($module)) { + if (in_array(strtolower($menus[$key]['leftmenu']), $result)) { + reWriteAllMenus($moduledescriptorfile, $menus, $menus[$key]['leftmenu'], $key, -1); + } else { + reWriteAllMenus($moduledescriptorfile, $menus, null, $key, 0); + } } else { reWriteAllMenus($moduledescriptorfile, $menus, null, $key, 0); } - } else { - reWriteAllMenus($moduledescriptorfile, $menus, null, $key, 0); - } - clearstatcache(true); - if (function_exists('opcache_invalidate')) { - opcache_reset(); // remove the include cache hell ! - } + clearstatcache(true); + if (function_exists('opcache_invalidate')) { + opcache_reset(); // remove the include cache hell ! + } - setEventMessages($langs->trans('MenuDeletedSuccessfuly'), null); - header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=menus&module='.$module); - exit; + setEventMessages($langs->trans('MenuDeletedSuccessfuly'), null); + header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=menus&module='.$module); + exit; + } } // Add menu in module without initial object @@ -2684,15 +2733,19 @@ if ($dirins && $action == 'addmenu' && empty($cancel)) { $menuToAdd['perms'] = '1'; } - $result = reWriteAllMenus($moduledescriptorfile, $menus, $menuToAdd, null, 1); - - clearstatcache(true); - if (function_exists('opcache_invalidate')) { - opcache_reset(); + $checkcomment = checkExistComment($moduledescriptorfile, 0); + if ($checkcomment < 0) { + setEventMessages($langs->trans("WarningCommentNotFound", $langs->trans("Menus"), "mod".$module."class.php"), null, 'warnings'); + } else { + reWriteAllMenus($moduledescriptorfile, $menus, $menuToAdd, null, 1); + clearstatcache(true); + if (function_exists('opcache_invalidate')) { + opcache_reset(); + } + header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=menus&module='.$module); + setEventMessages($langs->trans('MenuAddedSuccesfuly'), null); + exit; } - header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=menus&module='.$module); - setEventMessages($langs->trans('MenuAddedSuccesfuly'), null); - exit; } } @@ -2771,20 +2824,25 @@ if ($dirins && $action == "modify_menu" && GETPOST('menukey', 'int') && GETPOST( } if (!$error) { //update menu - $result = reWriteAllMenus($moduledescriptorfile, $menus, $menuModify, $key, 2); + $checkComment = checkExistComment($moduledescriptorfile, 0); + if ($checkComment < 0) { + setEventMessages($langs->trans("WarningCommentNotFound", $langs->trans("Menus"), "mod".$module."class.php"), null, 'warnings'); + } else { + $result = reWriteAllMenus($moduledescriptorfile, $menus, $menuModify, $key, 2); - clearstatcache(true); - if (function_exists('opcache_invalidate')) { - opcache_reset(); - } - if ($result < 0) { - setEventMessages($langs->trans('ErrorMenuExistValue'), null, 'errors'); - header("Location: ".$_SERVER["PHP_SELF"].'?action=editmenu&token='.newToken().'&menukey='.urlencode($key+1).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.($key+1)); + clearstatcache(true); + if (function_exists('opcache_invalidate')) { + opcache_reset(); + } + if ($result < 0) { + setEventMessages($langs->trans('ErrorMenuExistValue'), null, 'errors'); + header("Location: ".$_SERVER["PHP_SELF"].'?action=editmenu&token='.newToken().'&menukey='.urlencode($key+1).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.($key+1)); + exit; + } + setEventMessages($langs->trans('MenuUpdatedSuccessfuly'), null); + header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=menus&module='.$module); exit; } - setEventMessages($langs->trans('MenuUpdatedSuccessfuly'), null); - header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=menus&module='.$module); - exit; } } else { $_POST['type'] = ''; @@ -3203,6 +3261,19 @@ if ($module == 'initmodule') { // Tabs for module if (!$error) { $dirread = $listofmodules[strtolower($module)]['moduledescriptorrootpath']; + $destdir = $dirread.'/'.strtolower($module); + $objects = dolGetListOfObjectClasses($destdir); + $diroflang = dol_buildpath($modulelowercase, 0)."/langs"; + $countLangs = countItemsInDirectory($diroflang, 2); + $countDictionaries = count($moduleobj->dictionaries['tabname']); + $countRights = count($moduleobj->rights); + $countMenus = count($moduleobj->menu); + $countTriggers = countItemsInDirectory(dol_buildpath($modulelowercase, 0)."/core/triggers"); + $countWidgets = countItemsInDirectory(dol_buildpath($modulelowercase, 0)."/core/boxes"); + $countCss = countItemsInDirectory(dol_buildpath($modulelowercase, 0)."/css"); + $countJs = countItemsInDirectory(dol_buildpath($modulelowercase, 0)."/js"); + $countCLI = countItemsInDirectory(dol_buildpath($modulelowercase, 0)."/scripts"); + $hasDoc = countItemsInDirectory(dol_buildpath($modulelowercase, 0)."/doc"); $head2 = array(); $h = 0; @@ -3213,22 +3284,22 @@ if ($module == 'initmodule') { $h++; $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread ? '@'.$dirread : ''); - $head2[$h][1] = $langs->trans("Objects"); + $head2[$h][1] = (count($objects) <= 0 ? $langs->trans("Objects") : $langs->trans("Objects")." (".count($objects).")"); $head2[$h][2] = 'objects'; $h++; $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=languages&module='.$module.($forceddirread ? '@'.$dirread : ''); - $head2[$h][1] = $langs->trans("Languages"); + $head2[$h][1] = ($countLangs <= 0 ? $langs->trans("Languages") : $langs->trans("Languages")." (".$countLangs.") "); $head2[$h][2] = 'languages'; $h++; $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : ''); - $head2[$h][1] = $langs->trans("Dictionaries"); + $head2[$h][1] = ($countDictionaries <= 0 ? $langs->trans("Dictionaries") : $langs->trans('Dictionaries')." (".$countDictionaries.")"); $head2[$h][2] = 'dictionaries'; $h++; $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=permissions&module='.$module.($forceddirread ? '@'.$dirread : ''); - $head2[$h][1] = $langs->trans("Permissions"); + $head2[$h][1] = ($countRights <= 0 ? $langs->trans("Permissions") : $langs->trans("Permissions")." (".$countRights.")"); $head2[$h][2] = 'permissions'; $h++; @@ -3238,7 +3309,7 @@ if ($module == 'initmodule') { $h++; $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=menus&module='.$module.($forceddirread ? '@'.$dirread : ''); - $head2[$h][1] = $langs->trans("Menus"); + $head2[$h][1] = ($countMenus <= 0 ? $langs->trans("Menus") : $langs->trans("Menus")." (".$countMenus.")"); $head2[$h][2] = 'menus'; $h++; @@ -3248,12 +3319,12 @@ if ($module == 'initmodule') { $h++; $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=triggers&module='.$module.($forceddirread ? '@'.$dirread : ''); - $head2[$h][1] = $langs->trans("Triggers"); + $head2[$h][1] = ($countTriggers <= 0 ? $langs->trans("Triggers") : $langs->trans("Triggers")." (".$countTriggers.")"); $head2[$h][2] = 'triggers'; $h++; $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=widgets&module='.$module.($forceddirread ? '@'.$dirread : ''); - $head2[$h][1] = $langs->trans("Widgets"); + $head2[$h][1] = ($countWidgets <= 0 ? $langs->trans("Widgets") : $langs->trans("Widgets")." (".$countWidgets.")"); $head2[$h][2] = 'widgets'; $h++; @@ -3263,17 +3334,17 @@ if ($module == 'initmodule') { $h++; $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=css&module='.$module.($forceddirread ? '@'.$dirread : ''); - $head2[$h][1] = $langs->trans("CSS"); + $head2[$h][1] = ($countCss <= 0 ? $langs->trans("CSS") : $langs->trans("CSS")." (".$countCss.")"); $head2[$h][2] = 'css'; $h++; $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=js&module='.$module.($forceddirread ? '@'.$dirread : ''); - $head2[$h][1] = $langs->trans("JS"); + $head2[$h][1] = ($countJs <= 0 ? $langs->trans("JS") : $langs->trans("JS")." (".$countJs.")"); $head2[$h][2] = 'js'; $h++; $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=cli&module='.$module.($forceddirread ? '@'.$dirread : ''); - $head2[$h][1] = $langs->trans("CLI"); + $head2[$h][1] = ($countCLI <= 0 ? $langs->trans("CLI") : $langs->trans("CLI")." (".$countCLI.")"); $head2[$h][2] = 'cli'; $h++; @@ -3283,7 +3354,7 @@ if ($module == 'initmodule') { $h++; $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=specifications&module='.$module.($forceddirread ? '@'.$dirread : ''); - $head2[$h][1] = $langs->trans("Documentation"); + $head2[$h][1] = ($hasDoc <= 0 ? $langs->trans("Documentation") : $langs->trans("Documentation")." (".$hasDoc.")"); $head2[$h][2] = 'specifications'; $h++; diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php index d4023d4840d..b27f77d2ef9 100644 --- a/htdocs/modulebuilder/template/admin/setup.php +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -257,7 +257,7 @@ if ($action == 'updateMask') { if (dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity)) { // The constant that was read before the new set // We therefore requires a variable to have a coherent view - $conf->global->$constforval = $value; + $conf->global->{$constforval} = $value; } // We disable/enable the document template (into llx_document_model table) diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index dd6d02993b1..5b3be07105c 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -85,7 +85,7 @@ class MyObject extends CommonObject * Note: Filter must be a Dolibarr Universal Filter syntax string. Example: "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.status:!=:0) or (t.nature:is:NULL)" * 'label' the translation key. * 'picto' is code of a picto to show before value in forms - * 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalInt('MY_SETUP_PARAM') or 'isModEnabled("multicurrency")' ...) + * 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalInt("MY_SETUP_PARAM")' or 'isModEnabled("multicurrency")' ...) * 'position' is the sort order of field. * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) @@ -575,7 +575,7 @@ class MyObject extends CommonObject return 0; } - /*if (! ((!getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->mymodule->myobject->write)) + /* if (! ((!getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('mymodule','write')) || (getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->mymodule->myobject->myobject_advance->validate)))) { $this->error='NotEnoughPermissions'; @@ -693,8 +693,8 @@ class MyObject extends CommonObject return 0; } - /*if (! ((!getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->mymodule->write)) - || (getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->mymodule->mymodule_advance->validate)))) + /* if (! ((!getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('mymodule','write')) + || (getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('mymodule','mymodule_advance','validate')))) { $this->error='Permission denied'; return -1; @@ -717,8 +717,8 @@ class MyObject extends CommonObject return 0; } - /*if (! ((!getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->mymodule->write)) - || (getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->mymodule->mymodule_advance->validate)))) + /* if (! ((!getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('mymodule','write')) + || (getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('mymodule','mymodule_advance','validate')))) { $this->error='Permission denied'; return -1; @@ -741,13 +741,14 @@ class MyObject extends CommonObject return 0; } - /*if (! ((!getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->mymodule->write)) - || (getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->mymodule->mymodule_advance->validate)))) + /*if (! ((!getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('mymodule','write')) + || (getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('mymodule','mymodule_advance','validate')))) { $this->error='Permission denied'; return -1; }*/ + return $this->setStatusCommon($user, self::STATUS_VALIDATED, $notrigger, 'MYOBJECT_REOPEN'); } @@ -865,7 +866,7 @@ class MyObject extends CommonObject $pospoint = strpos($filearray[0]['name'], '.'); $pathtophoto = $class.'/'.$this->ref.'/thumbs/'.substr($filename, 0, $pospoint).'_mini'.substr($filename, $pospoint); - if (!getDolGlobalInt(strtoupper($module.'_'.$class).'_FORMATLISTPHOTOSASUSERS')) { + if (!getDolGlobalString(strtoupper($module.'_'.$class).'_FORMATLISTPHOTOSASUSERS')) { $result .= '
No photo
'; } else { $result .= '
No photo
'; diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php index a0b27ba3684..5014b764832 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php @@ -279,8 +279,8 @@ class doc_generic_myobject_odt extends ModelePDFMyObject // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); - if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) { - $format = getDolGlobalInt('MAIN_DOC_USE_TIMING'); + if (getDolGlobalString('MAIN_DOC_USE_TIMING')) { + $format = getDolGlobalString('MAIN_DOC_USE_TIMING'); if ($format == '1') { $format = '%Y%m%d%H%M%S'; } diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php index f24067f7547..9826936f8ab 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php @@ -197,8 +197,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $realpatharray = array(); $this->atleastonephoto = false; /* - if (getDolGlobalInt('MAIN_GENERATE_MYOBJECT_WITH_PICTURE'))) - { + if (getDolGlobalInt('MAIN_GENERATE_MYOBJECT_WITH_PICTURE'))) { $objphoto = new Product($this->db); for ($i = 0; $i < $nblines; $i++) @@ -284,7 +283,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 50; // Height reserved to output the info and total part and payment part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + (getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) if (class_exists('TCPDF')) { @@ -316,7 +315,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $cert = empty($user->conf->CERTIFICATE_CRT) ? '' : $user->conf->CERTIFICATE_CRT; // If user has no certificate, we try to take the company one if (!$cert) { - $cert = getDolGlobalString('CERTIFICATE_CRT') ? '' : getDolGlobalString('CERTIFICATE_CRT'); + $cert = getDolGlobalString('CERTIFICATE_CRT'); } // If a certificate is found if ($cert) { @@ -1080,7 +1079,7 @@ class pdf_standard_myobject extends ModelePDFMyObject } // Recipient name - if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) { + if ($object->contact->socid != $object->thirdparty->id && getDolGlobalInt('MAIN_USE_COMPANY_NAME_OF_CONTACT')) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; @@ -1239,7 +1238,7 @@ class pdf_standard_myobject extends ModelePDFMyObject 'border-left' => true, // add left line separator ); - if (getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') && !getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN')) { + if (!getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') && !getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN')) { $this->cols['vat']['status'] = true; } @@ -1290,7 +1289,7 @@ class pdf_standard_myobject extends ModelePDFMyObject ), 'border-left' => true, // add left line separator ); - if (!empty($conf->global->PRODUCT_USE_UNITS)) { + if (getDolGlobalInt('PRODUCT_USE_UNITS')) { $this->cols['unit']['status'] = true; } diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index 57409ab097c..00c5b9d1bc7 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -189,6 +189,7 @@ if ($object->id > 0) { $title = $langs->trans("MyObject")." - ".$langs->trans('Agenda'); //$title = $object->ref." - ".$langs->trans("Agenda"); $help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung'; + llxHeader('', $title, $help_url); if (isModEnabled('notification')) { diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index f3d39a829a5..56430cf1dbc 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -405,10 +405,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea /* // Ref customer $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1); - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.$conf->global->THIRDPARTY_REF_INPUT_SIZE : ''), '', null, null, '', 1); + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(getDolGlobalInt('THIRDPARTY_REF_INPUT_SIZE') ? ':'.getDolGlobalInt('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); // Thirdparty $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1, 'customer'); - if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { + if (!getDolGlobalInt('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherOrders").')'; } // Project diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index a174dc9ffad..9fc46541bf7 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -412,7 +412,7 @@ $num = $db->num_rows($resql); // Direct jump if only one record found -if ($num == 1 && !getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) { +if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) { $obj = $db->fetch_object($resql); $id = $obj->rowid; header("Location: ".dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.((int) $id)); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 7f54948216a..ff3115ee40b 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5056,7 +5056,7 @@ class Product extends CommonObject { global $conf, $langs; - $langs->load('products', 'other'); + $langs->loadLangs(array('products', 'other')); $datas = array(); $nofetch = !empty($params['nofetch']); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 4028726096a..9c9f3e5f274 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -413,7 +413,9 @@ if (empty($reshook)) { */ $product_static = new Product($db); -$static_ws = new Workstation($db); +if (isModEnabled('workstation')) { + $workstation_static = new Workstation($db); +} $product_fourn = new ProductFournisseur($db); $title = $langs->trans("ProductsAndServices"); @@ -1844,12 +1846,12 @@ while ($i < $imaxinloop) { // Default Workstation if (!empty($arrayfields['p.fk_default_workstation']['checked'])) { print ''; - if (!empty($obj->fk_default_workstation)) { - $static_ws->id = $obj->fk_default_workstation; - $static_ws->ref = $obj->ref_workstation; - $static_ws->status = $obj->status_workstation; + if (isModEnabled('workstation') && !empty($obj->fk_default_workstation)) { + $workstation_static->id = $obj->fk_default_workstation; + $workstation_static->ref = $obj->ref_workstation; + $workstation_static->status = $obj->status_workstation; - print $static_ws->getNomUrl(1); + print $workstation_static->getNomUrl(1); } print ''; if (!$i) { diff --git a/htdocs/projet/agenda.php b/htdocs/projet/agenda.php index 5e8f0dfafbf..84a204a2e6a 100644 --- a/htdocs/projet/agenda.php +++ b/htdocs/projet/agenda.php @@ -127,7 +127,13 @@ print dol_get_fiche_head($head, 'agenda', $langs->trans("Project"), -1, ($object // Project card -$linkback = ''.$langs->trans("BackToList").''; +if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) { + $tmpurl = $_SESSION['pageforbacktolist']['project']; + $tmpurl = preg_replace('/__SOCID__/', $object->socid, $tmpurl); + $linkback = ''.$langs->trans("BackToList").''; +} else { + $linkback = ''.$langs->trans("BackToList").''; +} $morehtmlref = '
'; // Title diff --git a/htdocs/projet/ajax/projects.php b/htdocs/projet/ajax/projects.php index 03d118dc9b9..fbb02a60a48 100644 --- a/htdocs/projet/ajax/projects.php +++ b/htdocs/projet/ajax/projects.php @@ -53,7 +53,6 @@ $discard_closed = GETPOST('discardclosed', 'int'); // Security check restrictedArea($user, 'projet', 0, 'projet&project'); - /* * View */ @@ -62,29 +61,32 @@ dol_syslog("Call ajax projet/ajax/projects.php"); require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -top_httphead('application/json'); - -if (empty($htmlname) && !GETPOST('mode', 'aZ09')) { - return; -} - // Mode to get list of projects if (empty($mode) || $mode != 'gettasks') { + top_httphead('application/json'); + // When used from jQuery, the search term is added as GET param "term". $searchkey = (GETPOSTISSET($htmlname) ? GETPOST($htmlname, 'aZ09') : ''); $formproject = new FormProjets($db); - $arrayresult = $formproject->select_projects_list($socid, '', $htmlname, 0, 0, 1, $discard_closed, 0, 0, 1, $searchkey); -} + $arrayresult = $formproject->select_projects_list($socid, '', '', 0, 0, 1, $discard_closed, 0, 0, 1, $searchkey); + + $db->close(); + + print json_encode($arrayresult); -// Mode to get list of tasks -if ($mode == 'gettasks') { - $formproject = new FormProjets($db); - $formproject->selectTasks((!empty($socid) ? $socid : -1), 0, 'taskid', 24, 1, '1', 1, 0, 0, 'maxwidth500', GETPOST('projectid', 'int'), ''); return; } +// Mode to get list of tasks +// THIS MODE RETURNS HTML NOT JSON - THE CALL SHOULD BE UPDATE IN THE FUTURE +if ($mode == 'gettasks') { + top_httphead(); -$db->close(); + $formproject = new FormProjets($db); + $formproject->selectTasks((!empty($socid) ? $socid : -1), 0, 'taskid', 24, 1, '1', 1, 0, 0, 'maxwidth500', GETPOST('projectid', 'int'), ''); -print json_encode($arrayresult); + $db->close(); + + return; +} diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 806d73f225e..dc7eaa538f3 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -463,7 +463,16 @@ if (empty($reshook)) { $result = $object->delete($user); if ($result > 0) { setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); - header("Location: list.php?restore_lastsearch_values=1"); + + if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) { + $tmpurl = $_SESSION['pageforbacktolist']['project']; + $tmpurl = preg_replace('/__SOCID__/', $object->socid, $tmpurl); + $urlback = $tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?'). 'restore_lastsearch_values=1'; + } else { + $urlback = DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1'; + } + + header("Location: ".$urlback); exit; } else { dol_syslog($object->error, LOG_DEBUG); @@ -1221,7 +1230,13 @@ if ($action == 'create' && $user->rights->projet->creer) { // Project card - $linkback = ''.$langs->trans("BackToList").''; + if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) { + $tmpurl = $_SESSION['pageforbacktolist']['project']; + $tmpurl = preg_replace('/__SOCID__/', $object->socid, $tmpurl); + $linkback = ''.$langs->trans("BackToList").''; + } else { + $linkback = ''.$langs->trans("BackToList").''; + } $morehtmlref = '
'; // Title diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 99f0f375b4f..106d092c5ee 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1312,9 +1312,10 @@ class Project extends CommonObject * @param int $notooltip 1=Disable tooltip * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @param string $morecss More css on a link + * @param string $save_pageforbacktolist Back to this page 'context:url' * @return string String with URL */ - public function getNomUrl($withpicto = 0, $option = '', $addlabel = 0, $moreinpopup = '', $sep = ' - ', $notooltip = 0, $save_lastsearch_value = -1, $morecss = '') + public function getNomUrl($withpicto = 0, $option = '', $addlabel = 0, $moreinpopup = '', $sep = ' - ', $notooltip = 0, $save_lastsearch_value = -1, $morecss = '', $save_pageforbacktolist = '') { global $conf, $langs, $user, $hookmanager; @@ -1363,6 +1364,10 @@ class Project extends CommonObject if ($add_save_lastsearch_values) { $url .= '&save_lastsearch_values=1'; } + $add_save_backpagefor = ($save_pageforbacktolist ? 1 : 0); + if ($add_save_backpagefor) { + $url .= "&save_pageforbacktolist=".urlencode($save_pageforbacktolist); + } } $linkclose = ''; diff --git a/htdocs/projet/comment.php b/htdocs/projet/comment.php index b418eb54441..8991d2dcc26 100644 --- a/htdocs/projet/comment.php +++ b/htdocs/projet/comment.php @@ -98,7 +98,13 @@ $param = ($mode == 'mine' ? '&mode=mine' : ''); // Project card -$linkback = ''.$langs->trans("BackToList").''; +if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) { + $tmpurl = $_SESSION['pageforbacktolist']['project']; + $tmpurl = preg_replace('/__SOCID__/', $object->socid, $tmpurl); + $linkback = ''.$langs->trans("BackToList").''; +} else { + $linkback = ''.$langs->trans("BackToList").''; +} $morehtmlref = '
'; // Title diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index b0fece54827..17fb0cd10ef 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -294,7 +294,13 @@ if ($id > 0 || !empty($ref)) { // Project card - $linkback = ''.$langs->trans("BackToList").''; + if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) { + $tmpurl = $_SESSION['pageforbacktolist']['project']; + $tmpurl = preg_replace('/__SOCID__/', $object->socid, $tmpurl); + $linkback = ''.$langs->trans("BackToList").''; + } else { + $linkback = ''.$langs->trans("BackToList").''; + } $morehtmlref = '
'; // Title diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index 19ecebb2214..0f2733daec9 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -131,7 +131,13 @@ if ($object->id > 0) { // Project card - $linkback = ''.$langs->trans("BackToList").''; + if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) { + $tmpurl = $_SESSION['pageforbacktolist']['project']; + $tmpurl = preg_replace('/__SOCID__/', $object->socid, $tmpurl); + $linkback = ''.$langs->trans("BackToList").''; + } else { + $linkback = ''.$langs->trans("BackToList").''; + } $morehtmlref = '
'; // Title diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index bca52b73045..2aeac25f973 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -212,7 +212,13 @@ print dol_get_fiche_head($head, 'element', $langs->trans("Project"), -1, ($objec // Project card -$linkback = ''.$langs->trans("BackToList").''; +if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) { + $tmpurl = $_SESSION['pageforbacktolist']['project']; + $tmpurl = preg_replace('/__SOCID__/', $object->socid, $tmpurl); + $linkback = ''.$langs->trans("BackToList").''; +} else { + $linkback = ''.$langs->trans("BackToList").''; +} $morehtmlref = '
'; // Title diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index 47f7cb0a9ef..6e284b5dd0e 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -110,7 +110,13 @@ if (($id > 0 && is_numeric($id)) || !empty($ref)) { // Project card - $linkback = ''.$langs->trans("BackToList").''; + if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) { + $tmpurl = $_SESSION['pageforbacktolist']['project']; + $tmpurl = preg_replace('/__SOCID__/', $object->socid, $tmpurl); + $linkback = ''.$langs->trans("BackToList").''; + } else { + $linkback = ''.$langs->trans("BackToList").''; + } $morehtmlref = '
'; // Title diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index aa40ba4bc5a..c781fb49e17 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -53,7 +53,7 @@ if ($search_project_user == $user->id) { // Security check $socid = 0; //if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement. -if (!$user->rights->projet->lire) { +if (!$user->hasRight('projet', 'lire')) { accessforbidden(); } diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 985be60b138..d75602e76b5 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -375,6 +375,8 @@ if (empty($reshook)) { * View */ +unset($_SESSION['pageforbacktolist']['project']); + $form = new Form($db); $formcompany = new FormCompany($db); diff --git a/htdocs/projet/messaging.php b/htdocs/projet/messaging.php index e0290d984a4..2b50f32f3d4 100644 --- a/htdocs/projet/messaging.php +++ b/htdocs/projet/messaging.php @@ -126,7 +126,13 @@ print dol_get_fiche_head($head, 'agenda', $langs->trans("Project"), -1, ($object // Project card -$linkback = ''.$langs->trans("BackToList").''; +if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) { + $tmpurl = $_SESSION['pageforbacktolist']['project']; + $tmpurl = preg_replace('/__SOCID__/', $object->socid, $tmpurl); + $linkback = ''.$langs->trans("BackToList").''; +} else { + $linkback = ''.$langs->trans("BackToList").''; +} $morehtmlref = '
'; // Title diff --git a/htdocs/projet/note.php b/htdocs/projet/note.php index 20392059916..5f11bf20282 100644 --- a/htdocs/projet/note.php +++ b/htdocs/projet/note.php @@ -96,7 +96,13 @@ if ($id > 0 || !empty($ref)) { // Project card - $linkback = ''.$langs->trans("BackToList").''; + if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) { + $tmpurl = $_SESSION['pageforbacktolist']['project']; + $tmpurl = preg_replace('/__SOCID__/', $object->socid, $tmpurl); + $linkback = ''.$langs->trans("BackToList").''; + } else { + $linkback = ''.$langs->trans("BackToList").''; + } $morehtmlref = '
'; // Title diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 196bc2d4582..b044b2a2a48 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -566,7 +566,13 @@ if ($id > 0 || !empty($ref)) { // Project card - $linkback = ''.$langs->trans("BackToList").''; + if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) { + $tmpurl = $_SESSION['pageforbacktolist']['project']; + $tmpurl = preg_replace('/__SOCID__/', $object->socid, $tmpurl); + $linkback = ''.$langs->trans("BackToList").''; + } else { + $linkback = ''.$langs->trans("BackToList").''; + } $morehtmlref = '
'; // Title diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 52f68b11b08..ffc67f6e2cb 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -943,7 +943,13 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser // Project card - $linkback = ''.$langs->trans("BackToList").''; + if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) { + $tmpurl = $_SESSION['pageforbacktolist']['project']; + $tmpurl = preg_replace('/__SOCID__/', $projectstatic->socid, $tmpurl); + $linkback = ''.$langs->trans("BackToList").''; + } else { + $linkback = ''.$langs->trans("BackToList").''; + } $morehtmlref = '
'; // Title diff --git a/htdocs/public/bookcal/booking.php b/htdocs/public/bookcal/booking.php index 74972cfc8f0..0ddc53ebd6f 100644 --- a/htdocs/public/bookcal/booking.php +++ b/htdocs/public/bookcal/booking.php @@ -44,6 +44,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/bookcal/class/calendar.class.php'; require_once DOL_DOCUMENT_ROOT.'/bookcal/class/availabilities.class.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; $langs->loadLangs(array("main", "other", "dict", "agenda", "errors", "companies")); @@ -169,13 +171,21 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ if ($action == 'add') { $error = 0; - $urlback = ''; + $idcontact = 0; + $calendar = new Calendar($db); + $contact = new Contact($db); + $actioncomm = new ActionComm($db); + + $res = $calendar->fetch($fk_calendar); + if ($res < 0) { + $error++; + $errmsg .= $calendar->error." ".join(',', $calendar->errors); + } + if (!is_object($user)) { $user = new User($db); } - $booking = new ActionComm($db); - $db->begin(); if (!GETPOST("lastname")) { $error++; @@ -191,21 +201,71 @@ if ($action == 'add') { } if (!$error) { - $booking->ref = $booking->getNextNumRef(); - $booking->lastname = GETPOST("lastname"); - $booking->firstname = GETPOST("firstname"); - $booking->email = GETPOST("email"); - $booking->description = GETPOST("description"); - $booking->duration = GETPOST("duration"); - $booking->start = GETPOST("datetimebooking", 'int'); - $booking->fk_bookcal_availability = GETPOST("id", 'int'); + $sql = "SELECT s.rowid"; + $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as s"; + $sql .= " WHERE s.lastname = '".GETPOST("lastname")."'"; + $sql .= " AND s.firstname = '".GETPOST("firstname")."'"; + $sql .= " AND s.email = '".GETPOST("email")."'"; + $resql = $db->query($sql); - $result = $booking->create($user); - if ($result <= 0) { + if ($resql) { + $num = $db->num_rows($resql); + if ($num > 0) { + $obj = $db->fetch_object($resql); + $idcontact = $obj->rowid; + $contact->fetch($idcontact); + } else { + $contact->lastname = GETPOST("lastname"); + $contact->firstname = GETPOST("firstname"); + $contact->email = GETPOST("email"); + $result = $contact->create($user); + if ($result < 0) { + $error++; + $errmsg .= $contact->error." ".join(',', $contact->errors); + } + } + } else { $error++; - $errmsg = ($booking->error ? $booking->error.'
' : '').join('
', $booking->errors); + $errmsg .= $db->lasterror(); } } + + if (!$error) { + $dateend = dol_time_plus_duree(GETPOST("datetimebooking", 'int'), GETPOST("duration"), 'i'); + + $actioncomm->label = "test"; + $actioncomm->type = 'AC_RDV'; + $actioncomm->type_id = 5; + $actioncomm->datep = GETPOST("datetimebooking", 'int'); + $actioncomm->datef = $dateend; + $actioncomm->note_private = GETPOST("description"); + $actioncomm->percentage = -1; + $actioncomm->fk_bookcal_availability = GETPOST("id", 'int'); + $actioncomm->userownerid = $calendar->visibility; + $actioncomm->contact_id = $contact->id; + $actioncomm->socpeopleassigned = $contact->id; + $result = $actioncomm->create($user); + if ($result < 0) { + $error++; + $errmsg .= $actioncomm->error." ".join(',', $actioncomm->errors); + } + + if (!$error) { + $sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources"; + $sql .= "(fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency"; + $sql .= ") VALUES ("; + $sql .= (int) $actioncomm->id; + $sql .= ", 'socpeople'"; + $sql .= ", ". (int) $contact->id; + $sql .= ", 0, 0, 0)"; + $resql = $db->query($sql); + if (!$resql) { + $error++; + $errmsg .= $db->lasterror(); + } + } + } + if (!$error) { $db->commit(); $action = 'afteradd'; diff --git a/htdocs/public/bookcal/index.php b/htdocs/public/bookcal/index.php index cd4db57da4d..39d6b1f84da 100644 --- a/htdocs/public/bookcal/index.php +++ b/htdocs/public/bookcal/index.php @@ -180,7 +180,7 @@ print '
'; print '

'.(!empty($object->label) ? $object->label : $object->ref).'

'; -$sql = "SELECT b.rowid, b.ref, b.label, b.start, b.end, b.duration, b.startHour, b.endHour"; +$sql = "SELECT b.rowid, b.label, b.start, b.end, b.duration, b.startHour, b.endHour"; $sql .= " FROM ".MAIN_DB_PREFIX."bookcal_availabilities as b"; $sql .= " WHERE b.status = ".(int) $availabilities::STATUS_VALIDATED; $sql .= " AND b.fk_bookcal_calendar = ".(int) $id; @@ -193,7 +193,7 @@ if ($resql) { while ($i < $num) { $i++; $obj = $db->fetch_object($resql); - print ''; + print ''; } } print '
'; diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index 954e2428cfe..ccf0b992e29 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -266,7 +266,7 @@ if ($action == "view_ticketlist") { if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { if ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate') { - $enabled = abs(dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1, 1, 0)); + $enabled = abs(dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1, 1, '2')); $enabled = (($enabled == 0 || $enabled == 3) ? 0 : $enabled); $arrayfields["ef.".$key] = array('label' => $extrafields->attributes[$object->table_element]['label'][$key], 'checked' => ($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1, 'position' => $extrafields->attributes[$object->table_element]['pos'][$key], 'enabled' => $enabled && $extrafields->attributes[$object->table_element]['perms'][$key]); } diff --git a/htdocs/public/website/javascript.js.php b/htdocs/public/website/javascript.js.php new file mode 100644 index 00000000000..51cecf8c699 --- /dev/null +++ b/htdocs/public/website/javascript.js.php @@ -0,0 +1,171 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/public/website/javascript.js.php + * \ingroup website + * \brief Page to output style page. Called with + */ + +if (!defined('NOTOKENRENEWAL')) { + define('NOTOKENRENEWAL', 1); // Disables token renewal +} +if (!defined('NOLOGIN')) { + define("NOLOGIN", 1); +} +if (!defined('NOCSRFCHECK')) { + define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. +} +if (!defined('NOREQUIREMENU')) { + define('NOREQUIREMENU', '1'); +} +if (!defined('NOREQUIREHTML')) { + define('NOREQUIREHTML', '1'); +} +if (!defined('NOREQUIREAJAX')) { + define('NOREQUIREAJAX', '1'); +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} +if (!defined('NOBROWSERNOTIF')) { + define('NOBROWSERNOTIF', '1'); +} + +/** + * Header empty + * + * @return void + */ +function llxHeader() +{ +} +/** + * Footer empty + * + * @return void + */ +function llxFooter() +{ +} + +require '../../master.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + +$error = 0; +$website = GETPOST('website', 'alpha'); +$websiteid = GETPOST('websiteid', 'int'); +$pageid = GETPOST('page', 'alpha') ?GETPOST('page', 'alpha') : GETPOST('pageid', 'alpha'); + +$accessallowed = 1; +$type = ''; + + +/* + * View + */ + +$appli = constant('DOL_APPLICATION_TITLE'); +if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { + $appli = $conf->global->MAIN_APPLICATION_TITLE; +} + +//print 'Directory with '.$appli.' websites.
'; + +if (empty($pageid)) { + require_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php'; + require_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php'; + + $object = new Website($db); + if ($websiteid) { + $object->fetch($websiteid); + $website = $object->ref; + } else { + $object->fetch(0, $website); + } + + $objectpage = new WebsitePage($db); + /* Not required for CSS file + $array=$objectpage->fetchAll($object->id); + + if (is_array($array) && count($array) > 0) + { + $firstrep=reset($array); + $pageid=$firstrep->id; + } + */ +} +/* Not required for CSS file +if (empty($pageid)) +{ + $langs->load("website"); + print $langs->trans("PreviewOfSiteNotYetAvailable"); + exit; +} +*/ + +// Security: Delete string ../ into $original_file +global $dolibarr_main_data_root; + +$original_file = $dolibarr_main_data_root.($conf->entity > 1 ? '/'.$conf->entity : '').'/website/'.$website.'/javascript.js.php'; + +// Find the subdirectory name as the reference +$refname = basename(dirname($original_file)."/"); + +// Security: +// Limite acces si droits non corrects +if (!$accessallowed) { + accessforbidden(); +} + +// Security: +// On interdit les remontees de repertoire ainsi que les pipe dans +// les noms de fichiers. +if (preg_match('/\.\./', $original_file) || preg_match('/[<>|]/', $original_file)) { + dol_syslog("Refused to deliver file ".$original_file); + $file = basename($original_file); // Do no show plain path of original_file in shown error message + dol_print_error(0, $langs->trans("ErrorFileNameInvalid", $file)); + exit; +} + +clearstatcache(); + +$filename = basename($original_file); + +// Output file on browser +dol_syslog("javascript.js.css.php include $original_file $filename content-type=$type"); +$original_file_osencoded = dol_osencode($original_file); // New file name encoded in OS encoding charset + +// This test if file exists should be useless. We keep it to find bug more easily +if (!file_exists($original_file_osencoded)) { + $langs->load("website"); + print $langs->trans("RequestedPageHasNoContentYet", $pageid); + //dol_print_error(0,$langs->trans("ErrorFileDoesNotExists",$original_file)); + exit; +} + + +// Output page content +define('USEDOLIBARRSERVER', 1); +print '/* Page content '.$original_file.' : JS content that was saved into tpl dir */'."\n"; +require_once $original_file_osencoded; + + +if (is_object($db)) { + $db->close(); +} diff --git a/htdocs/societe/project.php b/htdocs/societe/project.php index 5a8ba6a46b2..4bb657bee2b 100644 --- a/htdocs/societe/project.php +++ b/htdocs/societe/project.php @@ -37,6 +37,8 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; // Load translation files required by the page $langs->loadLangs(array('companies', 'projects')); +$action = GETPOST('action', 'aZ09'); + // Security check $socid = GETPOST('socid', 'int'); if ($user->socid) { @@ -47,6 +49,8 @@ $result = restrictedArea($user, 'societe', $socid, '&societe'); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('projectthirdparty')); +$object = new Societe($db); + /* * Actions @@ -64,9 +68,7 @@ if ($reshook < 0) { * View */ -$contactstatic = new Contact($db); - -$form = new Form($db); +unset($_SESSION['pageforbacktolist']['project']); if ($socid) { require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -74,8 +76,6 @@ if ($socid) { $langs->load("companies"); - - $object = new Societe($db); $result = $object->fetch($socid); $title = $langs->trans("Projects"); diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 32d7301b6fe..3be9730e9cd 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -1455,10 +1455,12 @@ if (!empty($conf->global->TAKEPOS_WEIGHING_SCALE)) { //echo ''; print ''; } else { - if (getDolGlobalString('TAKEPOS_HIDE_PRODUCT_IMAGES')) { - echo ''; - } else { + if (!getDolGlobalString('TAKEPOS_HIDE_PRODUCT_PRICES')) { print '
'; + } + if (getDolGlobalString('TAKEPOS_HIDE_PRODUCT_IMAGES')) { + print ''; + } else { print ''; } } diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index c531dbc09e0..e2adaa6700f 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -56,6 +56,8 @@ if (!defined('NOREQUIREAJAX')) { // Note that only directory logo is free to access without login. $needlogin = 1; if (isset($_GET["modulepart"])) { + // Some value of modulepart can be used to get resources that are public so no login are required. + // For logo of company if ($_GET["modulepart"] == 'mycompany' && preg_match('/^\/?logos\//', $_GET['file'])) { $needlogin = 0; @@ -64,10 +66,11 @@ if (isset($_GET["modulepart"])) { if ($_GET["modulepart"] == 'barcode') { $needlogin = 0; } - // Some value of modulepart can be used to get resources that are public so no login are required. + // Medias files if ($_GET["modulepart"] == 'medias') { $needlogin = 0; } + // User photo if ($_GET["modulepart"] == 'userphotopublic') { $needlogin = 0; } diff --git a/htdocs/website/index.php b/htdocs/website/index.php index e0b4d4c6c84..997af5d8f2f 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3731,6 +3731,13 @@ if ($action == 'editcss') { print ''; // MAX_FILE_SIZE must precede the field type=file } print ''; + + $uploadfolder = $conf->website->dir_output.'/'.$websitekey; + if (dol_is_file($uploadfolder.'/favicon.png')) { + print '
'; + print ''; + print '
'; + } print ''; // CSS file diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index 545306f5734..cf9e223d737 100644 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -960,7 +960,7 @@ class SecurityTest extends PHPUnit\Framework\TestCase print "result = ".$result."\n"; $this->assertEquals('Parent project not found', $result); - $result=dol_eval('$a=function() { }; $a;', 1, 1, ''); + $result=dol_eval('$a=function() { }; $a;', 1, 1, '0'); print "result = ".$result."\n"; $this->assertContains('Bad string syntax to evaluate', $result); @@ -999,12 +999,22 @@ class SecurityTest extends PHPUnit\Framework\TestCase print "result = ".$result."\n"; $this->assertTrue($result); - // Same with syntax error + // Same with a value that does not match $leftmenu = 'XXX'; $result=dol_eval('$conf->currency && preg_match(\'/^(AAA|BBB)/\',$leftmenu)', 1, 1, '1'); print "result = ".$result."\n"; $this->assertFalse($result); + $leftmenu = 'AAA'; + $result=dol_eval('$conf->currency && isStringVarMatching(\'leftmenu\', \'(AAA|BBB)\')', 1, 1, '1'); + print "result = ".$result."\n"; + $this->assertTrue($result); + + $leftmenu = 'XXX'; + $result=dol_eval('$conf->currency && isStringVarMatching(\'leftmenu\', \'(AAA|BBB)\')', 1, 1, '1'); + print "result = ".$result."\n"; + $this->assertFalse($result); + // Case with param onlysimplestring = 1 @@ -1015,6 +1025,10 @@ class SecurityTest extends PHPUnit\Framework\TestCase $result=dol_eval("(\$a.'aa')", 1, 0); print "result = ".$result."\n"; $this->assertContains('Bad string syntax to evaluate', $result); + + $result=dol_eval('$a="abs" && $a(5)', 1, 0); + print "result = a".$result."\n"; + $this->assertContains('Bad string syntax to evaluate', $result); } diff --git a/test/phpunit/WebsiteTest.php b/test/phpunit/WebsiteTest.php index a0cbc5084c7..86d510ce8c8 100644 --- a/test/phpunit/WebsiteTest.php +++ b/test/phpunit/WebsiteTest.php @@ -226,4 +226,27 @@ class WebsiteTest extends PHPUnit\Framework\TestCase print __METHOD__." result checkPHPCode=".$result."\n"; $this->assertEquals($result, 1, 'checkPHPCode did not detect the string was dangerous'); } + + /** + * testDolKeepOnlyPhpCode + * + * @return void + */ + public function testDolKeepOnlyPhpCode() + { + $s = 'HTML content and more HTML content'; + $result = dolKeepOnlyPhpCode($s); + print __METHOD__." result dolKeepOnlyPhpCode=".$result."\n"; + $this->assertEquals('', $result, 'dolKeepOnlyPhpCode did extract the correct string'); + + $s = 'HTML content and more HTML content'; + $result = dolKeepOnlyPhpCode($s); + print __METHOD__." result dolKeepOnlyPhpCode=".$result."\n"; + $this->assertEquals('', $result, 'dolKeepOnlyPhpCode did extract the correct string'); + + $s = 'HTML content and more HTML content'; + $result = dolKeepOnlyPhpCode($s); + print __METHOD__." result dolKeepOnlyPhpCode=".$result."\n"; + $this->assertEquals('', $result, 'dolKeepOnlyPhpCode did extract the correct string'); + } }