/**
 *	\file		lib/mymodule.lib.php
 *	\ingroup	mymodule
 *	\brief		This file is an example module library
 *				Put some comments here
 */
function mymoduleAdminPrepareHead()
{
    global $langs, $conf;
    $langs->load("mymodule@mymodule");
    $h = 0;
    $head = array();
    $head[$h][0] = dol_buildpath("/mymodule/admin/admin_mymodule.php", 1);
    $head[$h][1] = $langs->trans("Settings");
    $head[$h][2] = 'settings';
    $h++;
    $head[$h][0] = dol_buildpath("/mymodule/admin/about.php", 1);
    $head[$h][1] = $langs->trans("About");
    $head[$h][2] = 'about';
    $h++;
    // Show more tabs from modules
    // Entries must be declared in modules descriptor with line
    //$this->tabs = array(
    //	'entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'
    //); // to add new tab
    //$this->tabs = array(
    //	'entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'
    //); // to remove a tab
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'mymodule');
    return $head;
}
Пример #2
0
/**
 *	Prepare array with list of admin tabs
 *
 *	@param	AccountingAccount	$object		Object instance we show card
 *	@return	array				Array of tabs to show
 */
function admin_accounting_prepare_head(AccountingAccount $object = null)
{
    global $langs, $conf;
    $h = 0;
    $head = array();
    $head[$h][0] = dol_buildpath('/accountancy/admin/index.php', 1);
    $head[$h][1] = $langs->trans("Configuration");
    $head[$h][2] = 'general';
    $h++;
    // Show more tabs from modules
    // Entries must be declared in modules descriptor with line
    // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
    // $this->tabs = array('entity:-tabname); to remove a tab
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_admin');
    $head[$h][0] = DOL_URL_ROOT . '/accountancy/admin/journal.php';
    $head[$h][1] = $langs->trans("Journaux");
    $head[$h][2] = 'journal';
    $h++;
    $head[$h][0] = DOL_URL_ROOT . '/accountancy/admin/export.php';
    $head[$h][1] = $langs->trans("Export");
    $head[$h][2] = 'export';
    $h++;
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_admin', 'remove');
    return $head;
}
/**
 * \brief Crée un document PDF
 * \param db objet base de donnee
 * \param modele modele à utiliser
 * \param		outputlangs		objet lang a utiliser pour traduction
 * \return int <0 if KO, >0 if OK
 */
function immobilier_pdf_create($db, $id, $message, $typeModele, $outputlangs, $file)
{
    global $conf, $langs;
    $langs->load('immobilier@immobilier');
    // Charge le modele
    $nomModele = dol_buildpath('/immobilier/core/modules/immobilier/pdf/pdf_' . $typeModele . '.modules.php');
    if (file_exists($nomModele)) {
        require_once $nomModele;
        $classname = "pdf_" . $typeModele;
        $obj = new $classname($db);
        $obj->message = $message;
        // We save charset_output to restore it because write_file can change it if needed for
        // output format that does not support UTF8.
        $sav_charset_output = $outputlangs->charset_output;
        if ($obj->write_file($id, $outputlangs, $file, $socid, $courrier) > 0) {
            $outputlangs->charset_output = $sav_charset_output;
            return 1;
        } else {
            $outputlangs->charset_output = $sav_charset_output;
            dol_print_error($db, "pdf_create Error: " . $obj->error);
            return -1;
        }
    } else {
        dol_print_error('', $langs->trans("Error") . " " . $langs->trans("ErrorFileDoesNotExists", $file));
        return -1;
    }
}
/**
 *	\file		lib/propalautosend.lib.php
 *	\ingroup	propalautosend
 *	\brief		This file is an example module library
 *				Put some comments here
 */
function propalautosendAdminPrepareHead()
{
    global $langs, $conf;
    $langs->load("propalautosend@propalautosend");
    $h = 0;
    $head = array();
    $head[$h][0] = dol_buildpath("/propalautosend/admin/propalautosend_setup.php", 1);
    $head[$h][1] = $langs->trans("Parameters");
    $head[$h][2] = 'settings';
    $h++;
    $head[$h][0] = dol_buildpath("/propalautosend/admin/propalautosend_about.php", 1);
    $head[$h][1] = $langs->trans("About");
    $head[$h][2] = 'about';
    $h++;
    // Show more tabs from modules
    // Entries must be declared in modules descriptor with line
    //$this->tabs = array(
    //	'entity:+tabname:Title:@propalautosend:/propalautosend/mypage.php?id=__ID__'
    //); // to add new tab
    //$this->tabs = array(
    //	'entity:-tabname:Title:@propalautosend:/propalautosend/mypage.php?id=__ID__'
    //); // to remove a tab
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'propalautosend');
    return $head;
}
Пример #5
0
/**
 *  \brief      	Define head array for tabs of security setup pages
 *  \return			Array of head
 *  \version    	$Id: memcached.lib.php,v 1.1 2011/01/16 13:30:09 eldy Exp $
 */
