Esempio n. 1
0
/**
 * Returns an array with the tabs for the "salaries" section
 * It loads tabs from modules looking for the entity salaries
 *  
 * @param Paiement $object Current salaries object
 * @return array Tabs for the salaries section
 */
function salaries_prepare_head($object)
{
    global $db, $langs, $conf;
    $h = 0;
    $head = array();
    $head[$h][0] = DOL_URL_ROOT . '/compta/salaries/card.php?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, 'salaries');
    require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
    require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
    $upload_dir = $conf->salaries->dir_output . "/" . dol_sanitizeFileName($object->ref);
    $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\\.meta|_preview\\.png)$'));
    $nbLinks = Link::count($db, $object->element, $object->id);
    $head[$h][0] = DOL_URL_ROOT . '/compta/salaries/document.php?id=' . $object->id;
    $head[$h][1] = $langs->trans('Documents');
    if ($nbFiles + $nbLinks > 0) {
        $head[$h][1] .= ' <span class="badge">' . ($nbFiles + $nbLinks) . '</span>';
    }
    $head[$h][2] = 'documents';
    $h++;
    $head[$h][0] = DOL_URL_ROOT . '/compta/salaries/info.php?id=' . $object->id;
    $head[$h][1] = $langs->trans("Info");
    $head[$h][2] = 'info';
    $h++;
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'salaries', 'remove');
    return $head;
}
Esempio n. 2
0
/**
 * Prepare array with list of tabs
 *
 * @param   Contact	$object		Object related to tabs
 * @return  array				Array of tabs to show
 */
function contact_prepare_head(Contact $object)
{
    global $db, $langs, $conf, $user;
    $tab = 0;
    $head = array();
    $head[$tab][0] = DOL_URL_ROOT . '/contact/card.php?id=' . $object->id;
    $head[$tab][1] = $langs->trans("Card");
    $head[$tab][2] = 'card';
    $tab++;
    if (!empty($conf->ldap->enabled) && !empty($conf->global->LDAP_CONTACT_ACTIVE)) {
        $langs->load("ldap");
        $head[$tab][0] = DOL_URL_ROOT . '/contact/ldap.php?id=' . $object->id;
        $head[$tab][1] = $langs->trans("LDAPCard");
        $head[$tab][2] = 'ldap';
        $tab++;
    }
    $head[$tab][0] = DOL_URL_ROOT . '/contact/perso.php?id=' . $object->id;
    $head[$tab][1] = $langs->trans("PersonalInformations");
    $head[$tab][2] = 'perso';
    $tab++;
    // 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, $tab, 'contact');
    // Notes
    if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
        $nbNote = (empty($object->note_private) ? 0 : 1) + (empty($object->note_public) ? 0 : 1);
        $head[$tab][0] = DOL_URL_ROOT . '/contact/note.php?id=' . $object->id;
        $head[$tab][1] = $langs->trans("Note");
        if ($nbNote > 0) {
            $head[$tab][1] .= ' <span class="badge">' . $nbNote . '</span>';
        }
        $head[$tab][2] = 'note';
        $tab++;
    }
    require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
    require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
    $upload_dir = $conf->societe->dir_output . "/contact/" . dol_sanitizeFileName($object->ref);
    $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\\.meta|_preview\\.png)$'));
    $nbLinks = Link::count($db, $object->element, $object->id);
    $head[$tab][0] = DOL_URL_ROOT . '/contact/document.php?id=' . $object->id;
    $head[$tab][1] = $langs->trans("Documents");
    if ($nbFiles + $nbLinks > 0) {
        $head[$tab][1] .= ' <span class="badge">' . ($nbFiles + $nbLinks) . '</span>';
    }
    $head[$tab][2] = 'documents';
    $tab++;
    // Info
    $head[$tab][0] = DOL_URL_ROOT . '/contact/info.php?id=' . $object->id;
    $head[$tab][1] = $langs->trans("Info");
    $head[$tab][2] = 'info';
    $tab++;
    complete_head_from_modules($conf, $langs, $object, $head, $tab, 'contact', 'remove');
    return $head;
}
Esempio n. 3
0
/**
 * Prepare array with list of tabs
 *
 * @param   Account	$object		Object related to tabs
 * @return  array				Array of tabs to show
 */
function bank_prepare_head(Account $object)
{
    global $db, $langs, $conf, $user;
    $h = 0;
    $head = array();
    $head[$h][0] = DOL_URL_ROOT . '/compta/bank/card.php?id=' . $object->id;
    $head[$h][1] = $langs->trans("AccountCard");
    $head[$h][2] = 'bankname';
    $h++;
    $head[$h][0] = DOL_URL_ROOT . "/compta/bank/account.php?id=" . $object->id;
    $head[$h][1] = $langs->trans("Transactions");
    $head[$h][2] = 'journal';
    $h++;
    //    if ($conf->global->MAIN_FEATURES_LEVEL >= 1)
    //	{
    $head[$h][0] = DOL_URL_ROOT . "/compta/bank/treso.php?account=" . $object->id;
    $head[$h][1] = $langs->trans("PlannedTransactions");
    $head[$h][2] = 'cash';
    $h++;
    //	}
    $head[$h][0] = DOL_URL_ROOT . "/compta/bank/annuel.php?account=" . $object->id;
    $head[$h][1] = $langs->trans("IOMonthlyReporting");
    $head[$h][2] = 'annual';
    $h++;
    $head[$h][0] = DOL_URL_ROOT . "/compta/bank/graph.php?account=" . $object->id;
    $head[$h][1] = $langs->trans("Graph");
    $head[$h][2] = 'graph';
    $h++;
    if ($object->courant != 2) {
        $head[$h][0] = DOL_URL_ROOT . "/compta/bank/releve.php?account=" . $object->id;
        $head[$h][1] = $langs->trans("AccountStatements");
        $head[$h][2] = 'statement';
        $h++;
    }
    // Attached files
    require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
    require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
    $upload_dir = $conf->bank->dir_output . "/" . dol_sanitizeFileName($object->ref);
    $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\\.meta|_preview\\.png)$'));
    $nbLinks = Link::count($db, $object->element, $object->id);
    $head[$h][0] = DOL_URL_ROOT . "/compta/bank/document.php?account=" . $object->id;
    $head[$h][1] = $langs->trans("Documents");
    if ($nbFiles + $nbLinks > 0) {
        $head[$h][1] .= ' <span class="badge">' . ($nbFiles + $nbLinks) . '</span>';
    }
    $head[$h][2] = 'document';
    $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, 'bank');
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'bank', 'remove');
    return $head;
}
Esempio n. 4
0
/**
 * Prepare array with list of tabs
 *
 * @param   Contrat	$object		Object related to tabs
 * @return  array				Array of tabs to show
 */
