diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 33009ad09ba..e5c245ab78a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4879,6 +4879,8 @@ class Form print '' . $langs->trans("NoEstablishmentFound") . ''; } } + + return $num; } else { dol_print_error($this->db); return -1; @@ -8765,9 +8767,9 @@ class Form ); $reshook = $hookmanager->executeHooks('showLinkedObjectBlock', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - if (empty($reshook)) { - $nbofdifferenttypes = count($object->linkedObjects); + $nbofdifferenttypes = count($object->linkedObjects); + if (empty($reshook)) { print ''; print load_fiche_titre($langs->trans($title), $morehtmlright, '', 0, 0, 'showlinkedobjectblock'); @@ -8893,20 +8895,19 @@ class Form $res = @include dol_buildpath('core/tpl/objectlinked_lineimport.tpl.php'); } - print ''; - - return $nbofdifferenttypes; } + + return $nbofdifferenttypes; } /** * Show block with links to link to other objects. * - * @param CommonObject $object Object we want to show links to - * @param array $restrictlinksto Restrict links to some elements, for exemple array('order') or array('supplier_order'). null or array() if no restriction. - * @param array $excludelinksto Do not show links of this type, for exemple array('order') or array('supplier_order'). null or array() if no exclusion. - * @return string <0 if KO, >0 if OK + * @param CommonObject $object Object we want to show links to + * @param array $restrictlinksto Restrict links to some elements, for exemple array('order') or array('supplier_order'). null or array() if no restriction. + * @param array $excludelinksto Do not show links of this type, for exemple array('order') or array('supplier_order'). null or array() if no exclusion. + * @return string HTML block */ public function showLinkToObjectBlock($object, $restrictlinksto = array(), $excludelinksto = array()) { diff --git a/htdocs/core/lib/xcal.lib.php b/htdocs/core/lib/xcal.lib.php index 1bf83410088..57cbb0188a5 100644 --- a/htdocs/core/lib/xcal.lib.php +++ b/htdocs/core/lib/xcal.lib.php @@ -30,7 +30,7 @@ * @param string $desc Description of export * @param array $events_array Array of events ("uid","startdate","duration","enddate","title","summary","category","email","url","desc","author") * @param string $outputfile Output file - * @return int < 0 if ko, Nb of events in file if ok + * @return int < 0 if KO, Nb of events in file if OK */ function build_calfile($format, $title, $desc, $events_array, $outputfile) { @@ -43,6 +43,8 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile) return -1; } + $nbevents = 0; + // Note: A cal file is an UTF8 encoded file $calfileh = fopen($outputfile, "w"); @@ -144,6 +146,8 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile) */ if ($type === "event") { + $nbevents++; + fwrite($calfileh, "BEGIN:VEVENT\n"); fwrite($calfileh, "UID:".$uid."\n"); @@ -247,6 +251,8 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile) // Output the vCard/iCal VJOURNAL object if ($type === "journal") { + $nbevents++; + fwrite($calfileh, "BEGIN:VJOURNAL\n"); fwrite($calfileh, "UID:".$uid."\n"); @@ -289,6 +295,8 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile) dol_syslog("xcal.lib.php::build_calfile Failed to open file ".$outputfile." for writing"); return -2; } + + return $nbevents; } /** @@ -303,7 +311,7 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile) * @param string $filter (optional) Filter * @param string $url Url (If empty, forge URL for agenda RSS export) * @param string $langcode Language code to show in header - * @return int < 0 if ko, Nb of events in file if ok + * @return int < 0 if KO, Nb of events in file if OK */ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filter = '', $url = '', $langcode = '') { @@ -317,6 +325,8 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt return -1; } + $nbevents = 0; + $fichier = fopen($outputfile, "w"); if ($fichier) { @@ -362,6 +372,8 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt } if ($eventqualified) { + $nbevents++; + if (is_object($event) && get_class($event) == 'WebsitePage') { // Convert object into an array $tmpevent = array(); @@ -426,6 +438,8 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt fclose($fichier); dolChmod($outputfile); } + + return $nbevents; } /** @@ -437,8 +451,6 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt */ function format_cal($format, $string) { - global $conf; - $newstring = $string; if ($format === "vcal") { diff --git a/htdocs/datapolicy/class/datapolicy.class.php b/htdocs/datapolicy/class/datapolicy.class.php index 7bbe8d7c1a6..e83730c89e2 100644 --- a/htdocs/datapolicy/class/datapolicy.class.php +++ b/htdocs/datapolicy/class/datapolicy.class.php @@ -44,7 +44,7 @@ class DataPolicy /** * getAllContactNotInformed * - * @return number + * @return integer */ public function getAllContactNotInformed() { @@ -75,12 +75,14 @@ class DataPolicy $this->error = $this->db->error(); return -1; } + + return 1; } /** * getAllCompaniesNotInformed * - * @return number + * @return integer */ public function getAllCompaniesNotInformed() { @@ -110,12 +112,14 @@ class DataPolicy $this->error = $this->db->error(); return -1; } + + return 1; } /** * getAllAdherentsNotInformed * - * @return number + * @return integer */ public function getAllAdherentsNotInformed() { @@ -145,6 +149,8 @@ class DataPolicy $this->error = $this->db->error(); return -1; } + + return 1; } /**