function memcached_prepare_head()
{
	global $langs, $conf, $user;
	$h = 0;
	$head = array();

	$head[$h][0] = dol_buildpath("/memcached/admin/memcached.php",1);
	$head[$h][1] = $langs->trans("ServerSetup");
	$head[$h][2] = 'serversetup';
	$h++;

	if (class_exists("Memcache") || class_exists("Memcached"))
	{
		if (empty($dolibarr_memcached_view_disable))	// Hidden variable to add to conf file to disable browsing
		{
			$head[$h][0] = dol_buildpath("/memcached/admin/memcached_stats.php?op=1",1);
			$head[$h][1] = $langs->trans("ServerStatistics");
			$head[$h][2] = 'serverstats';
			$h++;

			$head[$h][0] = dol_buildpath("/memcached/admin/memcached_stats.php?op=2",1);
			$head[$h][1] = $langs->trans("CacheBrowser");
			$head[$h][2] = 'cachebrowser';
			$h++;
		}
	}

	return $head;
}
Пример #6
0
/**
 * Initialize the array of tabs for customer invoice
 *
 * @param	Facture		$object		Invoice object
 * @return	array					Array of head tabs
 */
function facture_prepare_head($object)
{
    global $langs, $conf, $user;
    $h = 0;
    $head = array();
    $head[$h][0] = DOL_URL_ROOT . '/compta/facture.php?facid=' . $object->id;
    $head[$h][1] = $langs->trans('CardBill');
    $head[$h][2] = 'compta';
    $h++;
    if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) {
        $head[$h][0] = DOL_URL_ROOT . '/compta/facture/contact.php?facid=' . $object->id;
        $head[$h][1] = $langs->trans('ContactsAddresses');
        $head[$h][2] = 'contact';
        $h++;
    }
    if (!empty($conf->global->MAIN_USE_PREVIEW_TABS)) {
        $head[$h][0] = DOL_URL_ROOT . '/compta/facture/apercu.php?facid=' . $object->id;
        $head[$h][1] = $langs->trans('Preview');
        $head[$h][2] = 'preview';
        $h++;
    }
    //if ($fac->mode_reglement_code == 'PRE')
    if ($conf->prelevement->enabled) {
        $head[$h][0] = DOL_URL_ROOT . '/compta/facture/prelevement.php?facid=' . $object->id;
        $head[$h][1] = $langs->trans('StandingOrders');
        $head[$h][2] = 'standingorders';
        $h++;
    }
    if ($conf->Ego->enabled && $user->rights->ego->paiment->create) {
        $langs->load('ego@ego');
        $head[$h][0] = dol_buildpath('/ego/paiment.php?facid=' . $object->id, 1);
        $head[$h][1] = $langs->trans('EgoPay');
        $head[$h][2] = 'egopay';
        $h++;
    }
    // Show more tabs from modules
    // Entries must be declared in modules descriptor with line
    // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
    // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to remove a tab
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'invoice');
    if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
        $head[$h][0] = DOL_URL_ROOT . '/compta/facture/note.php?facid=' . $object->id;
        $head[$h][1] = $langs->trans('Notes');
        $head[$h][2] = 'note';
        $h++;
    }
    $head[$h][0] = DOL_URL_ROOT . '/compta/facture/document.php?facid=' . $object->id;
    /* $filesdir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($fac->ref);
    	  include_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php');
    	  $listoffiles=dol_dir_list($filesdir,'files',1);
    	  $head[$h][1] = (count($listoffiles)?$langs->trans('DocumentsNb',count($listoffiles)):$langs->trans('Documents')); */
    $head[$h][1] = $langs->trans('Documents');
    $head[$h][2] = 'documents';
    $h++;
    $head[$h][0] = DOL_URL_ROOT . '/compta/facture/info.php?facid=' . $object->id;
    $head[$h][1] = $langs->trans('Info');
    $head[$h][2] = 'info';
    $h++;
    return $head;
}
/**
 *	\file		lib/dolidacticiel.lib.php
 *	\ingroup	dolidacticiel
 *	\brief		This file is an example module library
 *				Put some comments here
 */