function contract_prepare_head(Contrat $object)
{
    global $db, $langs, $conf;
    $h = 0;
    $head = array();
    $head[$h][0] = DOL_URL_ROOT . '/contrat/card.php?id=' . $object->id;
    $head[$h][1] = $langs->trans("ContractCard");
    $head[$h][2] = 'card';
    $h++;
    if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) {
        $head[$h][0] = DOL_URL_ROOT . '/contrat/contact.php?id=' . $object->id;
        $head[$h][1] = $langs->trans("ContactsAddresses");
        $head[$h][2] = 'contact';
        $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, 'contract');
    if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
        $nbNote = 0;
        if (!empty($object->note_private)) {
            $nbNote++;
        }
        if (!empty($object->note_public)) {
            $nbNote++;
        }
        $head[$h][0] = DOL_URL_ROOT . '/contrat/note.php?id=' . $object->id;
        $head[$h][1] = $langs->trans("Notes");
        if ($nbNote > 0) {
            $head[$h][1] .= ' <span class="badge">' . $nbNote . '</span>';
        }
        $head[$h][2] = 'note';
        $h++;
    }
    require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
    require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
    $upload_dir = $conf->contrat->dir_output . "/" . dol_sanitizeFileName($object->ref);
    $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\\.meta|_preview\\.png)$'));
    $nbLinks = Link::count($db, $object->element, $object->id);
    $head[$h][0] = DOL_URL_ROOT . '/contrat/document.php?id=' . $object->id;
    $head[$h][1] = $langs->trans("Documents");
    if ($nbFiles + $nbLinks > 0) {
        $head[$h][1] .= ' <span class="badge">' . ($nbFiles + $nbLinks) . '</span>';
    }
    $head[$h][2] = 'documents';
    $h++;
    $head[$h][0] = DOL_URL_ROOT . '/contrat/info.php?id=' . $object->id;
    $head[$h][1] = $langs->trans("Info");
    $head[$h][2] = 'info';
    $h++;
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'contract', 'remove');
    return $head;
}
Esempio n. 5
0
 /**
  * 首页
  *
  */
 public function actionIndex()
 {
     parent::_acl('link_index');
     $model = new Link();
     $criteria = new CDbCriteria();
     $criteria->order = 'id DESC';
     $count = $model->count($criteria);
     $pages = new CPagination($count);
     $pages->pageSize = 10;
     $criteria->limit = $pages->pageSize;
     $criteria->offset = $pages->currentPage * $pages->pageSize;
     $result = $model->findAll($criteria);
     $this->render('index', array('datalist' => $result, 'pagebar' => $pages));
 }
Esempio n. 6
0
 static function count($status = '', $force = false)
 {
     global $db, $globals;
     $my_id = SitesMgr::my_id();
     if (!$status) {
         return Link::count('published', $force) + Link::count('queued', $force) + Link::count('discard', $force) + Link::count('abuse', $force) + Link::count('autodiscard', $force);
     }
     $count = get_count("{$my_id}.{$status}");
     if ($count === false || $force) {
         $count = $db->get_var("select count(*) from sub_statuses where id = {$my_id} and status = '{$status}'");
         set_count("{$my_id}.{$status}", $count);
     }
     return $count;
 }
Esempio n. 7
0
 static function count($status = '', $cat = '', $force = false)
 {
     global $db;
     if (!$status) {
         return Link::count('published', $cat, $force) + Link::count('queued', $cat, $force) + Link::count('discard', $cat, $force) + Link::count('abuse', $cat, $force) + Link::count('autodiscard', $cat, $force);
     }
     $count = get_count("{$status}.{$cat}");
     if ($count === false || $force) {
         if ($cat) {
             $cond = " and link_category in ({$cat}) ";
         }
         $count = $db->get_var("select count(*) from links where link_status = '{$status}' {$cond}");
         set_count("{$status}.{$cat}", $count);
     }
     return $count;
 }
Esempio n. 8
0
function do_master($size)
{
    global $globals, $db;
    echo '<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . "\n";
    echo '<sitemap>' . "\n";
    echo '<loc>http://' . get_server_name() . $globals['base_url'] . 'sitemap.php?statics</loc>' . "\n";
    echo '</sitemap>' . "\n";
    $count = (int) Link::count('published');
    $indexes = ceil($count / $size);
    for ($i = 0; $i < $indexes; $i++) {
        echo '<sitemap>' . "\n";
        echo '<loc>http://' . get_server_name() . $globals['base_url'] . 'sitemap.php?page=' . $i . '</loc>' . "\n";
        echo '</sitemap>' . "\n";
    }
    echo '</sitemapindex>' . "\n";
}
Esempio n. 9
0
 public function run()
 {
     $model = new Link();
     //条件
     $criteria = new CDbCriteria();
     $title = trim(Yii::app()->request->getParam('title'));
     $title && $criteria->addSearchCondition('title', $title);
     $criteria->order = 't.id ASC';
     $count = $model->count($criteria);
     //分页
     $pages = new CPagination($count);
     $pages->pageSize = 10;
     $pages->applyLimit($criteria);
     //查询
     $result = $model->findAll($criteria);
     $this->controller->render('index', array('model' => $model, 'datalist' => $result, 'pagebar' => $pages));
 }
Esempio n. 10
0
 /**
  * @before _secure
  */
 public function index()
 {
     $this->seo(array("title" => "Dashboard"));
     $view = $this->getActionView();
     $d = 1;
     $publishers = User::all(["org_id = ?" => $this->org->_id, "type = ?" => "publisher"], ["_id"]);
     $in = array_keys($publishers);
     $start = RM::get("start", date('Y-m-d', strtotime('-4 day')));
     $end = RM::get("end", date('Y-m-d', strtotime('now')));
     $dq = ['start' => date('Y-m-d', strtotime("-365 day")), 'end' => $end];
     $pubPerf = (object) Performance::total($dq, $publishers);
     $advPerf = (object) Performance::total($dq, $this->org->users('advertiser', 'users'), ['revenue']);
     $topusers = $this->widgets();
     if (array_key_exists("widgets", $this->org->meta)) {
         $d = in_array("top10ads", $this->org->meta["widgets"]) + in_array("top10pubs", $this->org->meta["widgets"]);
     }
     $view->set("start", $start)->set("end", $end)->set("d", 12 / $d)->set("topusers", $topusers)->set("links", \Link::count(['user_id' => ['$in' => $in]]))->set("platforms", \Platform::count(['user_id' => ['$in' => $in]]))->set("performance", Performance::calProfit($pubPerf, $advPerf));
 }
