diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index b580b947e6b..0210491fba7 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -313,12 +313,15 @@ class BlockedLog * @param Object $object object to store * @param string $action action * @param string $amounts amounts + * @param User $fuser User object (forced) * @return int >0 if OK, <0 if KO */ - public function setObjectData(&$object, $action, $amounts) + public function setObjectData(&$object, $action, $amounts, $fuser = null) { global $langs, $user, $mysoc; + if (is_object($fuser)) $user = $fuser; + // Generic fields // action diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index b79dee21478..825abfc5fe5 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -668,7 +668,7 @@ if ($type == Categorie::TYPE_PROJECT) { print "\t".''."\n"; print ''; - print $project->getNomUrl(1,0); + print $project->getNomUrl(1); print "\n"; print ''.$project->ref."\n"; print ''.$project->title."\n"; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 898144f993a..e63cfa3da99 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -342,6 +342,7 @@ class Contact extends CommonObject $sql .= ", email='".$this->db->escape($this->email)."'"; $sql .= ", skype='".$this->db->escape($this->skype)."'"; $sql .= ", photo='".$this->db->escape($this->photo)."'"; + $sql .= ", birthday=".($this->birthday ? "'".$this->db->idate($this->birthday)."'" : "null"); $sql .= ", note_private = ".(isset($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null"); $sql .= ", note_public = ".(isset($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null"); $sql .= ", phone = ".(isset($this->phone_pro)?"'".$this->db->escape($this->phone_pro)."'":"null"); @@ -584,8 +585,8 @@ class Contact extends CommonObject $resql = $this->db->query($sql); if (! $resql) { - $error++; - $this->error=$this->db->lasterror(); + $error++; + $this->error=$this->db->lasterror(); } // Mis a jour alerte birthday diff --git a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php index f97d1400018..6666cdec47b 100644 --- a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php +++ b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php @@ -111,7 +111,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers return 0; // not implemented action log } - $result = $b->setObjectData($object, $action, $amounts); // Set field date_object, ref_object, fk_object, element, object_data + $result = $b->setObjectData($object, $action, $amounts, $user); // Set field date_object, ref_object, fk_object, element, object_data if ($result < 0) { diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 89a508ea2ec..2966ca37f1a 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1346,6 +1346,8 @@ if ($action=='create') dol_htmloutput_events(); + $currency_code = $conf->currency; + $societe=''; if ($socid>0) { diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index fce91f7925d..5132168c076 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -183,7 +183,7 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09 print ''.$langs->trans("ServerVersion").''; print ''.$version.''; dolibarr_install_syslog("upgrade: " . $langs->transnoentities("ServerVersion") . ": " .$version); - if ($db->type == 'mysqli') + if ($db->type == 'mysqli' && function_exists('mysqli_get_charset')) { $tmparray = $db->db->get_charset(); print ''.$langs->trans("ClientCharset").''; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 4a5bcdab70b..d8b4e3ef72c 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -77,7 +77,9 @@ $planned_workload=$planned_workloadhour*3600+$planned_workloadmin*60; $userAccess=0; - +$parameters=array('id'=>$id); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); /* * Actions */ diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 10f64869257..ac711015765 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -60,6 +60,9 @@ $projectstatic = new Project($db); // fetch optionals attributes and labels $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); +$parameters=array('id'=>$id); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); /* * Actions diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index c1a62204331..f401f92e84d 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -961,7 +961,7 @@ class Societe extends CommonObject $sql .= ",fk_effectif = ".(! empty($this->effectif_id)?"'".$this->db->escape($this->effectif_id)."'":"null"); if (isset($this->stcomm_id)) { - $sql .= ",fk_stcomm=".($this->stcomm_id > 0 ? $this->stcomm_id : "0"); + $sql .= ",fk_stcomm=".(!empty($this->stcomm_id) ? $this->stcomm_id : "0"); } $sql .= ",fk_typent = ".(! empty($this->typent_id)?"'".$this->db->escape($this->typent_id)."'":"0"); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index d711fd8b4b4..cc7146272fa 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1889,7 +1889,7 @@ else } else if ($caneditpassword) { - $text=''; + $text=''; if ($dolibarr_main_authentication && $dolibarr_main_authentication == 'http') { $text=$form->textwithpicto($text,$langs->trans("DolibarrInHttpAuthenticationSoPasswordUseless",$dolibarr_main_authentication),1,'warning'); diff --git a/htdocs/variants/ajax/getCombinations.php b/htdocs/variants/ajax/getCombinations.php index 8b7baaee27e..5c57191c3eb 100644 --- a/htdocs/variants/ajax/getCombinations.php +++ b/htdocs/variants/ajax/getCombinations.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; header('Content-Type: application/json'); -$id = GETPOST('id'); +$id = GETPOST('id', 'int'); if (!$id) { print json_encode(array( diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 84f3b7fa91c..04f53e55d21 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -397,7 +397,7 @@ if (! empty($id) || ! empty($ref)) select.empty().append(''); - jQuery.getJSON("", { + jQuery.getJSON("ajax/get_attribute_values.php", { id: jQuery(this).val() }, function(data) { if (data.error) { @@ -747,8 +747,12 @@ if (! empty($id) || ! empty($ref)) print ''; } +} else { + llxHeader(); + // not found } + llxFooter(); $db->close();