function dolidacticielAdminPrepareHead()
{
    global $langs, $conf;
    $langs->load("dolidacticiel@dolidacticiel");
    $h = 0;
    $head = array();
    $head[$h][0] = dol_buildpath("/dolidacticiel/admin/dolidacticiel_setup.php", 1);
    $head[$h][1] = $langs->trans("Achievements");
    $head[$h][2] = 'ggwp';
    $h++;
    $head[$h][0] = dol_buildpath("/dolidacticiel/admin/dolidacticiel_others.php", 1);
    $head[$h][1] = $langs->trans("DolidacticielOthersTests");
    $head[$h][2] = 'otherstests';
    $h++;
    $head[$h][0] = dol_buildpath("/dolidacticiel/admin/dolidacticiel_admin.php", 1);
    $head[$h][1] = $langs->trans("DolidacticielAdmin");
    $head[$h][2] = 'create';
    $h++;
    $head[$h][0] = dol_buildpath("/dolidacticiel/admin/dolidacticiel_about.php", 1);
    $head[$h][1] = $langs->trans("About");
    $head[$h][2] = 'about';
    $h++;
    // Show more tabs from modules
    // Entries must be declared in modules descriptor with line
    //$this->tabs = array(
    //	'entity:+tabname:Title:@dolidacticiel:/dolidacticiel/mypage.php?id=__ID__'
    //); // to add new tab
    //$this->tabs = array(
    //	'entity:-tabname:Title:@dolidacticiel:/dolidacticiel/mypage.php?id=__ID__'
    //); // to remove a tab
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'dolidacticiel');
    return $head;
}
Пример #8
0
 /**
  * Load data into info_box_contents array to show array later.
  *
  * @param int $max of records to load
  *
  * @return void
  */
 public function loadBox($max = 5)
 {
     global $conf, $user, $langs, $db;
     $this->max = $max;
     dol_include_once('/lead/class/lead.class.php');
     $lead = new Lead($db);
     $lead->fetch_all('DESC', 't.date_closure', $max, 0, array('t.date_closure<' => dol_now()));
     $text = $langs->trans("LeadLate", $max);
     $this->info_box_head = array('text' => $text, 'limit' => dol_strlen($text));
     $i = 0;
     foreach ($lead->lines as $line) {
         // FIXME: line is an array, not an object
         $line->fetch_thirdparty();
         // Ref
         $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, 'url' => dol_buildpath('/lead/lead/card.php', 1) . '?id=' . $line->id);
         $this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $line->ref, 'url' => dol_buildpath('/lead/lead/card.php', 1) . '?id=' . $line->id);
         $this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"', 'logo' => 'company', 'url' => DOL_URL_ROOT . "/comm/fiche.php?socid=" . $line->fk_soc);
         $this->info_box_contents[$i][3] = array('td' => 'align="left"', 'text' => dol_trunc($line->thirdparty->name, 40), 'url' => DOL_URL_ROOT . "/comm/fiche.php?socid=" . $line->fk_soc);
         // Amount Guess
         $this->info_box_contents[$i][4] = array('td' => 'align="left"', 'text' => price($line->amount_prosp, 'HTML') . $langs->getCurrencySymbol($conf->currency));
         // Amount real
         $this->info_box_contents[$i][5] = array('td' => 'align="left"', 'text' => $line->getRealAmount() . $langs->getCurrencySymbol($conf->currency));
         $i++;
     }
 }
 function getComment()
 {
     $comm = $this->comment;
     $comm = preg_replace('/@((\\w|-)+)/', '<a class="user" href="' . dol_buildpath('/twiiitor/hashtag.php?tag=$1&type_tag=user', 1) . '">$0</a>', $comm);
     $comm = preg_replace('/#(\\w+)/', '<a class="object" href="' . dol_buildpath('/twiiitor/hashtag.php?tag=$1&type_tag=hashtag', 1) . '">$0</a>', $comm);
     $comm = preg_replace('/:(\\w+)/', '<a class="rel" href="' . dol_buildpath('/twiiitor/hashtag.php?tag=$1&type_tag=rel', 1) . '">$0</a>', $comm);
     return $comm;
 }