Esempio n. 11
0
	static function count($status='', $cat='', $force = false) {
		global $db;

		if (!$status) return Link::count('published', $cat, $force) +
							Link::count('queued', $cat, $force) +
							Link::count('discard', $cat, $force) +
							Link::count('abuse', $cat, $force) +
							Link::count('autodiscard', $cat, $force);


		$count = get_count("$status.$cat");
		if ($count === false || $force) {
			if ($cat) $cond = " and link_category in ($cat) ";
			$count = $db->get_var("select count(*) from links where link_status = '$status' $cond");
			set_count("$status.$cat", $count);
		}
		return $count;
	}
Esempio n. 12
0
 static function count($status = '', $cat = '', $force = false)
 {
     global $db, $globals;
     $my_id = SitesMgr::my_id();
     if (!$status) {
         return Link::count('published', $cat, $force) + Link::count('queued', $cat, $force) + Link::count('discard', $cat, $force) + Link::count('abuse', $cat, $force) + Link::count('autodiscard', $cat, $force);
     }
     $count = get_count("{$my_id}.{$status}.{$cat}");
     if ($count === false || $force) {
         if (!empty($cat)) {
             $extra = "and category in ({$cat})";
         } else {
             $extra = '';
         }
         $count = $db->get_var("select count(*) from sub_statuses where id = {$my_id} and status = '{$status}' {$extra}");
         set_count("{$my_id}.{$status}.{$cat}", $count);
     }
     return $count;
 }
Esempio n. 13
0
 /**
  * 链接
  */
 public function actionLink()
 {
     parent::_acl('link_index');
     $model = new Link();
     $criteria = new CDbCriteria();
     $condition = '1';
     $siteName = trim($this->_gets->getParam('siteName'));
     $siteName && ($condition .= ' AND site_name LIKE \'%' . $siteName . '%\'');
     $criteria->condition = $condition;
     $criteria->order = 't.id DESC';
     $count = $model->count($criteria);
     $pages = new CPagination($count);
     $pages->pageSize = 13;
     $pageParams = XUtils::buildCondition($_GET, array('site_name'));
     $pages->params = is_array($pageParams) ? $pageParams : array();
     $criteria->limit = $pages->pageSize;
     $criteria->offset = $pages->currentPage * $pages->pageSize;
     $result = $model->findAll($criteria);
     $this->render('link_index', array('datalist' => $result, 'pagebar' => $pages));
 }
Esempio n. 14
0
 /**
  * 首页
  */
 public function actionIndex()
 {
     $model = new Link();
     $criteria = new CDbCriteria();
     $condition = '1';
     $siteName = trim($this->_request->getParam('title'));
     $siteName && ($condition .= ' AND title LIKE \'%' . $siteName . '%\'');
     $criteria->condition = $condition;
     //$criteria->params = '';
     $criteria->order = 't.id DESC';
     $count = $model->count($criteria);
     $pages = new CPagination($count);
     $pages->pageSize = 13;
     $pageParams = $this->buildCondition($_GET, array('title'));
     $pages->params = is_array($pageParams) ? $pageParams : array();
     $criteria->limit = $pages->pageSize;
     $criteria->offset = $pages->currentPage * $pages->pageSize;
     $result = $model->findAll($criteria);
     $this->render('index', array('datalist' => $result, 'pagebar' => $pages));
 }
Esempio n. 15
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 $db, $langs, $conf;
    $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 (!empty($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++;
    }
    // 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, 'invoice');
    if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
        $nbNote = 0;
        if (!empty($object->note_private)) {
            $nbNote++;
        }
        if (!empty($object->note_public)) {
            $nbNote++;
        }
        $head[$h][0] = DOL_URL_ROOT . '/compta/facture/note.php?facid=' . $object->id;
        $head[$h][1] = $langs->trans('Notes');
        if ($nbNote > 0) {
            $head[$h][1] .= ' <span class="badge">' . $nbNote . '</span>';
        }
        $head[$h][2] = 'note';
        $h++;
    }
    require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
    require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
    $upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref);
    $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\\.meta|_preview\\.png)$'));
    $nbLinks = Link::count($db, $object->element, $object->id);
    $head[$h][0] = DOL_URL_ROOT . '/compta/facture/document.php?facid=' . $object->id;
    $head[$h][1] = $langs->trans('Documents');
    if ($nbFiles + $nbLinks > 0) {
        $head[$h][1] .= ' <span class="badge">' . ($nbFiles + $nbLinks) . '</span>';
    }
    $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++;
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'invoice', 'remove');
    return $head;
}
Esempio n. 16
0
 /**
  * @before _secure
  * @after _displayData
  */
 public function links()
 {
     $this->seo(array("title" => "Link Logs"));
     $view = $this->getActionView();
     $prop = RM::get("property");
     $val = RM::get("value");
     $sort = RM::get("sort", "desc");
     $sign = RM::get("sign", "equal");
     $orderBy = RM::get("order", 'created');
     $fields = (new \Link())->getColumns();
     $searching = $query = [];
     $query['user_id'] = ['$in' => $this->org->users('publisher')];
     foreach ($fields as $key => $value) {
         $search = RM::get($key);
         if (!$search) {
             continue;
         }
         $searching[$key] = $search;
         // Only allow full object ID's and rest regex searching
         if (in_array($key, ['user_id', 'ad_id', '_id'])) {
             $query[$key] = RM::get($key);
         } else {
             $query[$key] = Utils::mongoRegex($search);
         }
     }
     $dateQuery = Utils::dateQuery(['start' => $this->start, 'end' => $this->end]);
     $query['created'] = ['$gte' => $dateQuery['start'], '$lte' => $dateQuery['end']];
     $records = \Link::all($query, [], $orderBy, $sort, $this->limit, $this->page);
     $count = \Link::count($query);
     $view->set(['links' => $records, 'fields' => $fields, 'property' => $prop, 'value' => $val, 'sign' => $sign, 'sort' => $sort, 'order' => $orderBy, 'count' => $count, 'query' => $searching]);
 }
