当前位置: 首页>>代码示例>>PHP>>正文


PHP Societe::LibStatut方法代码示例

本文整理汇总了PHP中Societe::LibStatut方法的典型用法代码示例。如果您正苦于以下问题:PHP Societe::LibStatut方法的具体用法?PHP Societe::LibStatut怎么用?PHP Societe::LibStatut使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Societe的用法示例。


在下文中一共展示了Societe::LibStatut方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: loadBox

 /**
  *  Load data into info_box_contents array to show array later.
  *
  *  @param	int		$max        Maximum number of records to load
  *  @return	void
  */
 function loadBox($max = 5)
 {
     global $conf, $user, $langs, $db;
     $langs->load("boxes");
     $this->max = $max;
     include_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
     $thirdpartystatic = new Societe($db);
     $this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedSuppliers", $max));
     if ($user->rights->societe->lire) {
         $sql = "SELECT s.nom, s.rowid as socid, s.datec, s.tms, s.status";
         $sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
         if (!$user->rights->societe->client->voir && !$user->societe_id) {
             $sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
         }
         $sql .= " WHERE s.fournisseur = 1";
         $sql .= " AND s.entity IN (" . getEntity('societe', 1) . ")";
         if (!$user->rights->societe->client->voir && !$user->societe_id) {
             $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . $user->id;
         }
         if ($user->societe_id) {
             $sql .= " AND s.rowid = " . $user->societe_id;
         }
         $sql .= " ORDER BY s.tms DESC ";
         $sql .= $db->plimit($max, 0);
         $result = $db->query($sql);
         if ($result) {
             $num = $db->num_rows($result);
             $i = 0;
             while ($i < $num) {
                 $objp = $db->fetch_object($result);
                 $datec = $db->jdate($objp->datec);
                 $datem = $db->jdate($objp->tms);
                 $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, 'url' => DOL_URL_ROOT . "/fourn/fiche.php?socid=" . $objp->socid);
                 $this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $objp->nom, 'url' => DOL_URL_ROOT . "/fourn/fiche.php?socid=" . $objp->socid);
                 $this->info_box_contents[$i][2] = array('td' => 'align="right"', 'text' => dol_print_date($datem, "day"));
                 $this->info_box_contents[$i][3] = array('td' => 'align="right" width="18"', 'text' => $thirdpartystatic->LibStatut($objp->status, 3));
                 $i++;
             }
             if ($num == 0) {
                 $this->info_box_contents[$i][0] = array('td' => 'align="center"', 'text' => $langs->trans("NoRecordedSuppliers"));
             }
             $db->free($result);
         } else {
             $this->info_box_contents[0][0] = array('td' => 'align="left"', 'maxlength' => 500, 'text' => $db->error() . ' sql=' . $sql);
         }
     } else {
         $this->info_box_contents[0][0] = array('td' => 'align="left"', 'text' => $langs->trans("ReadPermissionNotAllowed"));
     }
 }
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:55,代码来源:box_fournisseurs.php

示例2: loadBox

	/**
	 *      \brief      Charge les donnees en memoire pour affichage ulterieur
	 *      \param      $max        Nombre maximum d'enregistrements a charger
	 */
	function loadBox($max=5)
	{
		global $user, $langs, $db, $conf;

		$this->max=$max;

        include_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
        $thirdpartystatic=new Societe($db);

		$this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedProspects",$max));

		if ($user->rights->societe->lire)
		{
			$sql = "SELECT s.nom, s.rowid as socid, s.fk_stcomm, s.datec, s.tms, s.status";
			$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
			if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
			$sql.= " WHERE s.client IN (2, 3)";
			$sql.= " AND s.entity = ".$conf->entity;
			if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
			if ($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
			$sql.= " ORDER BY s.tms DESC";
			$sql.= $db->plimit($max, 0);

			dol_syslog("box_prospect::loadBox sql=".$sql,LOG_DEBUG);
			$resql = $db->query($sql);
			if ($resql)
			{
				$num = $db->num_rows($resql);

				$i = 0;
				$prospectstatic=new Prospect($db);
				while ($i < $num)
				{
					$objp = $db->fetch_object($resql);
					$datec=$db->jdate($objp->datec);
					$datem=$db->jdate($objp->tms);

					$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
			            'logo' => $this->boximg,
			            'url' => DOL_URL_ROOT."/comm/prospect/fiche.php?socid=".$objp->socid);

					$this->info_box_contents[$i][1] = array('td' => 'align="left"',
			            'text' => $objp->nom,
			            'url' => DOL_URL_ROOT."/comm/prospect/fiche.php?socid=".$objp->socid);

					$this->info_box_contents[$i][2] = array('td' => 'align="right"',
 			           'text' => dol_print_date($datem, "day"));

					$this->info_box_contents[$i][3] = array('td' => 'align="right" width="18"',
     			       'text' => str_replace('img ','img height="14" ',$prospectstatic->LibProspStatut($objp->fk_stcomm,3)));

                    $this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
                    'text' => $thirdpartystatic->LibStatut($objp->status,3));

                    $i++;
				}

				if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedProspects"));
			}
			else
			{
				$this->info_box_contents[0][0] = array(	'td' => 'align="left"',
    	        										'maxlength'=>500,
	            										'text' => ($db->error().' sql='.$sql));
			}
		}
		else {
			dol_syslog("box_prospect::loadBox not allowed de read this box content",LOG_ERR);
			$this->info_box_contents[0][0] = array('td' => 'align="left"',
        'text' => $langs->trans("ReadPermissionNotAllowed"));
		}
	}