Пример #10
0
 /**
  * Resolve inline images relative URLs to the module's path
  *
  * @param $Excerpt
  * @return array|void
  */
 protected function inlineImage($Excerpt)
 {
     $image = parent::inlineImage($Excerpt);
     $path = new \Enrise\Uri($image['element']['attributes']['src']);
     if ($path->isRelative()) {
         $image['element']['attributes']['src'] = dol_buildpath('/mymodule/' . $path, 1);
     }
     return $image;
 }
function searcheverywhere_prepare_head($str)
{
    global $langs, $conf;
    $h = 0;
    $head = array();
    $head[$h][0] = dol_buildpath('/searcheverywhere/search.php?keyword=' . urlencode($str), 1);
    $head[$h][1] = $langs->trans('Searcheverywhere');
    $head[$h][2] = 'search';
    $h++;
    return $head;
}
 /**
  * 	Enter description here ...
  *
  * 	@param	string	$action		Action type
  */
 function printObjectLine($parameters, &$object, &$action = '', $hook)
 {
     global $conf, $user, $langs, $bcdd;
     $langs->load("massorders@massorders");
     if ($parameters['line']->special_code == 4) {
         $tpl = dol_buildpath('/massorders/tpl/invoices.tpl.php');
         $res = @(include $tpl);
         return 1;
     }
     return 0;
 }
function labels_admin_prepare_head($object)
{
    global $langs, $conf, $user;
    $h = 0;
    $head = array();
    $head[$h][0] = dol_buildpath('/labelprint/admin/labelprint.php', 1);
    $head[$h][1] = $langs->trans("Miscellanous");
    $head[$h][2] = 'general';
    $h++;
    return $head;
}
 function addCalendarChoice($parameters, &$object, &$action, $hookmanager)
 {
     global $conf;
     if (in_array('agenda', explode(':', $parameters['context']))) {
         //if(!empty($conf->global->MAIN_NOT_INC_FULLCALENDAR_HEAD))
         //{
         echo '<script type="text/javascript" src="' . dol_buildpath('/fullcalendar/js/fullcalendar.js.php?force_use_js=1', 1) . '"></script>';
         //}
         return 1;
     }
     return 0;
 }
function _export_factures(&$db, &$format, &$TRefFacture)
{
    switch ($format) {
        case 'natixis':
            $fileName = _parseNatixis($db, $TRefFacture);
            break;
    }
    if ($fileName) {
        header('Location: ' . dol_buildpath('document.php?modulepart=factor&file=' . $fileName, 2));
        exit;
    }
}
Пример #16
0
/**
 * Admin page tabs
 *
 * @return array Tabs to display
 */