Esempio n. 17
0
 private function _reportspub($query, $start, $end, $limit, $page)
 {
     $view = $this->getActionView();
     $dateQuery = Utils::dateQuery(['start' => $start, 'end' => $end]);
     $links = \Link::all($query, [], 'created', 'desc', $limit, $page);
     $count = \Link::count($query);
     $query["created"] = Db::dateQuery($start, $end);
     $performances = \Performance::all($query, ['created', 'clicks', 'revenue'], 'created', 'desc');
     $in = [];
     foreach ($links as $l) {
         // only find clicks for the ads whose links are created
         $in[] = Utils::mongoObjectId($l->ad_id);
     }
     // find clicks
     $clickCol = Registry::get("MongoDB")->clicks;
     $records = Db::query('Click', ['adid' => ['$in' => $in], 'is_bot' => false, 'pid' => $query['user_id'], 'created' => $query['created']], ['adid', 'country']);
     $view->set(['limit' => $limit, 'page' => $page, 'count' => $count, 'start' => $start, 'end' => $end, 'links' => $links, 'performances' => $performances, 'clicks' => Click::classify($records, 'adid'), 'commission' => $this->user->commission(), 'dq' => $query['created']]);
 }
Esempio n. 18
0
/**
 * Prepare array with list of tabs
 *
 * @param   Object	$object		Object related to tabs
 * @return  array				Array of tabs to show
 */
function user_prepare_head($object)
{
    global $db, $langs, $conf, $user;
    $langs->load("users");
    $canreadperms = true;
    if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
        $canreadperms = $user->admin || $user->id != $object->id && $user->rights->user->user_advance->readperms || $user->id == $object->id && $user->rights->user->self_advance->readperms;
    }
    $h = 0;
    $head = array();
    $head[$h][0] = DOL_URL_ROOT . '/user/card.php?id=' . $object->id;
    $head[$h][1] = $langs->trans("UserCard");
    $head[$h][2] = 'user';
    $h++;
    if (!empty($conf->ldap->enabled) && !empty($conf->global->LDAP_SYNCHRO_ACTIVE)) {
        $langs->load("ldap");
        $head[$h][0] = DOL_URL_ROOT . '/user/ldap.php?id=' . $object->id;
        $head[$h][1] = $langs->trans("LDAPCard");
        $head[$h][2] = 'ldap';
        $h++;
    }
    if ($canreadperms) {
        $head[$h][0] = DOL_URL_ROOT . '/user/perms.php?id=' . $object->id;
        $head[$h][1] = $langs->trans("UserRights");
        $head[$h][2] = 'rights';
        $h++;
    }
    $head[$h][0] = DOL_URL_ROOT . '/user/param_ihm.php?id=' . $object->id;
    $head[$h][1] = $langs->trans("UserGUISetup");
    $head[$h][2] = 'guisetup';
    $h++;
    if (!empty($conf->agenda->enabled)) {
        $head[$h][0] = DOL_URL_ROOT . '/user/agenda_extsites.php?id=' . $object->id;
        $head[$h][1] = $langs->trans("ExtSites");
        $head[$h][2] = 'extsites';
        $h++;
    }
    if (!empty($conf->clicktodial->enabled)) {
        $head[$h][0] = DOL_URL_ROOT . '/user/clicktodial.php?id=' . $object->id;
        $head[$h][1] = $langs->trans("ClickToDial");
        $head[$h][2] = 'clicktodial';
        $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, 'user');
    if (!empty($conf->hrm->enabled) && $user->rights->hrm->employee->read) {
        // Bank
        $head[$h][0] = DOL_URL_ROOT . '/user/bank.php?id=' . $object->id;
        $head[$h][1] = $langs->trans("Bank");
        $head[$h][2] = 'bank';
        $h++;
    }
    //Info on users is visible only by internal user
    if (empty($user->societe_id)) {
        // Notes
        $nbNote = 0;
        if (!empty($object->note)) {
            $nbNote++;
        }
        $head[$h][0] = DOL_URL_ROOT . '/user/note.php?id=' . $object->id;
        $head[$h][1] = $langs->trans("Note");
        if ($nbNote > 0) {
            $head[$h][1] .= ' <span class="badge">' . $nbNote . '</span>';
        }
        $head[$h][2] = 'note';
        $h++;
        // Attached files
        require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
        require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
        $upload_dir = $conf->user->dir_output . "/" . $object->id;
        $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\\.meta|_preview\\.png)$'));
        $nbLinks = Link::count($db, $object->element, $object->id);
        $head[$h][0] = DOL_URL_ROOT . '/user/document.php?userid=' . $object->id;
        $head[$h][1] = $langs->trans("Documents");
        if ($nbFiles + $nbLinks > 0) {
            $head[$h][1] .= ' <span class="badge">' . ($nbFiles + $nbLinks) . '</span>';
        }
        $head[$h][2] = 'document';
        $h++;
        $head[$h][0] = DOL_URL_ROOT . '/user/info.php?id=' . $object->id;
        $head[$h][1] = $langs->trans("Info");
        $head[$h][2] = 'info';
        $h++;
    }
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'user', 'remove');
    return $head;
}
Esempio n. 19
0
/**
 * Return array of tabs to used on pages for third parties cards.
 *
 * @param 	Societe	$object		Object company shown
 * @return 	array				Array of tabs
 */