开发者ID:remyyounes,项目名称:dolibarr,代码行数:76,代码来源:box_prospect.php

示例3: loadBox

 /**
  *  Load data for box to show them later
  *
  *  @param	int		$max        Maximum number of records to load
  *  @return	void
  */
 function loadBox($max = 5)
 {
     global $user, $langs, $db, $conf;
     $langs->load("boxes");
     $this->max = $max;
     include_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
     $thirdpartystatic = new Societe($db);
     $this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedCustomers", $max));
     if ($user->rights->societe->lire) {
         $sql = "SELECT s.nom as name, s.rowid as socid";
         $sql .= ", s.code_client";
         $sql .= ", s.client";
         $sql .= ", s.code_fournisseur";
         $sql .= ", s.fournisseur";
         $sql .= ", s.logo";
         $sql .= ", s.datec, s.tms, s.status";
         $sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
         if (!$user->rights->societe->client->voir && !$user->societe_id) {
             $sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
         }
         $sql .= " WHERE s.client IN (1, 3)";
         $sql .= " AND s.entity IN (" . getEntity('societe', 1) . ")";
         if (!$user->rights->societe->client->voir && !$user->societe_id) {
             $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . $user->id;
         }
         if ($user->societe_id) {
             $sql .= " AND s.rowid = {$user->societe_id}";
         }
         $sql .= " ORDER BY s.tms DESC";
         $sql .= $db->plimit($max, 0);
         dol_syslog(get_class($this) . "::loadBox", LOG_DEBUG);
         $result = $db->query($sql);
         if ($result) {
             $num = $db->num_rows($result);
             $line = 0;
             while ($line < $num) {
                 $objp = $db->fetch_object($result);
                 $datec = $db->jdate($objp->datec);
                 $datem = $db->jdate($objp->tms);
                 $thirdpartystatic->id = $objp->socid;
                 $thirdpartystatic->name = $objp->name;
                 $thirdpartystatic->code_client = $objp->code_client;
                 $thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
                 $thirdpartystatic->client = $objp->client;
                 $thirdpartystatic->fournisseur = $objp->fournisseur;
                 $thirdpartystatic->logo = $objp->logo;
                 $this->info_box_contents[$line][] = array('td' => 'align="left"', 'text' => $thirdpartystatic->getNomUrl(1), 'asis' => 1);
                 $this->info_box_contents[$line][] = array('td' => 'align="right"', 'text' => dol_print_date($datem, "day"));
                 $this->info_box_contents[$line][] = array('td' => 'align="right" width="18"', 'text' => $thirdpartystatic->LibStatut($objp->status, 3));
                 $line++;
             }
             if ($num == 0) {
                 $this->info_box_contents[$line][0] = array('td' => 'align="center"', 'text' => $langs->trans("NoRecordedCustomers"));
             }
             $db->free($result);
         } else {
             $this->info_box_contents[0][0] = array('td' => 'align="left"', 'maxlength' => 500, 'text' => $db->error() . ' sql=' . $sql);
         }
     } else {
         $this->info_box_contents[0][0] = array('align' => 'left', 'text' => $langs->trans("ReadPermissionNotAllowed"));
     }
 }
开发者ID:Samara94,项目名称:dolibarr,代码行数:68,代码来源:box_clients.php


注:本文中的Societe::LibStatut方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。