function sentryAdminPrepareHead()
{
    global $langs, $conf;
    $langs->load("sentry@sentry");
    $h = 0;
    $head = array();
    $head[$h][0] = dol_buildpath("/sentry/admin/about.php", 1);
    $head[$h][1] = $langs->trans("About");
    $head[$h][2] = 'about';
    $h++;
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'sentry');
    return $head;
}
Пример #17
0
    public function formObjectOptions($parameters, &$object, &$action, HookManager $hookManager)
    {
        global $db, $user, $langs, $mysoc, $dolibarr_main_cookie_cryptkey;
        $langs->load('otp@otp');
        $regenerate_button = '<form method="post">
			<input type="submit" value="' . $langs->trans('OTPRegenerate') . '" class="button" name="regenerate_otp">
		</form>';
        if ($action == '') {
            print '<tr><td>' . $langs->trans('OTPLogin') . '</td><td colspan="2">';
            if (GETPOST('regenerate_otp')) {
                if ($user->admin || $user->id == GETPOST('id', 'int')) {
                    /**
                     * Examples from http://es.php.net/mcrypt_encrypt
                     */
                    // Generates a 20-byte (160-bit) secret key
                    $otpSeed = Seed::generate();
                    $base32Seed = $otpSeed->getValue(Seed::FORMAT_BASE32);
                    $key = pack('H*', $dolibarr_main_cookie_cryptkey);
                    # crear una aleatoria IV para utilizarla co condificación CBC
                    $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);
                    $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
                    $ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $base32Seed, MCRYPT_MODE_CBC, $iv);
                    # anteponer la IV para que esté disponible para el descifrado
                    $ciphertext = $iv . $ciphertext;
                    # codificar el texto cifrado resultante para que pueda ser representado por un string
                    $ciphertext_base64 = base64_encode($ciphertext);
                    $sql = "UPDATE " . MAIN_DB_PREFIX . "user SET otp_seed = '" . $db->escape($ciphertext_base64) . "', otp_counter = 0 WHERE rowid = " . $user->id;
                    $db->query($sql);
                    $qrCode = new QrCode();
                    $qrCode->setText("otpauth://hotp/" . $mysoc->name . ":" . $user->login . "?secret=" . $base32Seed . "&issuer=" . $mysoc->name);
                    $qrCode->setSize(96);
                    $qrCode->setPadding(5);
                    $img_path = __DIR__ . '/../tmp/' . $user->id . '.png';
                    $qrCode->save($img_path);
                    //Qrcode library doesn't warn on image creation error
                    if (file_exists($img_path)) {
                        print '<img src="' . dol_buildpath('/otp/showdoc.php', 1) . '?img=' . $user->id . '"><br>' . $langs->trans('OTPTroubleHash') . '<br />
				<span style="font-family:monospace;font-size:20px">' . $base32Seed . '</span><br>' . $langs->trans('OTPKeyType');
                    } else {
                        print $regenerate_button;
                        setEventMessage('ErrorCreatingImage', 'errors');
                    }
                }
            } else {
                if ($user->admin || $user->id == GETPOST('id', 'int')) {
                    print $regenerate_button;
                }
            }
            print '</td></tr>';
        }
    }
    /** Overloading the doActions function : replacing the parent's function with the one below 
     *  @param      parameters  meta datas of the hook (context, etc...) 
     *  @param      object             the object you want to process (an invoice if you are in invoice module, a propale in propale's module, etc...) 
     *  @param      action             current action (if set). Generally create or edit or null 
     *  @return       void 
     */
    function printSearchForm($parameters, &$object, &$action, $hookmanager)
    {
        global $langs, $db;
        if (in_array('searchform', explode(':', $parameters['context']))) {
            $langs->load('searcheverywhere@searcheverywhere');
            $res = '';
            $res .= '<form method="post" action="' . dol_buildpath('/searcheverywhere/search.php', 1) . '">';
            $res .= '<div class="menu_titre menu_titre_search"><label for="sew_keyword"><a class="vsmenu" href="' . dol_buildpath('/searcheverywhere/search.php', 1) . '">' . img_object($langs->trans('searcheverywhere'), 'searcheverywhere@searcheverywhere') . ' ' . $langs->trans('Searcheverywhere') . '</a></label></div>';
            $res .= '	<input type="text" size="10" name="keyword" title="' . $langs->trans('Keyword') . '" class="flat" id="sew_keyword" /><input type="submit" value="' . $langs->trans('Go') . '" class="button" style="padding-top: 4px; padding-bottom: 4px; padding-left: 6px; padding-right: 6px">
				</form>';
            $this->resprints = $res;
        }
        return 0;
    }
/**
 *	    \file       htdocs/pos/backend/lib/ticket.lib.php
 *		\brief      Ensemble de fonctions de base pour le module pos
 * 		\ingroup	pos
 *
 *		Ensemble de fonctions de base de dolibarr sous forme d'include
 */
function ticket_prepare_head($object)
{
    global $langs, $conf;
    $h = 0;
    $head = array();
    $head[$h][0] = dol_buildpath('/pos/backend/ticket.php', 1) . '?id=' . $object->id;
    $head[$h][1] = $langs->trans('CardTicket');
    $head[$h][2] = 'ticket';
    $h++;
    $head[$h][0] = dol_buildpath('/pos/backend/info.php', 1) . '?id=' . $object->id;
    $head[$h][1] = $langs->trans('Info');
    $head[$h][2] = 'info';
    $h++;
    return $head;
}
 /**
  * 	Instantiation of DAO class
  *
  * 	@return	void
  */
 private function getInstanceDao()
 {
     if (!is_object($this->object)) {
         $modelclassfile = dol_buildpath('/' . $this->dirmodule . '/canvas/' . $this->canvas . '/dao_' . $this->targetmodule . '_' . $this->canvas . '.class.php');
         if (file_exists($modelclassfile)) {
             // Include dataservice class (model)
             $ret = (require_once $modelclassfile);
             if ($ret) {
                 // Instantiate dataservice class (model)
                 $modelclassname = 'Dao' . ucfirst($this->targetmodule) . ucfirst($this->canvas);
                 $this->object = new $modelclassname($this->db);
             }
         }
     }
 }