function societe_prepare_head(Societe $object)
{
    global $db, $langs, $conf, $user;
    $h = 0;
    $head = array();
    $head[$h][0] = DOL_URL_ROOT . '/societe/soc.php?socid=' . $object->id;
    $head[$h][1] = $langs->trans("Card");
    $head[$h][2] = 'card';
    $h++;
    if ($object->client == 1 || $object->client == 2 || $object->client == 3) {
        $head[$h][0] = DOL_URL_ROOT . '/comm/card.php?socid=' . $object->id;
        $head[$h][1] = '';
        if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && ($object->client == 2 || $object->client == 3)) {
            $head[$h][1] .= $langs->trans("Prospect");
        }
        if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && $object->client == 3) {
            $head[$h][1] .= '/';
        }
        if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && ($object->client == 1 || $object->client == 3)) {
            $head[$h][1] .= $langs->trans("Customer");
        }
        $head[$h][2] = 'customer';
        $h++;
    }
    if (($object->client == 1 || $object->client == 2 || $object->client == 3) && !empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
        $langs->load("products");
        // price
        $head[$h][0] = DOL_URL_ROOT . '/societe/price.php?socid=' . $object->id;
        $head[$h][1] = $langs->trans("CustomerPrices");
        $head[$h][2] = 'price';
        $h++;
    }
    if (!empty($conf->fournisseur->enabled) && $object->fournisseur && !empty($user->rights->fournisseur->lire)) {
        $head[$h][0] = DOL_URL_ROOT . '/fourn/card.php?socid=' . $object->id;
        $head[$h][1] = $langs->trans("Supplier");
        $head[$h][2] = 'supplier';
        $h++;
    }
    if (!empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) {
        $head[$h][0] = DOL_URL_ROOT . '/societe/societecontact.php?socid=' . $object->id;
        $head[$h][1] = $langs->trans("ContactsAddresses");
        $head[$h][2] = 'contact';
        $h++;
    }
    if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
        $head[$h][0] = DOL_URL_ROOT . '/societe/agenda.php?socid=' . $object->id;
        $head[$h][1] = $langs->trans("Agenda");
        $head[$h][2] = 'agenda';
        $h++;
    }
    if (!empty($conf->projet->enabled) && !empty($user->rights->projet->lire)) {
        $head[$h][0] = DOL_URL_ROOT . '/societe/project.php?socid=' . $object->id;
        $head[$h][1] = $langs->trans("Projects");
        $head[$h][2] = 'project';
        $h++;
    }
    //show categorie tab
    /*if (! empty($conf->categorie->enabled)  && ! empty($user->rights->categorie->lire))
        {
    		require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
            $type = Categorie::TYPE_CUSTOMER;
            if ($object->fournisseur) $type = Categorie::TYPE_SUPPLIER;
            $head[$h][0] = DOL_URL_ROOT.'/categories/categorie.php?socid='.$object->id."&type=".$type;
            $head[$h][1] = $langs->trans('Categories');
            $head[$h][2] = 'category';
            $h++;
        }*/
    // Tab to link resources
    if (!empty($conf->resource->enabled) && !empty($conf->global->RESOURCE_ON_THIRDPARTIES)) {
        $head[$h][0] = DOL_URL_ROOT . '/resource/element_resource.php?element=societe&element_id=' . $object->id;
        $head[$h][1] = $langs->trans("Resources");
        $head[$h][2] = 'resources';
        $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, 'thirdparty');
    if ($user->societe_id == 0) {
        if (!empty($conf->commande->enabled) || !empty($conf->propal->enabled) || !empty($conf->facture->enabled) || !empty($conf->fichinter->enabled) || !empty($conf->fournisseur->enabled)) {
            $head[$h][0] = DOL_URL_ROOT . '/societe/consumption.php?socid=' . $object->id;
            $head[$h][1] = $langs->trans("Referers");
            $head[$h][2] = 'consumption';
            $h++;
        }
        // Notifications
        if (!empty($conf->notification->enabled)) {
            $nbNote = 0;
            $sql = "SELECT COUNT(n.rowid) as nb";
            $sql .= " FROM " . MAIN_DB_PREFIX . "notify_def as n";
            $sql .= " WHERE fk_soc = " . $object->id;
            $resql = $db->query($sql);
            if ($resql) {
                $num = $db->num_rows($resql);
                $i = 0;
                while ($i < $num) {
                    $obj = $db->fetch_object($resql);
                    $nbNote = $obj->nb;
                    $i++;
                }
            } else {
                dol_print_error($db);
            }
            $head[$h][0] = DOL_URL_ROOT . '/societe/notify/card.php?socid=' . $object->id;
            $head[$h][1] = $langs->trans("Notifications");
            if ($nbNote > 0) {
                $head[$h][1] .= ' <span class="badge">' . $nbNote . '</span>';
            }
            $head[$h][2] = 'notify';
            $h++;
        }
        // Notes
        $nbNote = 0;
        if (!empty($object->note_private)) {
            $nbNote++;
        }
        if (!empty($object->note_public)) {
            $nbNote++;
        }
        $head[$h][0] = DOL_URL_ROOT . '/societe/note.php?id=' . $object->id;
        $head[$h][1] = $langs->trans("Note");
        if ($nbNote > 0) {
            $head[$h][1] .= ' <span class="badge">' . $nbNote . '</span>';
        }
        $head[$h][2] = 'note';
        $h++;
        // Attached files
        require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
        require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
        $upload_dir = $conf->societe->dir_output . "/" . $object->id;
        $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\\.meta|_preview\\.png)$'));
        $nbLinks = Link::count($db, $object->element, $object->id);
        $head[$h][0] = DOL_URL_ROOT . '/societe/document.php?socid=' . $object->id;
        $head[$h][1] = $langs->trans("Documents");
        if ($nbFiles + $nbLinks > 0) {
            $head[$h][1] .= ' <span class="badge">' . ($nbFiles + $nbLinks) . '</span>';
        }
        $head[$h][2] = 'document';
        $h++;
    }
    // Log
    $head[$h][0] = DOL_URL_ROOT . '/societe/info.php?socid=' . $object->id;
    $head[$h][1] = $langs->trans("Info");
    $head[$h][2] = 'info';
    $h++;
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'thirdparty', 'remove');
    return $head;
}
Esempio n. 20
0
/**
 * Prepare array with list of tabs
 *
 * @param   Object	$object		Object related to tabs
 * @return  array				Array of tabs to show
 */
function ordersupplier_prepare_head($object)
{
    global $db, $langs, $conf;
    $h = 0;
    $head = array();
    $head[$h][0] = DOL_URL_ROOT . '/fourn/commande/card.php?id=' . $object->id;
    $head[$h][1] = $langs->trans("OrderCard");
    $head[$h][2] = 'card';
    $h++;
    if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) {
        $langs->load("stocks");
        $head[$h][0] = DOL_URL_ROOT . '/fourn/commande/dispatch.php?id=' . $object->id;
        $head[$h][1] = $langs->trans("OrderDispatch");
        $head[$h][2] = 'dispatch';
        $h++;
    }
    if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) {
        $head[$h][0] = DOL_URL_ROOT . '/fourn/commande/contact.php?id=' . $object->id;
        $head[$h][1] = $langs->trans('ContactsAddresses');
        $head[$h][2] = 'contact';
        $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, 'supplier_order');
    if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
        $nbNote = 0;
        if (!empty($object->note_private)) {
            $nbNote++;
        }
        if (!empty($object->note_public)) {
            $nbNote++;
        }
        $head[$h][0] = DOL_URL_ROOT . '/fourn/commande/note.php?id=' . $object->id;
        $head[$h][1] = $langs->trans("Notes");
        if ($nbNote > 0) {
            $head[$h][1] .= ' <span class="badge">' . $nbNote . '</span>';
        }
        $head[$h][2] = 'note';
        $h++;
    }
    require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
    require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
    $upload_dir = $conf->fournisseur->dir_output . "/commande/" . dol_sanitizeFileName($object->ref);
    $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\\.meta|_preview\\.png)$'));
    $nbLinks = Link::count($db, $object->element, $object->id);
    $head[$h][0] = DOL_URL_ROOT . '/fourn/commande/document.php?id=' . $object->id;
    $head[$h][1] = $langs->trans('Documents');
    if ($nbFiles + $nbLinks > 0) {
        $head[$h][1] .= ' <span class="badge">' . ($nbFiles + $nbLinks) . '</span>';
    }
    $head[$h][2] = 'documents';
    $h++;
    $head[$h][0] = DOL_URL_ROOT . '/fourn/commande/history.php?id=' . $object->id;
    $head[$h][1] = $langs->trans("OrderFollow");
    $head[$h][2] = 'info';
    $h++;
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'supplier_order', 'remove');
    return $head;
}
Esempio n. 21
0
/**
 * Prepare array with list of tabs
 *
 * @param   Commande	$object		Object related to tabs
 * @return  array				Array of tabs to show
 */