function importatoradmin_prepare_head()
{
    global $langs, $conf, $user;
    $langs->load("importator@importator");
    $h = 0;
    $head = array();
    $head[$h][0] = dol_buildpath('/importator/admin/importator.php', 1);
    $head[$h][1] = $langs->trans("ImportSetup");
    $head[$h][2] = 'configuration';
    $h++;
    $head[$h][0] = dol_buildpath('/importator/admin/about.php', 1);
    $head[$h][1] = $langs->trans("About");
    $head[$h][2] = 'about';
    $h++;
    return $head;
}
Пример #22
0
/**
 * Prepare head for tabs
 *
 * @param	Object	$object		Object
 * @return	array				Array of head entries
 */
function resourcePrepareHead($object)
{
    global $langs, $conf, $user;
    $h = 0;
    $head = array();
    $head[$h][0] = dol_buildpath('/resource/card.php', 1) . '?id=' . $object->id;
    $head[$h][1] = $langs->trans("ResourceCard");
    $head[$h][2] = 'resource';
    $h++;
    // Show more tabs from modules
    // Entries must be declared in modules descriptor with line
    // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to add new tab
    // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__');   to remove a tab
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'resource');
    return $head;
}
function reportsadmin_prepare_head()
{
    global $langs, $conf, $user;
    $langs->load("reports@reports");
    $h = 0;
    $head = array();
    $head[$h][0] = dol_buildpath('/reports/admin/reports.php', 1);
    $head[$h][1] = $langs->trans("ReportsSetup");
    $head[$h][2] = 'configuration';
    $h++;
    $head[$h][0] = dol_buildpath('/reports/admin/about.php', 1);
    $head[$h][1] = $langs->trans("About");
    $head[$h][2] = 'about';
    $h++;
    return $head;
}
Пример #24
0
/**
 * Return array of tabs to used on a cron job
 *
 * @param 	Cronjob	$object		Object cron
 * @return 	array				Array of tabs
 */
function cron_prepare_head(Cronjob $object)
{
    global $langs, $conf, $user;
    $h = 0;
    $head = array();
    $head[$h][0] = dol_buildpath('/cron/card.php', 1) . '?id=' . $object->id;
    $head[$h][1] = $langs->trans("CronTask");
    $head[$h][2] = 'card';
    $h++;
    $head[$h][0] = dol_buildpath('/cron/info.php', 1) . '?id=' . $object->id;
    $head[$h][1] = $langs->trans("Info");
    $head[$h][2] = 'info';
    $h++;
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'cron');
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'cron', 'remove');
    return $head;
}
function berryproadmin_prepare_head()
{
    global $langs, $conf, $user;
    $langs->load("*****@*****.**");
    $h = 0;
    $head = array();
    $head[$h][0] = dol_buildpath('/berrypro/admin/berrypro.php', 1);
    $head[$h][1] = $langs->trans("MASSOSetup");
    //Vigilar
    $head[$h][2] = 'configuration';
    $h++;
    $head[$h][0] = dol_buildpath('/berrypro/admin/about.php', 1);
    $head[$h][1] = $langs->trans("About");
    $head[$h][2] = 'about';
    $h++;
    return $head;
}
/**
 *	\file		lib/importdevis.lib.php
 *	\ingroup	importdevis
 *	\brief		This file is an example module library
 *				Put some comments here
 */
function subtotalAdminPrepareHead()
{
    global $langs, $conf;
    $langs->load("subtotal@subtotal");
    $h = 0;
    $head = array();
    $head[$h][0] = dol_buildpath("/subtotal/admin/subtotal_setup.php", 1);
    $head[$h][1] = $langs->trans("Parameters");
    $head[$h][2] = 'settings';
    $h++;
    $head[$h][0] = dol_buildpath("/subtotal/admin/subtotal_about.php", 1);
    $head[$h][1] = $langs->trans("About");
    $head[$h][2] = 'about';
    $h++;
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'subtotal');
    return $head;
}
Пример #27
0
/**
 *	Prepare array with list of tabs
 *
 *	@param	AccountingAccount	$object		Accounting account
 *	@return	array				Array of tabs to show
 */