function commande_prepare_head(Commande $object)
{
    global $db, $langs, $conf, $user;
    if (!empty($conf->expedition->enabled)) {
        $langs->load("sendings");
    }
    $langs->load("orders");
    $h = 0;
    $head = array();
    if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
        $head[$h][0] = DOL_URL_ROOT . '/commande/card.php?id=' . $object->id;
        $head[$h][1] = $langs->trans("OrderCard");
        $head[$h][2] = 'order';
        $h++;
    }
    if ($conf->expedition_bon->enabled && $user->rights->expedition->lire || $conf->livraison_bon->enabled && $user->rights->expedition->livraison->lire) {
        $head[$h][0] = DOL_URL_ROOT . '/expedition/shipment.php?id=' . $object->id;
        if ($conf->expedition_bon->enabled) {
            $text = $langs->trans("Shipments");
        }
        if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled) {
            $text .= '/';
        }
        if ($conf->livraison_bon->enabled) {
            $text .= $langs->trans("Receivings");
        }
        $head[$h][1] = $text;
        $head[$h][2] = 'shipping';
        $h++;
    }
    if (!empty($conf->global->MAIN_USE_PREVIEW_TABS)) {
        $head[$h][0] = DOL_URL_ROOT . '/commande/apercu.php?id=' . $object->id;
        $head[$h][1] = $langs->trans("Preview");
        $head[$h][2] = 'preview';
        $h++;
    }
    if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) {
        $head[$h][0] = DOL_URL_ROOT . '/commande/contact.php?id=' . $object->id;
        $head[$h][1] = $langs->trans('ContactsAddresses');
        $head[$h][2] = 'contact';
        $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, 'order');
    if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
        $nbNote = 0;
        if (!empty($object->note_private)) {
            $nbNote++;
        }
        if (!empty($object->note_public)) {
            $nbNote++;
        }
        $head[$h][0] = DOL_URL_ROOT . '/commande/note.php?id=' . $object->id;
        $head[$h][1] = $langs->trans('Notes');
        if ($nbNote > 0) {
            $head[$h][1] .= ' <span class="badge">' . $nbNote . '</span>';
        }
        $head[$h][2] = 'note';
        $h++;
    }
    require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
    require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
    $upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($object->ref);
    $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\\.meta|_preview\\.png)$'));
    $nbLinks = Link::count($db, $object->element, $object->id);
    $head[$h][0] = DOL_URL_ROOT . '/commande/document.php?id=' . $object->id;
    $head[$h][1] = $langs->trans('Documents');
    if ($nbFiles + $nbLinks > 0) {
        $head[$h][1] .= ' <span class="badge">' . ($nbFiles + $nbLinks) . '</span>';
    }
    $head[$h][2] = 'documents';
    $h++;
    $head[$h][0] = DOL_URL_ROOT . '/commande/info.php?id=' . $object->id;
    $head[$h][1] = $langs->trans("Info");
    $head[$h][2] = 'info';
    $h++;
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'order', 'remove');
    return $head;
}
Esempio n. 22
0
/**
 * Prepare array with list of tabs
 *
 * @param   object	$object		Object related to tabs
 * @return  array				Array of tabs to show
 */
function actions_prepare_head($object)
{
    global $db, $langs, $conf, $user;
    $h = 0;
    $head = array();
    $head[$h][0] = DOL_URL_ROOT . '/comm/action/card.php?id=' . $object->id;
    $head[$h][1] = $langs->trans("CardAction");
    $head[$h][2] = 'card';
    $h++;
    // Tab to link resources
    if ($conf->resource->enabled) {
        $head[$h][0] = DOL_URL_ROOT . '/resource/element_resource.php?element=action&element_id=' . $object->id;
        $head[$h][1] = $langs->trans("Resources");
        $head[$h][2] = 'resources';
        $h++;
    }
    // Attached files
    require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
    require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
    $upload_dir = $conf->agenda->dir_output . "/" . $object->id;
    $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\\.meta|_preview\\.png)$'));
    $nbLinks = Link::count($db, $object->element, $object->id);
    $head[$h][0] = DOL_URL_ROOT . '/comm/action/document.php?id=' . $object->id;
    $head[$h][1] = $langs->trans("Documents");
    if ($nbFiles + $nbLinks > 0) {
        $head[$h][1] .= ' <span class="badge">' . ($nbFiles + $nbLinks) . '</span>';
    }
    $head[$h][2] = 'documents';
    $h++;
    $head[$h][0] = DOL_URL_ROOT . '/comm/action/info.php?id=' . $object->id;
    $head[$h][1] = $langs->trans('Info');
    $head[$h][2] = 'info';
    $h++;
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'action');
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'action', 'remove');
    return $head;
}
Esempio n. 23
0
/**
 * Prepare array with list of tabs
 *
 * @param   Product	$object		Object related to tabs
 * @return  array				Array of tabs to show
 */
function product_prepare_head($object)
{
    global $db, $langs, $conf, $user;
    $langs->load("products");
    $h = 0;
    $head = array();
    $head[$h][0] = DOL_URL_ROOT . "/product/card.php?id=" . $object->id;
    $head[$h][1] = $langs->trans("Card");
    $head[$h][2] = 'card';
    $h++;
    if (!empty($object->status)) {
        $head[$h][0] = DOL_URL_ROOT . "/product/price.php?id=" . $object->id;
        $head[$h][1] = $langs->trans("SellingPrices");
        $head[$h][2] = 'price';
        $h++;
    }
    if (!empty($object->status_buy) || !empty($conf->margin->enabled) && !empty($object->status)) {
        if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire || !empty($conf->margin->enabled) && $user->rights->margin->liretous) {
            $head[$h][0] = DOL_URL_ROOT . "/product/fournisseurs.php?id=" . $object->id;
            $head[$h][1] = $langs->trans("BuyingPrices");
            $head[$h][2] = 'suppliers';
            $h++;
        }
    }
    // Show category tab
    /* No more required. Replaced with new multiselect component
    	if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire)
    	{
    		require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
    		$type = Categorie::TYPE_PRODUCT;
    		$head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type='.$type;
    		$head[$h][1] = $langs->trans('Categories');
    		$head[$h][2] = 'category';
    		$h++;
    	}*/
    // Multilangs
    if (!empty($conf->global->MAIN_MULTILANGS)) {
        $head[$h][0] = DOL_URL_ROOT . "/product/traduction.php?id=" . $object->id;
        $head[$h][1] = $langs->trans("Translation");
        $head[$h][2] = 'translation';
        $h++;
    }
    // Sub products
    if (!empty($conf->global->PRODUIT_SOUSPRODUITS)) {
        $head[$h][0] = DOL_URL_ROOT . "/product/composition/card.php?id=" . $object->id;
        $head[$h][1] = $langs->trans('AssociatedProducts');
        $head[$h][2] = 'subproduct';
        $h++;
    }
    $head[$h][0] = DOL_URL_ROOT . "/product/stats/card.php?id=" . $object->id;
    $head[$h][1] = $langs->trans('Statistics');
    $head[$h][2] = 'stats';
    $h++;
    $head[$h][0] = DOL_URL_ROOT . "/product/stats/facture.php?id=" . $object->id;
    $head[$h][1] = $langs->trans('Referers');
    $head[$h][2] = 'referers';
    $h++;
    if ($object->isProduct() || $object->isService() && !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
        if (!empty($conf->stock->enabled) && $user->rights->stock->lire) {
            $head[$h][0] = DOL_URL_ROOT . "/product/stock/product.php?id=" . $object->id;
            $head[$h][1] = $langs->trans("Stock");
            $head[$h][2] = 'stock';
            $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, 'product');
    /* Merged into the Join files tab
    	$head[$h][0] = DOL_URL_ROOT."/product/photos.php?id=".$object->id;
    	$head[$h][1] = $langs->trans("Photos");
    	$head[$h][2] = 'photos';
    	$h++;
    	*/
    // Attachments
    require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
    require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
    if (!empty($conf->product->enabled)) {
        $upload_dir = $conf->product->multidir_output[$object->entity] . '/' . dol_sanitizeFileName($object->ref);
    } elseif (!empty($conf->service->enabled)) {
        $upload_dir = $conf->service->multidir_output[$object->entity] . '/' . dol_sanitizeFileName($object->ref);
    }
    $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\\.meta|_preview\\.png)$'));
    $nbLinks = Link::count($db, $object->element, $object->id);
    $head[$h][0] = DOL_URL_ROOT . '/product/document.php?id=' . $object->id;
    $head[$h][1] = $langs->trans('Documents');
    if ($nbFiles + $nbLinks > 0) {
        $head[$h][1] .= ' <span class="badge">' . ($nbFiles + $nbLinks) . '</span>';
    }
    $head[$h][2] = 'documents';
    $h++;
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'product', 'remove');
    // Log
    $head[$h][0] = DOL_URL_ROOT . '/product/info.php?id=' . $object->id;
    $head[$h][1] = $langs->trans("Info");
    $head[$h][2] = 'info';
    $h++;
    return $head;
}
Esempio n. 24
0
            $from_time = '"' . date("Y-m-d H:00:00", $globals['now'] - $globals['time_enabled_comments']) . '"';
            $from_where = "FROM links WHERE link_date > {$from_time} and link_status='published' and link_category in (" . $globals['meta_categories'] . ") ";
            //$from_where = "FROM links WHERE link_status='published' and link_category in (".$globals['meta_categories'].") ";
            print_index_tabs(7);
            // Show "personal" as default
            break;
        case '_friends':
            $from_time = '"' . date("Y-m-d H:00:00", $globals['now'] - 86400 * 4) . '"';
            $from_where = "FROM links, friends WHERE link_date >  {$from_time} and link_status='published' and friend_type='manual' and friend_from = {$current_user->user_id} and friend_to=link_author and friend_value > 0";
            print_index_tabs(1);
            // Friends
            break;
        default:
            print_index_tabs(0);
            // All
            $rows = Link::count('published');
            $from_where = "FROM links WHERE link_status='published' ";
    }
} else {
    print_index_tabs(0);
    // No other view
    $from_where = "FROM links WHERE link_status='published' ";
}
do_mnu_categories_horizontal($_REQUEST['category']);
/*** SIDEBAR ****/
echo '<div id="sidebar">';
do_banner_right();
do_banner_promotions();
//if (($current_user->user_id > 0) {
if ($globals['CUSTOMCSS']) {
    $s = "SELECT * FROM customcss WHERE 1=1";
Esempio n. 25
0
function do_stats1($string)
{
    global $db;
    $comment = '<strong>' . _('Estadísticas globales') . '</strong>. ';
    $comment .= _('usuarios activos') . ':&nbsp;' . $db->get_var("select count(*) from users where user_level not in ('disabled', 'autodisabled')") . ', ';
    $votes = (int) $db->get_var('select count(*) from votes where vote_type in ("links", "comments", "posts") and vote_link_id > 0') + (int) $db->get_var('select sum(votes_count) from votes_summary');
    $comment .= _('votos') . ':&nbsp;' . $votes . ', ';
    $comment .= _('historias') . ':&nbsp;' . Link::count() . ', ';
    $comment .= _('publicadas') . ':&nbsp;' . Link::count('published') . ', ';
    $comment .= _('pendientes') . ':&nbsp;' . Link::count('queued') . ', ';
    $comment .= _('descartadas') . ':&nbsp;' . intval(Link::count('discard')) . ', ';
    $comment .= _('autodescartadas') . ':&nbsp;' . intval(Link::count('autodiscard')) . ', ';
    $comment .= _('abuso') . ':&nbsp;' . intval(Link::count('abuse')) . ', ';
    // Disabled because is too slow for InnoDB
    //$comment .= _('comentarios') . ':&nbsp;' . $db->get_var('select count(*) from comments');
    return $comment;
}
Esempio n. 26
0
		$globals['tag_status'] = 'discard';
		$rows = Link::count('discard') + Link::count('autodiscard') + Link::count('abuse');


		break;
	case '_all':
	default:
		$globals['tag_status'] = 'queued';
		$order_by = " ORDER BY link_date DESC ";
		if ($globals['meta_current'] > 0) {
			if ($cat) $rows = Link::count('queued', $cat);
			else $rows = Link::count('queued', $globals['meta_categories']);
			$from_where = "FROM links WHERE link_status='queued' and link_category in (".$globals['meta_categories'].") ";
			$tab = false;
		} else {
			$rows = Link::count('queued');
			$from_where = "FROM links WHERE link_status='queued'";
			$tab = 1;
		}
		break;
}