function accounting_prepare_head(AccountingAccount $object)
{
    global $langs, $conf;
    $h = 0;
    $head = array();
    $head[$h][0] = dol_buildpath('/accountancy/admin/card.php', 1) . '?id=' . $object->id;
    $head[$h][1] = $langs->trans("Card");
    $head[$h][2] = 'card';
    $h++;
    // Show more tabs from modules
    // Entries must be declared in modules descriptor with line
    // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
    // $this->tabs = array('entity:-tabname); to remove a tab
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_account');
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_account', 'remove');
    return $head;
}
Пример #28
0
/**
 * Prepare array with list of tabs
 *
 * @return  array    Array of tabs to show
 */
function multicurrencyAdminPrepareHead()
{
    global $langs, $conf;
    $h = 0;
    $head = array();
    $head[$h][0] = dol_buildpath("/admin/multicurrency.php", 1);
    $head[$h][1] = $langs->trans("Parameters");
    $head[$h][2] = 'settings';
    $h++;
    // Show more tabs from modules
    // Entries must be declared in modules descriptor with line
    //$this->tabs = array(
    //	'entity:+tabname:Title:@quickpriceupdate:/quickpriceupdate/mypage.php?id=__ID__'
    //); // to add new tab
    //$this->tabs = array(
    //	'entity:-tabname:Title:@quickpriceupdate:/quickpriceupdate/mypage.php?id=__ID__'
    //); // to remove a tab
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'multicurrency');
    return $head;
}
/**
 *	\file		lib/mymodule.lib.php
 *	\ingroup	mymodule
 *	\brief		This file is an example module library
 *				Put some comments here
 */
function remiseAdminPrepareHead()
{
    global $langs, $conf;
    $langs->load("remise@remise");
    $h = 0;
    $head = array();
    $head[$h][0] = dol_buildpath("/remise/admin/admin_remise.php", 1);
    $head[$h][1] = $langs->trans("Settings");
    $head[$h][2] = 'settings';
    $h++;
    $head[$h][0] = dol_buildpath("/remise/admin/remise.php?type=AMOUNT", 1);
    $head[$h][1] = $langs->trans("Price");
    $head[$h][2] = 'AMOUNT';
    $h++;
    if (!empty($conf->global->REMISE_USE_WEIGHT)) {
        $head[$h][0] = dol_buildpath("/remise/admin/remise.php?type=WEIGHT", 1);
        $head[$h][1] = $langs->trans("Weight");
        $head[$h][2] = 'WEIGHT';
        $h++;
    }
    $head[$h][0] = dol_buildpath("/remise/admin/import.php", 1);
    $head[$h][1] = $langs->trans("Import");
    $head[$h][2] = 'import';
    $h++;
    $head[$h][0] = dol_buildpath("/remise/admin/about.php", 1);
    $head[$h][1] = $langs->trans("About");
    $head[$h][2] = 'about';
    $h++;
    // Show more tabs from modules
    // Entries must be declared in modules descriptor with line
    //$this->tabs = array(
    //	'entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'
    //); // to add new tab
    //$this->tabs = array(
    //	'entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'
    //); // to remove a tab
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'mymodule');
    return $head;
}
    /**
     * Overloading the doActions function : replacing the parent's function with the one below
     *
     * @param   array()         $parameters     Hook metadatas (context, etc...)
     * @param   CommonObject    &$object        The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
     * @param   string          &$action        Current action (if set). Generally create or edit or null
     * @param   HookManager     $hookmanager    Hook manager propagated to allow calling another hook
     * @return  int                             < 0 on error, 0 on success, 1 to replace standard code
     */
    function formObjectOptions($parameters, &$object, &$action, $hookmanager)
    {
        if (empty($object->element)) {
            return 0;
        }
        if (defined('TWIIITOR_ADDED')) {
            return 0;
        }
        define('TWIIITOR_ADDED', true);
        define('INC_FROM_DOLIBARR', true);
        dol_include_once('/twiiitor/config.php');
        dol_include_once('/twiiitor/class/twiiitor.class.php');
        $ref = TTwiiit::getRefByObject($object);
        if (empty($ref)) {
            return 0;
        }
        ?>
		<script type="text/javascript" src="<?php 
        echo dol_buildpath('/twiiitor/js/twiiitor.js.php?element=' . $object->element . '&id=' . $object->id . '&ref=' . $ref, 1);
        ?>
"></script>
		<?php 
    }