if($cat) {
	$from_where .= " AND link_category=$cat ";
}


do_header(_('noticias pendientes') . ' | ' . _('menéame'));
do_tabs("main","shakeit");
print_shakeit_tabs($tab);
Esempio n. 27
0
/**
 *  Return array head with list of tabs to view object informations
 *
 *  @param	Adherent	$object         Member
 *  @return array           		head
 */
function member_prepare_head(Adherent $object)
{
    global $db, $langs, $conf, $user;
    $h = 0;
    $head = array();
    $head[$h][0] = DOL_URL_ROOT . '/adherents/card.php?rowid=' . $object->id;
    $head[$h][1] = $langs->trans("MemberCard");
    $head[$h][2] = 'general';
    $h++;
    if (!empty($conf->ldap->enabled) && !empty($conf->global->LDAP_MEMBER_ACTIVE)) {
        $langs->load("ldap");
        $head[$h][0] = DOL_URL_ROOT . '/adherents/ldap.php?id=' . $object->id;
        $head[$h][1] = $langs->trans("LDAPCard");
        $head[$h][2] = 'ldap';
        $h++;
    }
    if (!empty($user->rights->adherent->cotisation->lire)) {
        $head[$h][0] = DOL_URL_ROOT . '/adherents/card_subscriptions.php?rowid=' . $object->id;
        $head[$h][1] = $langs->trans("Subscriptions");
        $head[$h][2] = 'subscription';
        $h++;
    }
    // Show agenda tab
    if (!empty($conf->agenda->enabled)) {
        $head[$h][0] = DOL_URL_ROOT . "/adherents/agenda.php?id=" . $object->id;
        $head[$h][1] = $langs->trans('Agenda');
        $head[$h][2] = 'agenda';
        $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, 'member');
    $nbNote = 0;
    if (!empty($object->note)) {
        $nbNote++;
    }
    if (!empty($object->note_private)) {
        $nbNote++;
    }
    if (!empty($object->note_public)) {
        $nbNote++;
    }
    $head[$h][0] = DOL_URL_ROOT . '/adherents/note.php?id=' . $object->id;
    $head[$h][1] = $langs->trans("Note");
    $head[$h][2] = 'note';
    if ($nbNote > 0) {
        $head[$h][1] .= ' <span class="badge">' . $nbNote . '</span>';
    }
    $h++;
    // Attachments
    require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
    require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
    $upload_dir = $conf->adherent->multidir_output[$object->entity] . '/' . get_exdir($object->id, 2, 0, 1, $object, 'member') . '/' . dol_sanitizeFileName($object->ref);
    $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\\.meta|_preview\\.png)$'));
    $nbLinks = Link::count($db, $object->element, $object->id);
    $head[$h][0] = DOL_URL_ROOT . '/adherents/document.php?id=' . $object->id;
    $head[$h][1] = $langs->trans('Documents');
    if ($nbFiles + $nbLinks > 0) {
        $head[$h][1] .= ' <span class="badge">' . ($nbFiles + $nbLinks) . '</span>';
    }
    $head[$h][2] = 'documents';
    $h++;
    $head[$h][0] = DOL_URL_ROOT . '/adherents/info.php?id=' . $object->id;
    $head[$h][1] = $langs->trans("Info");
    $head[$h][2] = 'info';
    $h++;
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'member', 'remove');
    return $head;
}
Esempio n. 28
0
/**
 * Prepare array with list of tabs
 *
 * @param   Object	$object		Object related to tabs
 * @return  array				Array of tabs to show
 */
function project_prepare_head($object)
{
    global $db, $langs, $conf, $user;
    $h = 0;
    $head = array();
    $head[$h][0] = DOL_URL_ROOT . '/projet/card.php?id=' . $object->id;
    $head[$h][1] = $langs->trans("Project");
    $head[$h][2] = 'project';
    $h++;
    $head[$h][0] = DOL_URL_ROOT . '/projet/contact.php?id=' . $object->id;
    $head[$h][1] = $langs->trans("ProjectContact");
    $head[$h][2] = 'contact';
    $h++;
    if (!empty($conf->fournisseur->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->facture->enabled) || !empty($conf->contrat->enabled) || !empty($conf->ficheinter->enabled) || !empty($conf->agenda->enabled) || !empty($conf->deplacement->enabled)) {
        $head[$h][0] = DOL_URL_ROOT . '/projet/element.php?id=' . $object->id;
        $head[$h][1] = $langs->trans("ProjectOverview");
        $head[$h][2] = 'element';
        $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, 'project');
    if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
        $nbNote = 0;
        if (!empty($object->note_private)) {
            $nbNote++;
        }
        if (!empty($object->note_public)) {
            $nbNote++;
        }
        $head[$h][0] = DOL_URL_ROOT . '/projet/note.php?id=' . $object->id;
        $head[$h][1] = $langs->trans('Notes');
        if ($nbNote > 0) {
            $head[$h][1] .= ' <span class="badge">' . $nbNote . '</span>';
        }
        $head[$h][2] = 'notes';
        $h++;
    }
    require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
    require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
    $upload_dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->ref);
    $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\\.meta|_preview\\.png)$'));
    $nbLinks = Link::count($db, $object->element, $object->id);
    $head[$h][0] = DOL_URL_ROOT . '/projet/document.php?id=' . $object->id;
    $head[$h][1] = $langs->trans('Documents');
    if ($nbFiles + $nbLinks > 0) {
        $head[$h][1] .= ' <span class="badge">' . ($nbFiles + $nbLinks) . '</span>';
    }
    $head[$h][2] = 'document';
    $h++;
    if (empty($conf->global->PROJECT_HIDE_TASKS)) {
        // Then tab for sub level of projet, i mean tasks
        $head[$h][0] = DOL_URL_ROOT . '/projet/tasks.php?id=' . $object->id;
        $head[$h][1] = $langs->trans("Tasks");
        $head[$h][2] = 'tasks';
        $h++;
        $head[$h][0] = DOL_URL_ROOT . '/projet/ganttview.php?id=' . $object->id;
        $head[$h][1] = $langs->trans("Gantt");
        $head[$h][2] = 'gantt';
        $h++;
    }
    complete_head_from_modules($conf, $langs, $object, $head, $h, 'project', 'remove');
    return $head;
}